3 ms·
Instead you slowed yourself to a crawl. (Which is not to say anything good about Java. The key to Java was elucidated by Mark Dominus: "I enjoyed programming i
by ncmncm 4y ago
Instead you slowed yourself to a crawl.
(Which is not to say anything good about Java. The key to Java was elucidated by Mark Dominus: "I enjoyed programming in Java, and being relieved of the responsibility for producing a quality product.")
- Gibbon1 4y agoFriend of mine says the great thing about Java is when things go sideways you can just quit and get another gig.
- ncmncm 4y agoJava's secret sauce was that it liberated a whole generation of Microsoft sharecroppers. Microsoft has since clawed some back via its C# marketing, but cannot dictate a new "framework" every second year as it once did.
- zozbot234 4y agoJava's actual secret sauce was that it was mostly like C/C++, but with no unsafe memory accesses. It was essentially the Rust of the late 1990s, only a whole lot slower and clunkier than real Rust. There was a lot of enterprise software being rewritten from C++ to Java as a result.
- pmontra 4y agoFor me it was no more malloc and free for every stupid little thing inside every function I had to write (string processing, arrays, etc.) But I was already using Perl for web development (no malloc no free) and I wasn't overly interested in Java. I made some money out of it later on, probably none past 2012. Then always languages with garbage collection, possibly interpreted. I don't like to have to compile and build to deploy.
- AnimalMuppet 4y agoI think Java's real secret sauce was the library. It had everything - much more than the standard C/C++ library. > ... but with no unsafe memory accesses. Mostly true. But you could still get a null pointer exception in Java - which is especially weird because Java doesn't have pointers.
- ncmncm 4y agoThe library was utterly necessary, purely because the people the language was meant for would have been completely at sea without. The contempt Java's designers held for its users fairly drips, in what they write about it.
- tialaramex 4y agoIn essence all you have for objects in Java is pointers. For the primitive types, like long, you can't get a null pointer exception, because there really is no pointer, but for any object type it's actually a pointer, the object itself lives on the heap and you're given a pointer to it, if the object is null, that's a null pointer. They don't feel much like pointers from a language like C because you're not provided with pointer arithmetic - you can't try to add my_object + 16 as you could in C - and because Java was a modern language which knows what you mean when you write foo.bar, unlike C and C++ which expect you to remember whether foo is a pointer and write foo->bar so that the poor compiler needn't figure it out. For modern Java the compiler does escape analysis and may conclude an object cannot "escape" in which case it may be created as part of the stack frame of the code which uses it instead of on the heap, but it's still basically a pointer. This is all rather awkward, for example Java's 64-bit double precision floating point number is a primitive, always 8 bytes on your stack no need for a pointer to anything - but if you want your custom four 16-bit integers type (maybe representing RGBA) that's an Object so it is treated differently even though it's also just 8 bytes. C gets this part right, your custom types (struct, and to a lesser extent enum and union) aren't treated so much worse than the language built-in types. Anyway, it's Memory Safe because the null pointer exception is essentially the same behaviour as if you try to unwrap() a None in Rust, the JVM isn't going to let you just "press on" as you might in C, you've got a programming error and must either recover from that or your program aborts.
- 4y ago
- ncmncm 4y agoNobody at the time gave a hoot about "unsafe memory accesses". That is a wholly recent conceit. Nobody then cared about security. Sendmail was how e-mail was delivered, and was, believe it, widely admired. Java was just enough like the C++ of 1990 to compete, but with garbage collection and a big library, and without confusing pointers, so lower-skilled programmers could use it. That is all. Computers were literally thousands of times slower than today. Java was considered just barely fast enough. But without freeing programmers from the Microsoft frameworks treadmill, it would have sunk without a trace.
- AlbertCory 4y ago> Nobody at the time gave a hoot about "unsafe memory accesses" Right. We had Purify for that.
- ncmncm 4y agoThat came later. Then valgrind ate its lunch. Some people still use that! Sanitizers, now.
- Danidada 4y agoaccording to James gosling (the creator of Java) in a interview from a year or two ago with lex Friedman he said he wanted a C++-like language but without its pitfalls: pointers bugs and bad concurremcy/synchronization primitives. This was to bring enterprise programmers (who mainly used c++ at that point) to the JVM ecosystem. He expected an explosion of jvm languages after that which, sadly, didn't happen. I think there were more pitfalls which I don't remember now. Maybe he is saying bull now to look more cool, but he sounded rather convincing in the interview. I'd recommend to listen to it
- jvanderbot 4y agoThat may be why it was designed, but GP was talking about why it was adopted. Those are such totally different things that it's not worth comparing them. Lisp?
- 4y ago
- pmarreck 4y agoThe best thing Java did (along with Apache) was make people take open-source seriously. There was a time circa the early 2000's when you either did Microsoft closed-source, or you did Java, with not much else out there.