back in my day we only had one language. it was called ASSEMBLY. wanted to make the computer do something? you had to ask it yourself. and that worked JUST FINE
Well la-tee-da, fuck my AND gates and inverters.
Look at moneybags over here with his instruction sets.
Back in my day when you wanted a computer to do something, you just asked her to do it and then underpaid her because women can’t hold real jobs.
Gates and inverters!!?
Luxury!
In my day we had to use transitors and resistors and, if we were lucky, maybe capacitors.
Look at me, I have a friend at bell labs.
We had to use vacuum tubes, and we liked it.
Back in my dsy we only had non programmable computers. Wanted to make the computer do something? You had to specifically build in the function. And that worked JUST FINE
Back in my day we had an abacus and if you wanted it to do something you had to do it your damn self. And that worked JUST FINE.
Oh hello mister fancy pants with your abacus. We carved notches in rocks and we were happy with that.
Back in my day people worked 16h days everyday and had no time for math or computers. And that was JUST FINE.
Ok Boomer
My favorite is “Java is slow” said by someone advocating for a language that’s at least 10 times slower.
My favourite is “all the boilerplate” then they come up with go’s error checking where you repeat the same three lines after every function call so that 60% of your code is the same lines orlf error checking over and over
Things like lombok make the boilerplate less of an issue in modern Java too
And god help you if you forget those 3 lines somewhere and you silently have database failures or something else.
Yeah, that’s the other thing - it does become easier to accidentally fail to deal with errors and the go adherents say they do all of that verbose BS to make error handling more robust. I actually like go, but there’s so much BS with ignoring the pain points in the language.
When you handle all your errs the same way, I’d say you’re doing something wrong. You can build some pretty strong err trace wrapping errs. I also think it’s more readable than the average try catch block.
You still need to add error handling to every call to every function that might raise an error
Those who say such things are straight ignorant
They’re basically fashion victims.
I wouldn’t say so. They are inexperienced. They don’t know where the bottleneck of most of the modern software is (it’s io in 80-90% of cases) and how to optimize software without rewriting it to C++
How are they ignorant? It’s a known fact that java is slow, at least slower than some others. Sure, it’s still fast enough for 95% of use cases, but most code will run faster if written in, say, C. Will have 10x the amount of code and twice as many bugs though.
Java is indeed slower than C, Rust, in some cases than Go.
But that doesn’t mean that
code will run faster if written in, say, C
Again, like 80-90% of production code are bounded by disk/network io operations. You will gain performance from using C in embedded systems and in heavy calculations (games, trading, simulations) only.
Which is exaxtly what I said, that it’s fast enough for most use cases.
In theory though, you will “gain performance” by rewriting it (well) in C for literally anything. Even if it’s disk/io, the actual time spent in your code will be lower, while the time spent in kernel mode will be just as long.
For example, you are running a server which reads files and returns data based on said files. The act of reading the file won’t be much faster, but if written in C, your parsers and actual logic behind what to do with the file will be.
But it’s as you said, this actual tiny performance gain isn’t worth it over development/resource cost most of the time.
the jvm brings enough bugs to outweigh any benefits there…
it is relatively fast, but it’s slow in that it takes up a bunch of resources that could be doing other things…the jvm brings enough bugs to outweigh any benefits there…
Please name a few
i decline your invite to debate the merits of java and jvm… i will instead walk my dog through this beautiful park here…
but, it’s all been said on top level comments on this post.
it’s trash, and honestly, even if it was perfect, sun microsystems has ruined any potential benefits.Have a good walk at least
takes up a bunch of resources that could be doing other things…
You cannot get rid of garbage collectors, but you can always compile your java into binary to reduce the memory footprint.
sea lion
Bullshit.
One project I worked on had 10 different languages. That was rough. But even your basic full stack web application is usually 5 languages: SQL, a backend language, HTML, CSS and JS. Usually some wheel reinventing frameworks thrown in for good measure. 5 languages is light these days.
And don’t forget the CI “language” plus a bunch of bash scripts, Helm, Kubernetes, etc.
Probably a bunch of hacked together Python to copy stuff between fileshares. Bonus points if it runs with a .bat file and a Windows scheduled task.
Without Ansible or Terraform? What about SQL specific for each rdbms?
I work in Java, Golang, Python, with Helm, CircleCI, bash scripts, Makefiles, Terraform, and Terragrunt for testing and deployment. There are other teams handling the C++ and SQL (plus whatever dark magic QA uses).
Write your business critical process in brainfuck and have job security for life.
Sprinkle in some whitespace code…
deleted by creator
Java is great if you actually want to earn a living.
You’re not wrong, it’s still a staple today, but it lost a lot of its shine a while ago. They are mimicking “new” features introduced in other languages, but make a point to preserve retrocompatibility.
I can’t imagine how convoluted the JVM has become in the last 10 years.
I don’t really see how that is bad…? Java wants to be widely applicable and taking the best features from other languages helps that goal, right?
C++ fanboys will talk a bunch of shit about Java for this, but c++ has been doing this same shit (and more poorly) pretty much since its inception.
And most of the newer Java stuff is syntactic sugar, so I’m not sure why that commenter is calling out JVM implementations. I’m guessing they don’t know much about the JVM, since you can compile these higher level syntax tricks down into bytecode just like you might compile more verbose source code.
Static analysis of compiled code with javap might be more difficult, but I’m betting the commenter doesn’t know what that is either.
I think the last new instruction the JVM added was invokedynamic like 10 years ago. I believe they did it so lambdas could be called efficiently. Polymorphic incline cache and stuff.
But the JVM has grown more complex in other ways. The way to force simd instructions is pretty wild, for example.
I don’t know enough to call it a mess or not. It works though.
Because Java sucks at taking those features. I mean look at Java’s Optional abomination of a class and compare it to C# or Typescript’s optional chaining (
?.
) language feature.There’s a reason Kotlin was created, because Java is still bogged down by all its legacy kruft.
It still boggles my mind that C# is as good as it is given where it comes from. Java really fucked up with type erasure and never fully recovered imo.
True, but functional languages are great if you want to live comfortably.
https://survey.stackoverflow.co/2023/#section-salary-salary-and-experience-by-language
Difficulty of finding such a job not shown.
That one dude still using Delphi is getting screwed.
Also, these salary numbers seem… real low. I get that it’s the median so maybe a huge number of overseas engineers are pulling the results down but in my neck of the woods 105K is less than what we pay juniors.
Could you have picked any creepier clown foto? Lol
That’s almost comically besides the point of the comment.
Skip step 3, and just switch to Kotlin. Worked wonders for Android
Yes indeed, and it feels really good.
Is Kotlin bad?
Kotlin is Java with all the suck taken out.
It’s a modern, ergonomic language that runs on the JVM and removes as much GD boilerplate as it can.
It’s fantastic.
deleted by creator
https://kotlinlang.org/docs/maven.html That’s not true, you can use Maven if you want!
deleted by creator
Cargo is really simple, which is great, but also limiting. Maven is much more complex, but for good reason - there’s use cases, especially around multi-artifact projects and version sharing, where cargo would require either some glue or you run into some interesting edge cases. Usually, Rust isn’t used for the kinds of big, wacky projects with a million dependencies that companies write in Java/Kotlin, so those kinds of use cases are considered more unusual.
Gradle, in my opinion, makes itself complex because it’s all code, is very brittle, and several of its features just don’t work right and require workarounds. When it works, it builds fast and it works well, but getting it to work, and how often you have to get it to work again…not worth it.
deleted by creator
Sorry, one more question. What does ergonomic mean in regards to programming languages?
Lots of little quality of life things. For instance, in Kotlin types can be marked nullable or not. When you are passing a potential null into a non-nullable argument, the compiler raises an error.
But if you had already checked earlier in scope whether or not the value was null, the compiler remembers that the value is guaranteed not to be null and won’t blow up.
Same for other typechecks. Once you have asserted that a value is a given type, you don’t need to cast it everywhere else. The compiler will remember.
Ooh, thank you
Kotlin is the tits
And one of them is Java?
Yes Java, Scala, Kotlin, Jython and Perl
Of course Perl is in there lol
Whatever you do in perl, I can do in PL/SQL.
I would rather use pgsql or tsql instead of PL/SQL, mostly because of oracle.
What about Groovy?
Forgot about that one, even if I just worked on a Jenkins script 🙄
Seems reasonable to me. A scripting language, a compiled language, SQL, some CI/CD DSL, and a dealer’s choice.
Java isn’t bad but, I’m not a fan of how verbose and convoluted it is. That said, I’ll take Java over here JS any day of the week.
Java is a great language. But programming languages are tools - not every tool is the right tool for every job
I’m failing to see the problem. As long as one of the languages isn’t PHP they’re still probably better off 🤷
What’s wrong with PHP?
PHP5 was basically the Adolf Hitler of programming languages
You know how something can be so terrible it ruins something forever? Like the hitler stache
5.3 was a big leap for PHP. It became actually very good at that point.
I learned it when it was on 4 and boy oh boy was that something.
But nowadays, with 8, it works great, tooling is fantastic. I just kinda wish the documentation, which is absolutely top notch for 90% of the language, was this good for the rest 10%.
I want to play around with Fibers, but I just don’t get the info I want to.
pthreads were so out of date in docs it was shameful.
But the language is good, typing is coming along nicely, and basically the only thing I want PHP to do is to call Postgres and encode the output to json. Works like a charm.
Yeah i’ve heard good things about it recently. I’ve always liked how easy curl can be in php.
Adding typing seems like it would fix most of the problems i did run into but
Has PHP raised its standards on function naming? Or do you still have batshit situations like realEscapeString2() because the first 30 other functions for escaping strings are deprecated?
Lol okay maybe that’s true :) but PHP is great nowadays and with frameworks like Symfony and Larvel it’s easier than ever to build applications
I’m actually sad about the Hitler stache, it was also the Chaplin stache.
If you get even 1 thing wrong, the entire program stops working and you don’t get any information about it. Turns out those cryptic errors like “error: object reference not set to instance of an object at address 0x007e00” are kind of important information to have. Unless you specifically know where it’s crashing, finding the source of the problem is like finding a needle in a haystack. If it’s your own code it’s borderline manageable but you’ll regret every decision that led you up to that point. If it’s someone else’s code such as an old project from 9 years ago that doesn’t work anymore, absolutely forget about it.
The only advantage of php is that it’s incredibly lightweight. I was running an Athlon XP home server on Gentoo as late as 2022 and still had php running despite only having the SSE1 instruction set and a cpu less powerful than whats probably on a modern led lightbulb.
But ACKTCHUALLY I think django and python bottles can be run on even shittier computers than php can since they’re both python programs and python has been demonstrated to be runnable on a pentium 1. So there is no reason to use php.
We’re talking about Java, not JavaScript, right?
Both are fine tbh. Javascript has come a long way from a decade ago, and mixing in a decent framework like jquery does wonders.
decent framework
jquery
It’s current year, you have to choose one. there really isn’t any reason to use jquery other than legacy code
Jquery is still extremely relevant. React exists as well, and is also a good framework. I just happened to think of jquery first.
what does jquery give you that vanilla js doesn’t? it was good before browser inconsistencies got ironed out and js didn’t have as many features built in, but nowadays I have no idea why someone would need it
The type system is still really bad, and apparently TypeScript gets mixed with native libraries in common practice, which makes a bad situation worse when something breaks.
Edit: Messed up the name, fixed.
The typing system is just a “quirk”. As long as you understand the (admittedly annoying) exceptions to the way your brain expects typing to work, everything works quite well.
And tbh, transpiled TypeScript libraries can be called from JavaScript as if it was JavaScript… because it is JavaScript. There’s no need to worry about typing unless you’re doing something like passing a string into a function that expects an int, and you’d run into those same problems if the function was originally JavaScript.
Edit: a word
I mean, sure, but taking that argument to it’s logical extreme we should still be programming in assembly, because you can if you just know enough to do it.
A language is a tool. If it’s harder to use successfully than the next tool it’s a worse tool.
No? How is that the logical conclusion? You need to understand any language, and any quirk of that language, in order to effectively write in it. JavaScript is powerful, and moving farther every iteration. Strong typing is just not something it takes into consideration. In the same way that C# doesn’t take white space into consideration, and python doesn’t terminate its instructions with semicolons.
Each language is different, each language has its own quirks that you need to understand and get used to. If that wasn’t the case, we would have one objectively “perfect” programming language to use in all situations, on all machines, for every use case.
You need to understand any language, and any quirk of that language, in order to effectively write in it.
That seems to imply they all have the same amount of quirks, which I think most people here would agree is untrue
Something like Haskell has far, far fewer quirks than x86 assembly code. It really only has quirks to do with interactivity; everything else is very predictable and visible in the code. Meanwhile, assembly code is but a maximally useful set of quirks in a specific electronic circuit.
Ditto if you look at older languages. FORTRAN is unpleasantly quirky, which is why it’s almost obsolete.
If that wasn’t the case, we would have one objectively “perfect” programming language to use in all situations, on all machines, for every use case.
I mean, I hold out hope that that will eventually happen, at least for the vast majority of use cases and machines. Obviously we’re not there yet.
There have been languages that basically dominate their own niche. C/C++ was almost the only game in town for performance coding until someone discovered a way to compile mid-level code while also guaranteeing memory safety. Memory errors were a terrible quirk, so now Rust might steal its crown.
I personally don’t think that’s the issue with the typing system. With vanilla js if I’m looking at a function that has say four parameters that are not trivial objects like strings but are actually complex (think dependency injection) it’s very difficult for me to know what these objects are other than reading through the code of the function.
Actually, even if the parameters are simple, I’m not sure of that until I look into the function and see what it’s doing. This is a huge pain in the ass most the time, because I just wanna look at the function name its parameters and move on. However, that being said, most of this can be remedied with jsdocs and a good linter/lsp.
we should use only the best language for everything.
Codebase is now 30 languages
And?
there aren’t 30 best languages, that’s not how “best” works. we use only the best language. for everything.
That’s exactly how “best” works. Everyone thinks their language is the greatest and shits on everything else. If they all chose “the best” there would be 50 of them. Opinions are like assholes. Everyone has one.
too bad everyone else is wrong
Lol Principal Skinner meme
If only it was intentional…
yeah if only I was joking. wouldn’t that be funny
Nah it’s you.
Oh really? There’s one language that’s “best” in all contexts and for every single use case? Care to enlighten the rest of us oh wise one?
HolyC
scratch
C
I love building websites in C!
Hey now, CSS is just C with some extra S’s. Just rip off those S’s and you’re styling in C.
People used to do it.
Not saying you can’t, but is it the “best”?
Just use Kotlin
This is literally how this all started for us lol. Senior wanted to try to migrate everything to Kotlin in our project. Migration never finished. Now one of our major repos is just half Kotlin half Java. Devs on our team learn Kotlin by unexpectedly encountering it when they need to touch that code.
Maybe it’s because I know both languages but is that really a big issue for people? The interop is great, and kotlin is very readable, so the cost of context switching between the two is miniscule.
Some people have an extreme aversion to learning new things though. I feel that holding yourself to the standards and limits of your lowest performers isn’t a great thing.
Sounds like you’re making progress, your devs are slowly learning a better language that will let them work faster and will soon be able to help port the rest of the codebase and then you can really accelerate when no one needs to touch or know Java.
I really hope so. Last code I reviewed was full of !! and companion objects trying to emulate Java static instead of top-level consts. Even I’m still trying to figure out what idiomatic Kotlin looks like. We got a ways to go…
Doesn’t Kotlin has interoperability with Java? I didn’t used it much yet but I’m about to in a few months. Is it that difficult to just refactor things to Kotlin when you need to change something in the project? I’m asking because I just can’t work with verbose languages and would prefer Kotlin to Java everyday.
The interoperability is both a blessing and a curse imo since it let us half-ass the integration by leaving a bunch of Java code unconverted. I could start refactoring everything but then my team would stop reviewing my PRs due to the diff size (and then my manager would eventually find out that I’ve been using up work time doing this instead of shipping features during crunch week).
I really much prefer Kotlin to Java. I just wish my team had actually had a commitment to it instead of just sorta using it with no migration plan.
Just use Scala*** ((objectively better language¹))
- scala does not support breaking out of loops, it does errors on early returns, uses parentheses for array indexing, compiles extremely slowly, …
Just use Clojure****
The python code we inherited had some performance issues. One of the guys was like “we should rewrite this in Java”.
Luckily the boss was not an insane person and shut that down. The issue was an entirely stupid “…and then we do one query per project” behavior that worked fine when the company was small but unsurprisingly started to suck as users created more projects.
Instead of a months long complete rewrite, we had a two hour “let’s add profiling… Oh wow that’s a lot of queries” session.
I would say that over a decade of my career was coming in as a freelancer to fix codebases where a couple of people tought they knew better than the previous ones and proceeded to add yet another very different block to a codebase already spaghetiffied by a couple such people.
Sometimes it was coding style, sometimes it was software design, sometimes it was even a different language.
I reckon thinking that just deploying one’s EliteZ skills on top of an existing code base without actually refactoring the whole thing will make it better is a phase we all go through when we’re still puppy-coders.
The majority of puppy-coders I’ve encountered (including myself) actually want to refactor rather than just add onto. They are fundamentally correct in this, but they don’t grasp that 1) few companies want to acknowledge that the code base which is their greatest tangible “asset” is actually complete shit, and 2) that due to their inexperience, their refactored replacement is probably going to end up as bad as or worse than the original.
This is super easy, you just fire all the Java devs and hire real engineers.