6 ms·
Which of the top languages is actually well designed? All of them have their area of opportunity.
by Aldo_MX 10y ago
Which of the top languages is actually well designed? All of them have their area of opportunity.
- wyager 10y agoRust and Haskell are both extremely well designed. Most of the "top languages" by percentage usage are 20+ years old, so I can't fault them that much for being badly designed, but we should definitely stop using them.
- codedokode 10y agoRust looks very complicated to me because there are "lifetimes" and you need to think where to put those single quotes properly. Not a language for a beginner. Haskell doesn't support OOP if I remember correctly. And it is complicated too.
- steveklabnik 10y agoDue to lifetime elision, you rarely need to explicitly write lifetimes. I participated in the last Ludum Dare game competition, my game never used an explicit lifetime. That said, it is true that Rust has tricky parts. The domain is inherently complex.
- wyager 10y agoI never said it was for a beginner, just that it was well designed. Lifetimes are no more complicated than stuff you regularly run into in C++, though. Python is a great beginner-friendly language, but that doesn't mean it's well-designed in other respects or appropriate for large software projects. It wouldn't really make sense for Haskell to "support OOP" in the usual since. The OOP paradigm is mostly useful when you have mutability. Another way of looking at it is that you don't need OOP in Haskell because it exposes better ways of interacting with data that aren't present in most OO languages, like ADTs and Typeclasses.
- brassic 10y agoHaskell is also more than 20 years old.
- wyager 10y agoWhich is why I fault PHP at least a little bit :)
- Aldo_MX 10y ago> we should definitely stop using them That will never happen, you can't write code like this in Rust: <!-- Snippet taken from an example of tightly-coupled and unmaintainable code in the Clean Architecture in PHP book[1] --> <body> <?php $results = mysql_query('SELECT * FROM customers ORDER BY name'); ?> <h2>Customers</h2> <ul> <?php while ($customer = mysql_fetch_assoc($results)): ?> <li><?= $customer['name'] ?></li> <?php endwhile; ?> </ul> </body> Even when the previous code is an abomination, it is absolutely easy to write, this is why languages like PHP are a success, the barrier to entry is definitely low. The issue comes when the whole industry buys the idea that PHP equals bad code, fail to appreciate the progress the language has had in the last years, fail to appreciate the effort behind projects like Symfony, and become completely foreign to the current best practices. [1] https://leanpub.com/cleanphp https://leanpub.com/cleanphp
- wyager 10y agoI don't know if you can do that in Rust (I suspect you can with some effort), but you can certainly do it in Haskell (with slightly different syntax, of course) using a library like Blaze-HTML5. Your argument is a bit spurious; you're right insofar as you can't write PHP in a language that's not PHP.
- Aldo_MX 10y ago> I suspect you can with some effort That is my point. You require effort in an order of magnitude greater than with PHP in order to achieve the same result, which in the case of a beginner, is the difference between continuing their journey in programming or abandoning the ship. You are failing to see the big picture and are taking for granted the plethora of initial setup you have to do to begin working with a language like Rust (ex. generating bindings for a database driver written in C if it doesn't exist in cargo), you were just nitpicking in the syntax of the previous example (which BTW, I took care to clarify it was an example of bad code to avoid people not familiar with PHP from getting the wrong idea). It was my fault to say "you can't" in my previous message (see Atwood's Law), I really meant "it requires too much effort".
- justinhj 10y agoLook at c++ as a counter example. Once immensely popular and yet I don't think many people would say it was well designed