90 points

let’s not act like Java’s error log is useful

permalink
report
reply
10 points

skill issue

permalink
report
parent
reply
7 points

The same applies to using the core dump.

In fact, the Python one is the lest useful of the trio.

permalink
report
parent
reply
10 points

When the day comes that you need gdb you will indeed be amazed at how fucking powerful it is. If your server crashes grab that core dump!

permalink
report
parent
reply
16 points

I think it’s pretty useful, be interested to hear your hangups with it though because it’s definitely not perfect.

If something goes wrong and I have a stack trace, that plus the type of exception will almost always be enough for me to figure out what’s wrong at least as a starting point. I’ve worked mostly with JVM languages in my career though so maybe I just don’t know how bad it actually is.

permalink
report
parent
reply
1 point

It’s not bad. It’s better than what most languages give you

permalink
report
parent
reply
131 points
*
Deleted by creator
permalink
report
parent
reply
7 points

you can follow any exception down to the exact line of code

Which is usually not a piece of code written by us and is caused by another piece of code not written by us either

permalink
report
parent
reply
5 points
*
Deleted by creator
permalink
report
parent
reply
10 points
*

Does your IDE not highlight the lines written by you in a different colour? Of course that doesn’t help when it’s an error in production!

permalink
report
parent
reply
4 points

but you can follow any exception down to the exact line of code (or JNI call, I guess) where the problem occurs.

But, it’s not really where the problem occurred. How often do you get a stack trace and the bug fix is at the line referenced by the stack trace? Almost never. It’s more that it takes you down to the exact line of code where the effects of the problem are bad enough to affect the running of the program. But, the actual problem happened earlier, sometimes much earlier.

For example, NullPointerException isn’t actually the problem, it’s a symptom of the problem. Something didn’t get initialized properly, and nobody noticed for a while, until we tried to use it, and got a null pointer. Sometimes it’s easy to go from the effect (null pointer) to the cause (uninitialized thing). But, other times that “thing” was passed in, so you have to work backwards to try to figure out where that thing comes from, and why it’s in that broken state.

Sure, it’s better than nothing, but it’s still frustrating.

permalink
report
parent
reply
13 points
*
Deleted by creator
permalink
report
parent
reply
52 points
*

Super-advanced java devs like me do it like try{} catch (Exception e) { System.out.println("something went wrong"); e.printStackTrace(); }

permalink
report
parent
reply
1 point

Implying you can’t consistently go to the same line every time and it always has what you need.

permalink
report
parent
reply
7 points

It’s extraordinarily useful

permalink
report
parent
reply
39 points

Imagine unironically praising Java.

permalink
report
reply
13 points

Java good

permalink
report
parent
reply
-5 points

Opinion bad

permalink
report
parent
reply
4 points

Java is awesome. There ya go

permalink
report
parent
reply
3 points

Oh yes, let’s pick on the weak programming languages because haha funi

permalink
report
parent
reply
20 points
*

Java is a traditional and conservative language, which has its strong upsides, like the syntax being familiar to many people who haven’t used the language before. It’s a language that brought us the JVM, gave a job to many people and established fundamentals for other languages to inspire and improve on. If you don’t like Java, you can just use another language for the JVM, like Scala, Kotlin or Clojure.

permalink
report
parent
reply
-1 points

You only named one upside, I can’t think of any other, and C-like syntax is pretty common, so it’s not much of an upside. It’s at least debatable whether the JVM is a good thing at all - the majority of languages get along perfectly well without it, and there’s no reason to believe the ones that do target it wouldn’t be doing just fine if it didn’t exist. It’s weird to say Java gave a job to anybody - the demand to have software written resulted in programmers being hired; if Java hadn’t been pushed on the market by Sun, it would have just been another language. Java didn’t establish any fundamentals at all, it just borrowed from other places. While all three of the other languages you mention are interesting, for sure, I’m not sure why somebody who doesn’t like Java should limit themselves to JVM languages.

permalink
report
parent
reply
7 points

and inspired C#, which is pretty rad! (humble opinion… preparing for downvotes because I don’t get the feeling lemmy is where M$ devs hang out)

permalink
report
parent
reply
5 points

Only a fool could miss the value C# has when used to solve the proper problems :)

permalink
report
parent
reply
14 points

Java is good. Supporting Java legacy is bad

permalink
report
parent
reply
29 points
*

The one thing I can say about java; the kinds of people who like Java tend to really like Java. Everyone else just leaves them to it.

permalink
report
parent
reply
15 points

And the people hating on it somehow never used any version above 8, which is 10 years old and EOL.

permalink
report
parent
reply
2 points

I’ve used Java 21 pretty extensively, and it’s still comically bad compared to various alternatives, even apples-to-apples alternatives like C#. The only reason to use Java is that you’ve already been using Java.

permalink
report
parent
reply
5 points

Same could be said about PHP

permalink
report
parent
reply
4 points

Oh I’m firmly in the second camp. They can use whatever version they like, as long as I don’t have to go near it.

permalink
report
parent
reply
7 points

Java: Not all poo poo.

permalink
report
parent
reply
9 points

All the ideas are good.

Only the ideas are good.

permalink
report
parent
reply
22 points

Nevermind that the C++ program is two orders of magnitude faster when completed.

I would love to learn and use Rust but I’m a embedded systems guy. Everything of consequence is C and C++.

permalink
report
reply
12 points

If the embedded system is old or poorly-maintained enough, there might be more Rust than you’d think.

permalink
report
parent
reply
3 points
6 points

I meant faster than Python, not faster than Rust. Rust is fast.

permalink
report
parent
reply
1 point

Ah. OK. Makes more sense.

permalink
report
parent
reply
7 points

There’s embedded rust for a few platforms. Using it on ESPs is fun

permalink
report
parent
reply
73 points
*

Rust developer: I’d like to compile some code

Rust compiler: the fuck you are

permalink
report
reply
43 points

The rust compiler holds your hand, wraps you in blankets, makes you hot chocolate, kisses you on the forehead before it gently and politely points out what you did wrong and how you can solve it step-by-step. It would never think of something as heinous as swearing at you, shame on you for insulting my wife’s honour like this.

permalink
report
parent
reply
29 points

Rust compiler is passive agressive, like:

“There’s an error at line 286 because you still don’t know how to use the borrow checker after all this time ♥️”

permalink
report
parent
reply
4 points

its a compiler. That is at best projection, especially considering how the compiler’s error feedback is designed to be firm yet gentle.

permalink
report
parent
reply
20 points

I need a rust compiler in my life 😍

permalink
report
parent
reply
8 points

Damn right. And once it compiles… it works.

permalink
report
parent
reply
1 point

Meet my friend: .unwrap()

permalink
report
parent
reply
4 points

The rust compiler produces a flawless understanding of your code, and then quits out because understanding that code is a Nightly-only feature and you’re using the stable build.

permalink
report
parent
reply
4 points

except when it gives errors about lifetimes of some object.

boy, that makes my brain hurt

permalink
report
parent
reply
2 points

I don’t know from where this legend comes from but lifetimes/concurrency/macros errors are brain-hurting.

Most of the time I find myself dropping project because I wrote my program in a correct way but Rust just does not like how it is designed lol. I can’t get shit done with this language

permalink
report
parent
reply
77 points

Python: So you used spaces and tabs for indentation? NOW DIE!

permalink
report
reply
22 points

Good. Spaces and tabs for indentation should never be mixed in any language other than Whitespace.

permalink
report
parent
reply
4 points
*

Some people use tabs for indentation and spaces for alignment. It kind of gets the pros of tabs (user configurable indent-width) and the pros of spaces (alignment). That doesn’t work in Python where you can’t align stuff and the interpreter doesn’t allow mixing tabs with spaces, but in other languages it is a possible style.

permalink
report
parent
reply
-1 points

There are no pros to tabs. Configure tabs to a number of spaces.

permalink
report
parent
reply
3 points

Raw adjust with tabs, fine adjust with spaces.

Don’t laugh, people are actually doing that.

permalink
report
parent
reply
47 points

Mixing spaces and tabs should be a warcrime.

permalink
report
parent
reply
-5 points

Find me anyone who claims they use tabs for indentation, and I bet I’ll find at least one case where they’re using both tabs and spaces.

The only safe way to avoid war crimes is to avoid tabs.

permalink
report
parent
reply
7 points

Why would I use spaces if I use tabs? Also, it seemd like a huge waste of time hitting the space bar so many times…

permalink
report
parent
reply
7 points

I use the tab key but I’m pretty sure vs code converts that to spaces

permalink
report
parent
reply
7 points

Don’t IDEs just replace any tab with 4 spaces anyways? Pretty sure VSCode does

permalink
report
parent
reply
9 points

And in Python, it’s merely a SyntaxCrime.

permalink
report
parent
reply
4 points

Are you ok?

permalink
report
parent
reply
5 points

Mixing tabs and white spaces in 2024 is categorically a you problem lmao

permalink
report
parent
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 5.3K

    Monthly active users

  • 1.5K

    Posts

  • 33K

    Comments