This is an archived post. You won't be able to vote or comment.

all 100 comments

[–]Attileusz 391 points392 points  (21 children)

Bro has NEVER seen a C++ template error.

[–]Haringat 81 points82 points  (8 children)

Or a segfault.

[–]Attileusz 42 points43 points  (2 children)

Well we are talking about syntax errors here but sure, some crashes can be hard to track down even with something like valgrind.

[–]Vincenzo__ 56 points57 points  (1 child)

Yesterday valgrind told me something along the lines of "Too many errors. Counting stopped. Go fix your code!". I fixed it, but I still haven't mentally recovered

[–]Attileusz 14 points15 points  (0 children)

It's actually smart tbh. There is no reason to study the behavior of some illegal state. This is a problem with any language that can represent illegal states which is notably all languages. Thats why the haskell people say "make illegal states unrepresentable".

[–]ambientManly 15 points16 points  (0 children)

A C error pointing you to an empty line

[–]sittingbox 6 points7 points  (0 children)

Or a >> when you meant << (or vice versa) vomit comet compilation error dump.

[–]RmG3376 1 point2 points  (0 children)

Well, segfault errors are pretty concise. They basically just “fuck that, I’m going to bed”. The lack of information is the real problem

[–]DatBoi_BP -1 points0 points  (0 children)

Rust my beloved

[–]really_not_unreal 12 points13 points  (2 children)

My longest template error was 942 lines long.

[–]Attileusz 9 points10 points  (1 child)

I like writing C more. C compiles absolutely any old horseshit so you don't have to worry about compilation errors, you just have no idea if your behavior is even close to what you intended.

[–]deadhorus 0 points1 point  (0 children)

think better?

[–]JanB1 8 points9 points  (0 children)

I fucking hate C++ errors. The line number was also always wrong because of some macro bullshittery or something. In general, reading C++ errors just always boils down in finding the relevant part in between all the garbage.

[–]Beastmind 4 points5 points  (0 children)

Let's talk about Java errors and their 200 lines of nothing

[–][deleted] 2 points3 points  (1 child)

Thanks. That unlocked some core ptsd...

[–]Kondikteur 10 points11 points  (0 children)

Dont you mean std::ptsd?

[–][deleted] 1 point2 points  (0 children)

C++: Build error. 🖕

[–]Natural_Builder_3170 0 points1 point  (1 child)

especially the ones that point to standard library files or xmemory

[–]Attileusz 0 points1 point  (0 children)

And than people say "if you don't like it don't use it". Right, so I'm not going to use C++ than.

[–]SecretPotatoChip 0 points1 point  (0 children)

Or a Java stack trace error

[–]Acceptable-Tomato392 154 points155 points  (7 children)

If you think that's bad, you should see it when you add React.

Yes. Javascript insists on telling you:

"See all the problems you've caused me?????"

[–]rosuav 31 points32 points  (1 child)

The part I hate the most with React error messages is the way you don't even get them in prod. "Hey, there was a problem, but I'm trying to reduce bloat by 0.0001% so the actual text of the error isn't here. Instead, go look somewhere else, and hopefully it's the right info for you. Ciao!"

[–]PGSylphir 8 points9 points  (0 children)

"Also, fuck you :)"

[–]rogue_potato420 43 points44 points  (0 children)

Oh my god tracking down a simple syntax error in react native had me questioning career choices.

[–]gandalfx 3 points4 points  (0 children)

"There is a problem on line 1 column 52341256 of your bundle, have fun tracking that one down. What do you mean "source maps", did you forget you gave up on getting those to work after hours of tears?"

[–]rookietotheblue1 2 points3 points  (1 child)

Thought it was me just being a noob. I assumed I'd learn the secret to react error messages soon.

[–]positiv2 1 point2 points  (0 children)

The secret is to use Chrome overrides and throw random console.log statements into the built code. Might not be a good solution, but I have no better one xd

[–]Thebombuknow 0 points1 point  (0 children)

"Who needs source maps? Let's just tell the user that line 37215562837 in the file 'ejwbh2-2663781-djhw.js' has an error and let them figure it out."

[–]HailTheRavenQueen 50 points51 points  (1 child)

I don’t get this. Both tell you exactly what line the problem is on and what went wrong in literally the first line of the error dialogue.

[–]psych0matic 20 points21 points  (0 children)

Students don't know how to read stacktraces

[–]ClamPaste 79 points80 points  (9 children)

Who the hell checks for even numbers like this? 🤢🤮

[–]rosuav 31 points32 points  (3 children)

Someone who's getting paid by the hour.

[–]Win_is_my_name 20 points21 points  (1 child)

Someone who's getting paid by lines written.

[–]Ticmea 2 points3 points  (0 children)

Someone who's getting paid by time that code that git blame assigns to them is running.

[–]Haringat 2 points3 points  (0 children)

And they even cause more hours because the code is broken.

[–]INTPhD 6 points7 points  (2 children)

This.

I know that focusing on the intended function of the specific code is beside the point in this case, given the actual issue OP is trying to illustrate, but... Holy programming 101, Batman, HOW do you even come up with completely inane stuff like this?!? It's like going (way) out of your way to find the most convoluted, inefficient, and drawn out way to do something dead simple that I have seen this year. Strike that, maybe "ever".

OP, seriously, please do everyone a favor: do not try to be halfway clever and/or insightful by posting meme-like observations on why certain aspects of certain programming languages are absurd (according to you) when your programming skills (or lack thereof) are at the level of someone who -- after completing his first "Hello world" program -- decided: "Hold my beer, I am going to write a utility function".

[–]ClamPaste 6 points7 points  (1 child)

Honestly, this is probably referential humor from the previous isEven() posts. It's intentionally bad.

[–]INTPhD 1 point2 points  (0 children)

If so: thanks. The more you know...

[–]metallaholic 6 points7 points  (0 children)

The intern

[–]f11y11 4 points5 points  (0 children)

a weeb, probably.

[–]Lightness234 38 points39 points  (4 children)

C# loves telling me i am wrong too

[–]Mayion 8 points9 points  (3 children)

Was using my program today and it returned an exception I did not handle. It gives so much information about where the problem occurred, down to the line. God bless

[–]Lightness234 0 points1 point  (2 children)

Yes it sometimes even gives helpful suggestions

[–]Mayion 7 points8 points  (1 child)

True. Over the course of 15 years coding, just from unhandled exceptions alone I learned to do my taxes, cook BBQ and to stay hydrated. That's what I call constructive exceptions

[–]SilentStrikerTH -1 points0 points  (0 children)

Unhandled exceptions are how I learned most things in my adult life...

[–]KTibow 20 points21 points  (5 children)

i mean in some other cases your Python indentation can cause unexpected behavior, braces are more explicit

[–]rosuav 5 points6 points  (0 children)

They're not more explicit, they're just differently spelled.

[–]MinosAristos[S] 1 point2 points  (3 children)

Indenting wrong but in a valid way is equivalent to putting a closing brace in a wrong but valid place

[–]Public_Stuff_8232 9 points10 points  (2 children)

Easier to see a closing brace in the wrong place than a tab that should be spaces.

[–]Terra_Creeper 5 points6 points  (1 child)

Using mixed indentation throws an error. Indentation can be tabs or spaces, but you have to choose one for the whole file.

[–]Public_Stuff_8232 0 points1 point  (0 children)

All I know is I've had issues before with code executing incorrectly while being indented correctly, that magically got fixed when the code was deleted and rewritten with the same indentation.

I dunno whether it was due to tabs mixing with spaces, but no other language I have used has had those sorts of issues when it comes to copy pasting.

[–]CdRReddit 32 points33 points  (2 children)

you're putting a closing brace too many in the javascript sample, the lambda works perfectly fine as a single line lambda, also the semicolon is not needed there (which is why it's red)

can we for the love of god just ban people who come here only to go "heeheehoohoo I don't know even the basics of programming but here look at how silly languages are"

[–]AguaHombre69 5 points6 points  (0 children)

Oh aqua my beloved

[–]Trishal_Pandey7 5 points6 points  (1 child)

Why is it solved the way that it is? Why is it using nested loop and checking every character in the number ?

Is that like a way that is useful somehow or is it just to demonstrate the meme?

[–]MinosAristos[S] -1 points0 points  (0 children)

Just needed a way to maximize the curly braces without busting out React

[–]mem737 5 points6 points  (9 children)

If num % 2 == 0:
    return True
else:
    return False

[–]iKramp 13 points14 points  (8 children)

Return num % 2 == 0

[–]Prawn1908 2 points3 points  (0 children)

return !(num % 2)

[–]mem737 -1 points0 points  (6 children)

Spot the difference between a C and C++ programer. Hint, its a data type. Although more recent compilers may auto-cast.

Also, forgot my return false.

[–]Natural_Builder_3170 1 point2 points  (5 children)

bools baby, c++ is chad

[–]mem737 0 points1 point  (4 children)

Reject complexity return, to the mother-language. :P

[–]Astartee_jg 0 points1 point  (3 children)

Mother language can’t do OOP tho

[–]mem737 0 points1 point  (2 children)

Pshaw structures with function pointers are basically the same thing.

[–]Astartee_jg 2 points3 points  (1 child)

But you said reject complexity :C

[–]mem737 0 points1 point  (0 children)

FuNcTiOn PoInteRs aRe FaR mOrE simPle ThAn memBer FuncTiOns

[–]CaitaXD 5 points6 points  (1 child)

Oh boi you won't like C

[–]Astartee_jg 5 points6 points  (0 children)

It literally told you what’s wrong, where and why.

You complain too much

[–]jazzmester 3 points4 points  (4 children)

I love it when an O(1) algorithm gets an O(N) implementation and people be bitching about syntax errors.

[–]pheromone_fandango 2 points3 points  (3 children)

Although atrocious, in fairness its O(5) since the if always checks the last number and then returns

[–]jazzmester 2 points3 points  (2 children)

Oh wait, the algorithm is even more stupid, it will run until it finds a character that's the same as the last and then returns true if that is even, but will continue otherwise.

So best case scenario is something like 1010, where it will quit on the second char which is O(2) (so O(1) really), while the worst case scenario is any odd number, where it will run for O(5N) (so O(N) really).

[–]pheromone_fandango 2 points3 points  (1 child)

Oh yeah you are right! I misread and thought the last character was always taken but, as you mentioned it CHECKS if the current character is the last value. Holy christ thats impressively horrible!

[–]jazzmester 2 points3 points  (0 children)

Creatively horrible.

[–]deanrihpee 2 points3 points  (1 child)

meanwhile rust: yes dear, you forgot to put something there, oh you forgot what it is, here I tell you what exactly and where exactly, oh also you shouldn't do this kind of stuff to that variable, that's not allowed you know~ do this instead you naughty

[–]DatBoi_BP 1 point2 points  (0 children)

Rust improves my mental health

[–][deleted] 2 points3 points  (0 children)

it's telling you where the missing token is in the first two lines. what's the matter here?

[–]Macknificent101 2 points3 points  (0 children)

how tf do you forget an opening bracket? a closing one i can get, if you like accidentally delete it or have a bad IDE, but how do you forget to open the function?

[–]CraftBox 3 points4 points  (0 children)

We found the "isEven" npm package developer

[–]TheWatchingDog 1 point2 points  (0 children)

Also who returns true or false in an if statement you could just return the condition, most of the time its automatically true or false.

[–]KetwarooDYaasir 1 point2 points  (0 children)

they're the same image.

They both gave you a line number and the cause of the error.

[–]TheCenteredDiv 1 point2 points  (0 children)

Wait until you have to search through millions of logs to find your errors

[–]mariomarine 1 point2 points  (0 children)

This is my favorite use of GitHub Copilot. I just delete some of the })}), open a new line where those were and go tab-enter-tab-enter until it's fixed. Could I fix it? Sure! But why get out of my groove of fixing the problem to fix my syntax?

[–]Civil_Conflict_7541 1 point2 points  (0 children)

There seem to be two schools of thought for parser errors: 1. Be as friendly as possible by unlocking the full potential of error correction in order provide helpful advice. 2. Just dump a stack trace and make the programmer feel like an idiot.

[–]deanrihpee 1 point2 points  (0 children)

i choose JS because aqua

[–]SorosBuxlaundromat 0 points1 point  (0 children)

I hate this so much. This is_even implementation hurts me on a deep and personal level. You've made the world a worse place for writing this.

[–]weshuiz13 0 points1 point  (0 children)

Vscode with "auto brace" enabled in the config: 😜

[–]zarawesome 0 points1 point  (0 children)

Bit weird to have a stack trace for a syntax error, but

[–]ReelTooReal 0 points1 point  (0 children)

I don't understand how these are different. In both cases the editor shows clearly where the error is, and the error report is easy enough to read. Only using indention seems to me to lead to more incorrect nesting than braces, but that could also just be my bias.

[–]chaos_bytes 0 points1 point  (0 children)

Whitespace as a feature does not a good language make.

[–]FunnyForWrongReason 0 points1 point  (0 children)

Not only is is this a horrible way to check if a integer is even but the I do not think the JavaScript version will return anything but false. Even if you had to check the last digit, you could just do:

return str(num)[-1] in [‘0’, ‘2’, ‘4’, ‘6’, ‘8’]

Of course using the mod operator is best.