3 ms·
Arguably, this is what higher level languages like Java and C++ provide. Tight organizational language metaphors that help implement design patterns in a thoug
by justonepost 11y ago
Arguably, this is what higher level languages like Java and C++ provide. Tight organizational language metaphors that help implement design patterns in a thoughtful, consistently structured manner.
- crusso 11y agoThat's kind of like saying that McDonalds provides a healthy meal because they have salads on the menu. The truth is that most people still eat the burgers and fries. Although higher level languages provide some features for organization, you still must have the discipline and know what you're doing to use them properly.
- TickleSteve 11y agoThe languages provide the mechanism.... The developer provides the skill needed to produce the organisation.
- jeremiep 11y agoThe abstractions provided by Java and C++ aren't very good compared to those provided by, say, Haskell and Clojure. For the most part, design patterns exist merely to fix the lack of a simpler lambda construct in the language. They more often than not add complexity rather than remove it. The biggest balls of spaghetti code I've ever seen we're always OOP with design patterns. I've seen far more clean C codebases than Java or C++ ones.
- nly 11y agoC++ has lambdas and the standard library is, although baroque, heavily functional and well thought out.
- jeremiep 11y agoMy bad, I should've specified legacy C++. You're right that with lambdas now C++ has gotten much better. However I would argue against the STL being well thought out. Every single large-scale C++ project I've worked on threw it out the window before even staring out. Our current project already takes an hour and a half to compile without parallel builds and barely uses templates at all. I still prefer plain old C to C++ most of the time.
- trb8 11y agoI would be hesitant of this so easily accepting this view due to selection bias. Java and C++ are often found in huge, legacy, or enterprise oriented code bases. The are plenty of ways to use the abstractions in Java and C++ to write nice code. Just like it is possible to find a Scala or Clojure code base that went crazy with the usage of "cutting edge" features and abstractions in those languages. And at least with Java, your IDE will always be able to navigate the code effectively.
- jeremiep 11y agoI completely agree it takes discipline and experience to write clean code in any language. What I'm saying is that it takes more discipline to cleanly use Java or C++ than it does to use Haskell or Clojure. For the simple reason that most of the abstractions provided by the former languages add to the program's complexity rather than remove it. There's an excellent explanation by Rich Hickey in Simple Made Easy: http://www.infoq.com/presentations/Simple-Made-Easy http://www.infoq.com/presentations/Simple-Made-Easy