5 ms·
> Where Java championed forcefully protecting programmers from themselves, Ruby included a hanging rope in the welcome kit. I don't think this is something to
by cballard 11y ago
> Where Java championed forcefully protecting programmers from themselves, Ruby included a hanging rope in the welcome kit.
I don't think this is something to be admired in a language. Java is a bad language to work in because it's not expressive, not because it protects programmers (which it doesn't).
Thankfully, we are seeing this shift the other way with the growing popularity of languages like Rust and Swift.
- kyllo 11y agoJava is a bad language to work in because it's not expressive, not because it protects programmers (which it doesn't). Compared to C/C++, yes it does. Java protects you from out-of-bounds array access, uninitialized access, buffer overflows, use-after-free, double-free, etc etc.
- hawleyal 11y agoSo, basically nothing in real world domain. The protections are basic at best. The most common errors are runtime exceptions, zero protection offered. YMMV.
- kyllo 11y agoThe Heartbleed Bug[1] sure felt like a real world domain problem to me. If OpenSSL were written in a memory-safe language like Java it would not have happened. [1] http://heartbleed.com/ http://heartbleed.com/
- kazagistar 11y agoMemory safety is a protective feature as much as sending texts is a smartphone feature. Sure, it is nice and very useful, but almost all languages provide it, so it does not count for much these days.
- MrBuddyCasino 11y agoThats how it should be, but the frequency of C/C++ threads on HN and the discussions about memory safety that will inevitably follow unfortunately paint a different picture. God I hope Rust will shoot C++ in the backyard and put it out of its misery.
- thedevil 11y ago"Ruby included a hanging rope in the welcome kit" is very poor wording. There's advantages and disadvantages to flexibility. I personally think there's tradeoffs that need to be balanced. But even if we accept the assumption that more flexibility is always a good thing, the wording is still poor. That wording vividly and convincingly explained the exact reason why too much flexibility is a bad thing, rather than the good side of it. If the author happens to read my comment, I recommend a rewrite saying something about trusting developers or maximizing their power instead of giving them a tool to metaphorically kill themselves.
- bliti 11y agoWhat do you mean that Java is not expressive? Care to elaborate?
- the_af 11y agoHe/she probably means that Java is a language where relatively simple ideas often must be expressed in a needlessly verbose way. Needless verbosity affects a language's quality because it clutters the code and hides the main ideas behind incantations and boilerplate.
- bliti 11y agoI've written old Java (C++ like), enterprise Java, Android Java, and currently am writing modern Java. From Android and forward there have been improvements in verbosity and boilerplate. Modern Java (8) is actually nice. Yes, the enterprise code is still approaches a rude goldberg machine level of complexity and verbosity but that is changing. Frameworks like spark simplify the web side, and projects like Jhipster (horrible name, great project) automate a lot of the boring work and provide a good base to work from. At the end of the day, verbosity in Java is mostly due to its ecosystem. Its quite different than that of smaller languages like Python, or Go. Where there is a community wide effort to share code and make things simple. Not so in Java.
- bjz_ 11y agoStill no type inference, pattern matching, or ADTs. In a statically typed language that causes lots of verbose ceremony that shouldn't be needed in the 21st century. We've known how to do this stuff for decades. That said, I would take Java's verbosity over Ruby's lack of static types. I write Ruby in my day job, and refactoring is a pain, and the same old type errors keep popping up day after day, causing 500s in production. It seems no amount of TDD can prevent them.
- bliti 11y agoAgreed. It does cause lots of verbose ceremony, as you put it (I'm stealing that). Its quite the experience using a Java IDE and noticing how much code is automatically included by pressing tab. Quite comical that Netbeans has shortcuts words for printing to terminal. Your second point really hits home. I've been battling with Python and runtime types. Its just the nature of the beast. That's why I've been focusing more on languages with solid type systems. I will happily trade verbosity for types. :)