4 ms·
While I agree with you that there should be more than one way to solve a problem (although I wouldn't say Java's philosophy is against that), when it comes to a
by Sandman 14y ago
While I agree with you that there should be more than one way to solve a problem (although I wouldn't say Java's philosophy is against that), when it comes to actually writing code, I want to have one clear and understandable way in which something should be written. That is to say, I prefer it when a language has strong opinions on what the code should look like. This is in stark contrast with, for example, Scala's philosophy. Scala is a language that tries to be everything for everybody and its syntax reflects that. There are a lot of situations where you can write the same thing in two or more different ways. Can it reduce verbosity? Sure, but it also ads complexity. In the end you get code that can be a real hodgepodge of different styles , depending on how many developers work on it, and can look really messy. Conventions can help that, but aren't conventions really only here to make up for a lack of proper syntax rules? This is why I prefer that a language has minimal syntax with clear rules and really, preferably, only one way to write something.