4 ms·
It's the language with the highest ratio of (useful work / LOC), so it's the least verbose language. This makes it very suitable to write and understand complex
by speleding 2y ago
It's the language with the highest ratio of (useful work / LOC), so it's the least verbose language. This makes it very suitable to write and understand complex scripts, because the reduced boilerplate means less cognitive overhead for the programmer. As a result, experienced programmers can be extremely productive with it.
The well-known Rails framework uses this to great effect, however, some people argue that the choice of "convention over configuration" and extensive use of meta-programming, derisively called "magic", make it less suitable for inexperienced teams because they get too much rope to hang themselves and the lack of explicitness starts working against you if you're not careful.
- continuational 2y agoExperienced teams love magic?
- dochne 2y agoExperienced teams know to be careful and sparing with its use.
- psychoslave 2y agoIt depends which kind of magic. Everybody love some magic to be in its life, as long as it doesn't reveal to be a curse unintentionally coming out from a good willing wish. Also you don't want all and everything being the results of spells you don't have a clue how they are cast.
- nix-zarathustra 2y ago>It's the language with the highest ratio of (useful work / LOC), so it's the least verbose language Why doesn't clojure fit the bill here?
- psychoslave 2y ago)))))))))))))))))
- lucasoshiro 2y agoI see some people saying that Ruby is too much "magic", while what is magic is Rails. Ruby itself can have its high useful work / LoC ratio thanks to its syntax. For example, you can spawn a thread with: thread = Thread.new do # thread code end ... thread.join In this example we can see that it's not magic, only concise. I wrote more about it here: https://news.ycombinator.com/item?id=40763640 https://news.ycombinator.com/item?id=40763640
- Kwpolska 2y agoCreating a new thread is equally simple in Java: var thread = new Thread(() -> { // Thread code }); thread.start(); // ... thread.join();
- speleding 2y agoYes, but it's a good example of how Java is about twice as verbose to do the same work. The Ruby version of that can be written as simply: Thread.new{ ... thread code ...}.join The extra verboseness quickly adds up if every statement takes twice as much code.
- lucasoshiro 2y agoFair. I must admit that I'm not aware of the recent features of Java. Last time I really needed it was the time that we needed to instance an anonymous class for callbacks. I still find the block syntax in Ruby cleaner though. Kotlin is another language that has this Ruby-style blocks for callbacks.
- empthought 2y ago> It's the language with the highest ratio of (useful work / LOC), so it's the least verbose language. That's not even close to true. Even setting aside APL and its descendants, even setting aside Perl, any of the functional programming languages like Haskell and Scala are less verbose. (The relative lack of success of those languages should indicate why minimizing verbosity is a poor aim to target.)
- speleding 2y agoDon't just focus on the language syntax, the high ratio of useful work to verbosity is in large part owing to the excellent design of the standard library, which is available without including any headers or downloading third party libraries. This is where it handily beats out any of the alternatives you mention.