9 ms·
I remember when I was a young assembly programmer and I looked down on those obtuse C programmers who needed such a slow high-level language. After high-school,
by metanonsense 4y ago
I remember when I was a young assembly programmer and I looked down on those obtuse C programmers who needed such a slow high-level language. After high-school, having read all those fantastic W. Richard Stevens books I simply could not understand why anybody on earth wanted to use C++ when C was easily capable of modeling complex object structures. When they forced us to use Java, I was deeply in shock: was this really a programming language or more a toy for little kids and why would they want to slow down computers to a crawl?
- ncmncm 4y agoInstead 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.
- 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.
- bluetomcat 4y agoI started my journey with trying to learn C++ in the late 1990s when it was the “cool” thing. Most of the books and the sparse educational material on the web back then made little sense to me. I wanted to instruct a computer to do cool things like the games I played or the programs I used, but all I got was obtuse passages about taxonomies of animals and shapes (CAnimal, CDog and CShape, CSquare). Stuff like virtual functions and constructor types was deeply uninteresting and irrelevant for me at that point. Then came the “aha” moment. I downloaded a few tutorials which used the GLUT library from C and I was instantly amused. Now I could draw 3D teapots and text and rectangles with almost no boilerplate and I had examples to learn from. A turning event that has influenced all aspects of my life for the latter 20 years.
- colechristensen 4y agoI had the same experience trying to learn C++ as a kid, the book i got had all sorts of OO examples and all i could get is “why would I want to do this?” and my progress learning to program was put back by years.
- kevstev 4y agoI feel the same. Coming of age in the late 1990s OOP was all the rage and while I found a lot of it interesting and useful, it created a lot of its own problems and the solution was often just "more oop" in the form of design patterns and such. Meanwhile I always preferred composition over inheritance and templates made a lot more sense to me than crazy object hierarchies ever did. I almost actually considered leaving programming in the mid 2000s but then I started seeing the tide slowly turn away from OOP, or at least I found voices that agreed that OOP is not the only answer and I felt a sense of relief. Then as latency became a more and more important thing in algo trading, it eventually fell out of favor almost entirely. But yeah, OOP has a place but it really went overboard for awhile and there was jiggawatts of brainpower spent on trying to make it work when straight C or other approaches would have worked much better- and with much more grokable code!
- colechristensen 4y ago
- TomK32 4y agoThat makes me wonder Ruby is the language I'll be stuck with for another 20 years and just be content with a balance between performance of servers and my productivity...
- tr1ll10nb1ll 4y agoAnother 20 years from now, I highly doubt you'd have to even care as much about performance of servers as you do now stemming from the use of a language that keeps you productive. Remember, hardware is getting more powerful and cheaper.
- ncmncm 4y agoNobody cares about performance of servers today. Maybe you have noticed that they are not now programmed with performant languages?
- cellularmitosis 4y agoThey are mostly getting faster in parallel, but barely faster sequentially. And the popular dynamic langs are ill suited to take advantage of this.
- sizzzzlerz 4y agoCouple of year out of college and into my first engineering job, I went to work on a job to write code for the 68000-based controller of a signal processing system. It had been decided that we were to use this new language called C, which no one on the team was experienced with. I was sent to Houston to attend a one week class on C with the expectation that I could mentor the rest of the team. They were having to learn it from K&R. We used a new compiler from Green Hills, which was quite buggy, to compile our fragile code to run on a CPU our hardware colleagues had built that had its own bugs. We had a couple of big ass in-circuit emulators on which to do our debugging. They had quirks of their own, as well. Somehow, we were able to get it working quite well. As big of a challenge as it was, we had an absolute glorious time!
- arthurcolle 4y agoSo did you guys win?
- oaw-bct-ar-bamf 4y agoWhat can I tell you, We develop hardware and software using IFX microcontrollers, (HW still has bugs) compiling our code using GreenHills / GCC / HighTech compilers (they all still have bugs), debugging and testing equipment has its own quirks and bugs. Oh and our software for sure is ripe with detected and undetected bugs as well. Not much has changed over the years ;)
- sizzzzlerz 4y agoExcept that we all get older ;)
- Calavar 4y agoWell, to be fair, C compilers produced significantly slower code back then. And when C++ came around, code that made heavy use of templates was dog slow until compiler technology caught up and could reliably inline templates. And Java was slow before it got generational GC and JIT.