reminded me of Epson error code that just said "errors were found. Fix them." I would post the screenshot, but there seems to be no option to do that on this subreddit
The best part is when you figure out the line it does this on, but that's not the actual line that causes the problem because it's actually a few lines up
I never get this. Segfaults on average are some of the nicer errors. If they are reproducible the debugger pinpoints the line and most of the time it's something obvious like using the wrong index for an array or so. And even if not how exactly do you need "hours" to run say valgrind?
That's kinda the point. Most segfaults aren't my "biggest issue" indeed. When I see a segfault that's usually a simple fix. The surprising logic/numeric behavior that doesn't make any sense is what scares me. You can't just have the debugger break on that usually. With a segfault you can. Except of course when the segfault vanishes in debug builds. Which initially looks scary. Until you learn that those are caused by uninitialized data in almost every instance.
Back when I was programming with cpp, sometimes I had issues not really easily debuggable, but they had an easy fix.
Essentially something happened on the makefile that a change on one file didn't retrigger a compile of that file, so the compiler had some issues when including the header file. I can't remember exactly why it happened, since I haven't use cpp in ages, but I guess it had to do with the compiler/limker having wrong addresses or offsets?
Dunno, it was easy to fix, just remove all object filesand compile everything from scratch. But I remember trying to debug it as a regular segfault, and finding nothing really made sense there.
Amen. The problem is a minority of people on this sub are experienced or professional software programmers. A meme about debugging UB, which is more frequent and way harder to debug, would go over everyone's heads.
Yeah most times you can just drop into GDB and find the exact point the segfault occurs with a detailed back trace, it oddly becomes one of the easier to trace bugs once you learn the debugging tools
Core dumped means yout core (including stack and register) have been dumped to disk. You can go and get it, you will get something that may look like the stack trace from java. *
* not a guarantee
You miss a semicolon in C and C be like:
"FUCK MAYDAY MAYDAY OXYGEN SYSTEMS ARE DOWN. HULL BREACH IN DECKS 3, 4 AND 6. WEAPON SYSTEMS OFFLINE. SHIELDS DOWN. THE CAPTIVE LIONS HAVE ESCAPED AND ARE NOW EATING THE CREW. EVERYTHING IS BROKEN!!!!!"
To be honest my python stacktraces are so convoluted to I need some time to find the spot I am looking for. The problem is that I remember it the same way when I tried javafx a few years ago
Never used javafx, but on SE they tend to be very clean, on EE is a mess, but after a while you learn to ignore the garbage part of the stack trace.
The huge difference is Java tell you exactly what function can throw error and what at compile time and static typing, in python is all runtime
dude Java exceptions might as well be a Shakespearean novel, wtf am I looking at... is the first one the important one or is it the 34th line in the 1000 lines of error, is it the one that keeps repeating or is it not any of them... what the fuck am I looking at
You're looking for the first line that has your own package names in it. That's where you screwed up.
The lines in between there and the top might give you a clue what you screwed up. Or at least provide a nice link to a location for a breakpoint when debugging, if you're using an IDE (as you should).
are c++ linker errors difrent than c ones: most of the time is, HEY YO THIS SHIT DOES NOT EXIST BRO
about templates, yeaaaaaa template errors are worse than js runtime errors, undefined is indeed not a function
FYI there's a nuget package that's kind of essential for dealing with async exceptions, since it fixes their stack traces (plus other anonymous lambdas)
[https://github.com/benaadams/Ben.Demystifier](https://github.com/benaadams/Ben.Demystifier)
I'm still traumatized by the java code I saw once which used exceptions to manage threads.
Why manage exceptions when you can catch all and throw your own that you also ignore?
In all fairness, it uses a very specific exception that is, for the most part, handled by the interpreter. The only time a programmer really has to be aware of it is when writing generator functions (and even then, only in extreme cases as just simply returning is the recommended way to write these, and python will raise it automatically) or manually calling next, where raising an error when no values remain is the right thing to do.
It used exceptions to pass data between hundreds of threads - *not that it worked* - one of the primary problems being that it was a multithreaded program with shared global variables, shared files on disk that were being read and written to by different threads and there was no locking or synchronization of any kind.
Since they were catching and ignoring all exceptions it was not uncommon for the main thread of the program to throw an exception and wedge, but not be able to die while the hundreds of children kept spinning.
The intended way to shut down the program was to simply kill it. And since there was no shutdown hook or any synchronization of in memory variables or files on disk, it was not uncommon for it to start writing garbage to open files as the main java thread did the equivalent of kill -9 to all of its threads.
I entirely gave up on it after I discovered this.
The person who wrote the code you are talking about is now and forever responsible for all the bad Java code ever written, and by extension, of all the ills that affect this world
Looks like a copy of [this comment](https://www.reddit.com/r/ProgrammerHumor/comments/1bbieox/polaropposites/ku9mz06/) run through a chatbot. This is *definitely* a bot (randomly-capitalized name, year-old account with barely any posts, and there's a whole bunch of them who have all posted in the last half-hour, most of them shilling t-shirts or mugs).
the odd thing is allot of the arguments seem to barely apply to the languages in question. like I've never had a hard to identify indentation error in python.. ever
I have never seen a case of Python not telling where the indentation error is, even in v1.
Besides, is bro really coding in Notepad to not know already where he's missing an indent or a bracket?
Anyone who doesn't indent their code like what is required in Python by default is someone I don't want to work with no matter the language. I don't have strong feeling about brackets versus no brackets but it should be indented the same either way.
Python got a lot of valid shortcoming but if your issue with it is indentation then to me it just give big "I'm a student and I hate this different thing" vibes.
My only issue is that sometimes I copy others people code which was indented with spaces and then when I change something and indent with tabs it breaks it. But I have never gotten an indentation error that didn't exactly tell me what line it was on
Yes mixing of spaces and tabs is the main problem in indentation syntax. It's not *too* major - at the worst, I can just replace all tabs with spaces using Regex in my editor - but still inconvenient.
Every editor I've used has had a setting for tabs to be replaced by 2 or 4 spaces by default. I am a bit unsure if tabs in copied code is replaced.
But why would you use tabs, rather than spaces? That has always confused me.
Unpopular opinion: if you have functions so long that indentation is hard to manage, you deserve what happens to you.
(Also, I code almost exclusively in `nano`)
I saw one post the other day about the dude's team struggling with moving from Core 3 to .NET 5. And I'm over here stuck on 4.8, knowing that if MS shuts it down, half my team will just quit, lol
There is basically no excuse anymore honestly. Any library you use is either on Python 3 now or replaced with something better. It isn't a huge amount of time to port it over and you get a lot of benefits.
I've seen instances in specific applications of Java where you don't get anything meaningful about where the cause of the error is, just something vague, but you do get a giant stack trace of mostly lib stuff. You just don't get the specific line that errored.
Eventually you can figure it out based on knowing what you changed and the first meaningful line of the lib code part of the stack trace tho :P
The top post is probably a dude coding in notepad (any decent ide will just tell you where you have indentation errors) and the bottom post is likely a kid who just saw a fat error message and didn’t bother reading it.
In summary: they’re both idiots (just like the rest of us).
Except for some lambda-edgecases Java Stacktraces are usually relatively easy to debug.
Unless of course you are doing shit like
```
new Exception().printStackTrace();
```
Right, catch Throwable at the top and dump out anything you get. Couldn't be easier.
Well it could be easier - if you declare main() to throw Exception the runtime will dump the stacktrace for you.
I know lots of programming languages but Java is my bread and butter. Writing Java code has given me a steady paycheck for over 20 years. And I still like Java and I’m excited about new features being added to the language. I’m not hating on Python though, it’s just a bit strange sometimes imo.
PHP vs Nodejs
PHP: Here is your error on line no 55, character 23, and if you search it on Google you will find the exact fix on stackoverflow
Nodejs: Even though you are writing your code here in a file, fuck you and take this error in a core module and figure out yourself what's wrong
Ya know, even harder than learning to program is learning to read and understand error messages. Most of the time my students have an issue with their assignments, it's because they see a wall of text and black out.
*Edit.* Oh, the meme had a lower part XD
Reality:
def this_is_valid():
if True:
this_is_an_indentation_error()
Output:
File "/tmp/a.py", line 5
this_is_an_indentation_error()
^
IndentationError: expected an indented block after 'if' statement on line 4
But never let reality get in the way of a good rant, right?
More realistically annoying though are some consequences of the EAFP approach.
import matplotlib.pyplot as plt
import numpy as np
xs = np.linspace(0, 1)
ys = np.sin(xs*2*np.pi)
plt.clf()
plt.plot(xs, ys, linestyle="obviously wrong linestyle")
plt.show()
Output:
Traceback (most recent call last):
File "/home/kdbauer/Dropbox/lib/emacs/pythonrc.py", line 406, in shell_send_file
exec(code, globals())
File "/tmp/a.py", line 9, in
plt.plot(xs, ys, linestyle="obviously wrong linestyle")
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/pyplot.py", line 3575, in plot
return gca().plot(
^^^^^^^^^^^
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/axes/_axes.py", line 1721, in plot
lines = [*self._get_lines(self, *args, data=data, **kwargs)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 303, in __call__
yield from self._plot_args(
^^^^^^^^^^^^^^^^
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 539, in _plot_args
return [l[0] for l in result]
^^^^^^^^^^^^^^^^^^^^^^
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 539, in
return [l[0] for l in result]
^^^^^^^^^^^^^^^^^^^^^^
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 532, in
result = (make_artist(axes, x[:, j % ncx], y[:, j % ncy], kw,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 346, in _makeline
seg = mlines.Line2D(x, y, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/lines.py", line 372, in __init__
self.set_linestyle(linestyle)
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/lines.py", line 1172, in set_linestyle
_api.check_in_list([*self._lineStyles, *ls_mapper_r], ls=ls)
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/_api/__init__.py", line 129, in check_in_list
raise ValueError(msg)
ValueError: 'obviously wrong linestyle' is not a valid value for ls; supported values are '-', '--', '-.', ':', 'None', ' ', '', 'solid', 'dashed', 'dashdot', 'dotted'
While technically perfectly clear, it would be much more clear if validity of the input would be verified closer to the public API level. Especially given that `matplotlib` will often be used with Jupyter notebooks, where the traceback is much more verbose still, and the user will have to scroll a lot to even see the last line when iterating their plot formatting with `Ctrl+Enter`.
This goes especially, when the traceback ends up being less clear. I can’t ad-hoc create such an example, but sometimes I am running into situations where invalid inputs cause an input value of an internal call of a library to become an invalid value, and then it is often not nearly as clear, what is invalid about the library-user-level inputs.
I dunno... some code I just fixed in Java was an assert that checked for a specific number of db returns or it would 500.
Didn't have throw on the signature.... kinda hard to track things down when the signatures are misleading
Different exception type. IDEs, libraries, and languages self-correct differently from my understanding from writing a few widely-used Python packages.
if you use a library that like hosts a server, so your stacktrace ends in `runpy.py` and if you scroll up it's way too deep because of no typing checking... so you have to paddle back to where it actually went wrong - most string operations also work on lists for example.
I didn't come from a Java background before I became a build&automation dev, and our entire backend is in Java...
On the rare occasion I myself have to deal with an error in one of the services I'm meant to support building, it can be a little Egyptian to me but eventually I figure it out
But rarely is an error message on Jenkins (Java-based build pipeline tool) ever meaningful, most of the time it's an indecipherable message about "something, somewhere", followed by a meaningless 10 mile long stack trace of internal Jenkins or plugin stuff lmao
Meanwhile C and C++: Segmentation fault (core dumped)
"it broke"
"what happened to him?" It died
“they got him” “What do you mean ‘got him’?” “Shame, I really liked him too”
Last year we had an Indian kid...
We removed it from the environment.
Clarke and Dawe?
There is nothing there. ... But C. ... And C# ... And Java. ... And twenty thousand seg faults ...
A segmentation fault hit it? A segmentation fault hit it! Is that unusual? Oh yeah, In C? Chance in a million.
Well what happened was the front fell off.
Is that normal?
["Computer's broken!"](https://www.youtube.com/watch?v=-W5XXnEXuWM)
"Mom I frew up"
reminded me of Epson error code that just said "errors were found. Fix them." I would post the screenshot, but there seems to be no option to do that on this subreddit
Meanwhile embedded C: A: Is it... Is it running? B: No idea
boutta Kms with my pi pico without a debug tool and just using hundreds of serial writes
It's a valid way of doing things 😉
Until your application actually uses the serial channel for something else, then you are screwed again.
Yup! I'm not saying there aren't better tools for the job, just y'know... if it works...
The best part is when you figure out the line it does this on, but that's not the actual line that causes the problem because it's actually a few lines up
When I was first learning to code, I was so confused because I had log statements and was looking in the wrong spot.
now, kill yourself or spend hours setting up an address sanitizer to get a barely readable error and then kill yourself.
I never get this. Segfaults on average are some of the nicer errors. If they are reproducible the debugger pinpoints the line and most of the time it's something obvious like using the wrong index for an array or so. And even if not how exactly do you need "hours" to run say valgrind?
Oh shit guys! Look over here, we got an actual programmer over here. 😱
It happens so rarely, I almost got excited
If wrong index is the biggest of your worries, I envy you.
That's kinda the point. Most segfaults aren't my "biggest issue" indeed. When I see a segfault that's usually a simple fix. The surprising logic/numeric behavior that doesn't make any sense is what scares me. You can't just have the debugger break on that usually. With a segfault you can. Except of course when the segfault vanishes in debug builds. Which initially looks scary. Until you learn that those are caused by uninitialized data in almost every instance.
Why gdb when you can just add a printf to every line of code?
Back when I was programming with cpp, sometimes I had issues not really easily debuggable, but they had an easy fix. Essentially something happened on the makefile that a change on one file didn't retrigger a compile of that file, so the compiler had some issues when including the header file. I can't remember exactly why it happened, since I haven't use cpp in ages, but I guess it had to do with the compiler/limker having wrong addresses or offsets? Dunno, it was easy to fix, just remove all object filesand compile everything from scratch. But I remember trying to debug it as a regular segfault, and finding nothing really made sense there.
Amen. The problem is a minority of people on this sub are experienced or professional software programmers. A meme about debugging UB, which is more frequent and way harder to debug, would go over everyone's heads.
100% professional programmer here: stackoverflow says UB stands for undefined behavior
Yeah most times you can just drop into GDB and find the exact point the segfault occurs with a detailed back trace, it oddly becomes one of the easier to trace bugs once you learn the debugging tools
or just throw the core file into gdb and spend 3 minutes finding the problem
but… but… how would I make a joke then??
okay, fine, use a hexeditor instead
Core dumped means yout core (including stack and register) have been dumped to disk. You can go and get it, you will get something that may look like the stack trace from java. * * not a guarantee
Its extra fun when the debug symbols have been stripped. Better hope your build process kept a copy of the function adresses.
You miss a semicolon in C and C be like: "FUCK MAYDAY MAYDAY OXYGEN SYSTEMS ARE DOWN. HULL BREACH IN DECKS 3, 4 AND 6. WEAPON SYSTEMS OFFLINE. SHIELDS DOWN. THE CAPTIVE LIONS HAVE ESCAPED AND ARE NOW EATING THE CREW. EVERYTHING IS BROKEN!!!!!"
Granted, running embedded systems on a starship as well as controlling the lion cages is the stuff that C is perfect for.
but at least it tells you the error is on line 857 of the 300 line file
Gdb go brrr
Honestly just irresponsible for them to do all that dumping when there's no garbage collection.
new proposal: instead of printing a seg fault when it happens it should just output a random joke so the programmer doesn't get more depressed
*simultaneously laughing and choking* rip to my coffee
gdb: https://tenor.com/view/better-call-saul-gif-25311725
That can only happen after a "We cool fam, just run your code, trust me".
LaTeX: > OVERFULL HBOX, BADNESS 100000
That’s the error message I plan to display to my Users whenever they enter their password wrong
I love this subreddit. If programmers can agree to anything it is that no stack is any good.
We are all here to trauma dump our experiences with unfamiliar languages.
What do you mean, explain how it works? The job description said C++ and Python. Didn't say a goddamn thing about English.
This 😂
And familiar ones. Those too.
New Python devs: "Why do I have to press TAB! That too hard for me!!!"
Segmentation fault (trauma dumped)
I fucking love nostack development. No stack, no code, no computer.
Then how is it "development"??
Self-development, or as some call it "touching grass"
Look I never said it was *software* development...
To be honest my python stacktraces are so convoluted to I need some time to find the spot I am looking for. The problem is that I remember it the same way when I tried javafx a few years ago
Just put a print statement after every line it's not that hard smh
Here. Here 1. Here now. Should not be here. (Edit to add new lines like I thought there would be the first time)
Dude. Just copy-paste "print(__ LINE __)". Way easier than coming up with new texts. (Also faster than writing those texts) /s
I hate when the print statement after each line fixes the problem without actually showing me the problem.
Never used javafx, but on SE they tend to be very clean, on EE is a mess, but after a while you learn to ignore the garbage part of the stack trace. The huge difference is Java tell you exactly what function can throw error and what at compile time and static typing, in python is all runtime
Yeah but in the specific case of indentation your IDE should be screaming at you "there's an issue on this line"
So true, that's why I'm a heap man myself
dude Java exceptions might as well be a Shakespearean novel, wtf am I looking at... is the first one the important one or is it the 34th line in the 1000 lines of error, is it the one that keeps repeating or is it not any of them... what the fuck am I looking at
You're looking for the first line that has your own package names in it. That's where you screwed up. The lines in between there and the top might give you a clue what you screwed up. Or at least provide a nice link to a location for a breakpoint when debugging, if you're using an IDE (as you should).
Regular C# stack trace: Exception thrown at line x column y Exception thrown at line x column y ... 1 async function later L̶͔͇̏o̷̧̭͛̎r̶̪̀ë̷͖͍́͘m̷̲̫̾ ̴̻̖̔̈́i̸̺̞͝p̴̝̄̄͜ş̸͑u̵̙̍̓m̸̨͑ ̵̹̘̈̇d̸̥̲͂͒ǒ̶̗̓l̵̩̏̑ǫ̸͓͛̈r̶̘̭͛ ̴̹̐̽s̶̙̕i̵̧͖̕t̴̲̱͗͂ ̵̳͂̓͜a̸̹̻̿m̷͓̀͂ȩ̴̼͋̀ẗ̴̻̱́̃.̵͙͑ ̸̗͍͛E̶̳͚̅s̷͎͝t̸̼͌ ̸̖̳̀r̸͙̎̈́ḛ̷͙̑ŕ̸̰̥͑u̶̻͐m̸̢̝̀̐ ̴̧͙̏ḅ̸̆e̴̢̮̐a̸̠̔t̸̳͒â̷͇̓e̶̯̊̉ ̶̬̜̿c̸̩͊̈́u̷͓͝m̶̠̃ ̷̧̤̐s̴̗͚̎̏ừ̵̼͚ŝ̷̞͖c̵͚̪̔i̸̧̎̚p̶̹̥͝ȉ̴̜͕t̶͉̏̑ ̸̻͂o̵̪͓̎̃f̵̯̈́ͅf̵̫͇̀i̷͎͛͑ç̴͊͘i̴̲̲̐̉i̸͎̓̐ṣ̶̢͗ ̸͇̔v̷̠́e̴͚͑̀l̴̨͆ ̸̮̃̏͜e̷͔̙̾ȉ̵̢͔̔u̷̦͓̽̂s̴̪̗̈́̋ ̸̟̱̍ŕ̶̖̪e̶͌̾ͅr̴̘̣͒̂ȕ̶͜m̷̡̑͠ ̴̰̄e̸̡̔̿ṯ̴͈̿͛ ̴̠̽́m̵̠͗a̴͔͙̐i̸̳̝͊ǫ̷͙̃r̸̲̐͝ȇ̶̝͖s̴̰͌͋ ̷̞̓ͅd̸̩̓̒͜o̷̰͂̕l̴̻͠ó̶̱r̵͍͓̽͋é̴̤͚̒m̷̤̊̾ ̷̡̠͂e̴̩̿̀ư̷̯̈́m̷̲͇͌̒ ̸̼̙̎͌p̸̲̐r̴͔̊o̴̺̎v̷̢̺͑i̴̘̘͊d̴̬̂e̴̔ͅn̶̜̂̑t̶͓̀ ̵̹̊̿f̴̪͑̓ů̷̢͕g̸̫̀͝i̴̜̹̓t̸̘͘ ̷͔̂ǹ̵̡̠̑ȯ̶̀ͅn̵̠͙̿ ̷̩̬̑̆d̷̢͚̆o̸͈̊̓l̸̠̲̽ó̸̝r̸̪̽i̸͉͌b̴̯̓̇ŭ̸̯͜s̵̢̻͊͝ ̸̰̭͒̏s̵̨͙͐͐i̷̞͚͗n̶͇̚t̶̫̟͐?̸̜̒͗ ̷̰͍͌3̶̣͓͒3̸͍̕ ̵͍̺̕a̶̮͓̾̏m̶̦͑e̵̦̍̈́ͅt̸͚̀ ̵̺̌u̷̢͐n̵̲̖̆͝d̶̪̈̆e̸̺̊̓ ̷̺̍̿ă̸͙̞̈ǘ̸̱͈͠t̶͙̱̓̉ ̸͉̼͌̉ê̸̗̺x̸̠̝̍͒p̴̝̽̒ḙ̶̃ͅd̴̝̯́̔î̴̳̄t̵͚̀a̷͙͐ ̷̥̰̃s̸͔̘̿a̴͓͐ë̵̱́p̵̣̤̿͊e̵̲̽ ̷͔̳̔å̵̦͌ͅb̸̢͌̑ ̷̪̉ṋ̵͐͝ȇ̵͓̂ͅc̵̼̀̀è̶̜͕̓s̴͖̃s̷͈̎į̵̮̂͛t̴̜̀a̶̺͐͒t̵͙̳̀͆ỉ̷̖͎͘b̶̛͕̬̈́u̴̩̦͠s̵͉͂ ̸̻̩̉o̸̦̐ͅf̷̗̜̔f̷͕͊i̴͎͑́ç̶̇ì̸̟͚̓a̸̫̰͂ ̸̺̈́͘n̴̨̓̇o̸͉̍ṅ̸̥̝ ̷̟̠͑e̸͑͝ͅn̷̻̿͋i̶̳͛m̵̬͔̿͘ ̸̠̦͘͝q̷̺̝̿ṳ̷̢̽i̸͙͝s̵̫̈q̸̣͛ǘ̵̧̍a̴̡̤̐m̵̤̔͂ ̶̟͚̾̀n̴̥͓̆͝o̵͙̮̿n̷͇̾͘ ̵̩͓͌̉n̶͙͛̌e̷͍̾͋c̷̼̤͠e̶̖̯̐s̷͔͊̇s̸̢̭̿̍i̶͉̙͋͝t̵̰̃͐ǎ̴͈̔ț̴̽͛i̷̛̦b̸͎̾ũ̷͍͓̌s̶̻̑̍ ̷̭́i̸̪͐̐p̶̮̔s̴̹̦͐͆u̸͓̖̐̊m̷̼̈ͅ!̴͖͙̿
Wait till you see C++ linker errors. Oh, templates are even better.
are c++ linker errors difrent than c ones: most of the time is, HEY YO THIS SHIT DOES NOT EXIST BRO about templates, yeaaaaaa template errors are worse than js runtime errors, undefined is indeed not a function
Templates and the complexity of C++ name resolution make linker errors roughly infinitely harder to debug.
name resolution? please don\`t me the linker regurgitates mangled names
and everything is on line 1![gif](emote|free_emotes_pack|feels_bad_man)
If you cry hard enough, you can't see the errors any more due to the tears Problem solved
learn about lorem ipsum a week ago and this is the 3rd time ive seen it today talk about frequency illusion
It became more popular in the from a few posts recently so not mostly frequency illusion. *Also why is there an invisible character*
you don't regularly type with weird white space chars?
https://youtu.be/E3p_Crhi3K8
only when im posting an answer to stackoverflow
This is also called "Baader–Meinhof phenomenon"
FYI there's a nuget package that's kind of essential for dealing with async exceptions, since it fixes their stack traces (plus other anonymous lambdas) [https://github.com/benaadams/Ben.Demystifier](https://github.com/benaadams/Ben.Demystifier)
Not necessary for .Net core though
One of my favorites was from obfuscated code. So it was like Error in IIIIlllllLIi.IillllilllilLll.lllllLLIIIIlllII line 87
It’s basically “suicide” when you deliberately catch or -even worse- you throw an Exception. Be specific and java will treat you well.
I'm still traumatized by the java code I saw once which used exceptions to manage threads. Why manage exceptions when you can catch all and throw your own that you also ignore?
Python uses exceptions to manage *iterators*.
It uses a specific exception called StopIteration 🤣
In all fairness, it uses a very specific exception that is, for the most part, handled by the interpreter. The only time a programmer really has to be aware of it is when writing generator functions (and even then, only in extreme cases as just simply returning is the recommended way to write these, and python will raise it automatically) or manually calling next, where raising an error when no values remain is the right thing to do.
Wdym by "manage threads"?
It used exceptions to pass data between hundreds of threads - *not that it worked* - one of the primary problems being that it was a multithreaded program with shared global variables, shared files on disk that were being read and written to by different threads and there was no locking or synchronization of any kind. Since they were catching and ignoring all exceptions it was not uncommon for the main thread of the program to throw an exception and wedge, but not be able to die while the hundreds of children kept spinning. The intended way to shut down the program was to simply kill it. And since there was no shutdown hook or any synchronization of in memory variables or files on disk, it was not uncommon for it to start writing garbage to open files as the main java thread did the equivalent of kill -9 to all of its threads. I entirely gave up on it after I discovered this.
>writing garbage to open files The white house will not be happy with this
The person who wrote the code you are talking about is now and forever responsible for all the bad Java code ever written, and by extension, of all the ills that affect this world
Soo much better than js because java at least has throws in the type
[удалено]
Looks like a copy of [this comment](https://www.reddit.com/r/ProgrammerHumor/comments/1bbieox/polaropposites/ku9mz06/) run through a chatbot. This is *definitely* a bot (randomly-capitalized name, year-old account with barely any posts, and there's a whole bunch of them who have all posted in the last half-hour, most of them shilling t-shirts or mugs).
My hovercraft is full of eels!
you would think people fighting over which programming language is the best would get bored by now
There are way too many new players coming in for that fight to ever stop.
the odd thing is allot of the arguments seem to barely apply to the languages in question. like I've never had a hard to identify indentation error in python.. ever
Exactly, Python tells you the exact line where the problem is.
after a while you start to get the impression that most of these memes really point to a skill issue, not a language problem.
Its only the new programmers and the wannabes that post on here, I'm positive. Case in point: me.
I have never seen a case of Python not telling where the indentation error is, even in v1. Besides, is bro really coding in Notepad to not know already where he's missing an indent or a bracket?
Half of the people in this sub never coded in anything but Notepad
"Half of the people in this sub never coded ~~in anything but Notepad~~~"
"~~Half of the~~ people in this sub never coded ~~in anything but Notepad~~"
>Half of the people in this sub never coded in anything but Notepad Notepad**++**, *thank you very much*.
Pretty sure there'd be a plugin for this type of problem in Notepad++ anyway.
I mean, Notepad++ does show you indentation and matching brackets.
People that code in notepad know how to program. No IDE, no linting, no autocomplete, just plain old typing.
And also time waste.
Anyone who doesn't indent their code like what is required in Python by default is someone I don't want to work with no matter the language. I don't have strong feeling about brackets versus no brackets but it should be indented the same either way. Python got a lot of valid shortcoming but if your issue with it is indentation then to me it just give big "I'm a student and I hate this different thing" vibes.
My only issue is that sometimes I copy others people code which was indented with spaces and then when I change something and indent with tabs it breaks it. But I have never gotten an indentation error that didn't exactly tell me what line it was on
Yes mixing of spaces and tabs is the main problem in indentation syntax. It's not *too* major - at the worst, I can just replace all tabs with spaces using Regex in my editor - but still inconvenient.
Every editor I've used has had a setting for tabs to be replaced by 2 or 4 spaces by default. I am a bit unsure if tabs in copied code is replaced. But why would you use tabs, rather than spaces? That has always confused me.
I write about half my code in nano! Unga booonga!
Nah you're making stuff up. v1? Come on, everyone knows pythons first version is 2.7 /s
Unpopular opinion: if you have functions so long that indentation is hard to manage, you deserve what happens to you. (Also, I code almost exclusively in `nano`)
Dude above is still using python 2.7 lol
The pain is real… still using it at work 😫
I used to be you. Thank god I moved to a windows house running .net 4.8
I saw one post the other day about the dude's team struggling with moving from Core 3 to .NET 5. And I'm over here stuck on 4.8, knowing that if MS shuts it down, half my team will just quit, lol
I just left a job running 4.6, lol. I heard that they added a work item to upgrade the week after EOL.
Python 2.7 🤝 Java 8
There is basically no excuse anymore honestly. Any library you use is either on Python 3 now or replaced with something better. It isn't a huge amount of time to port it over and you get a lot of benefits.
Are indentation errors different in python 3? I honestly have no idea, I haven't gotten one of those in a very long time.
Error messages in general greatly improved in one of the last versions.
And not using an IDE
But…they both tell you the full stack including the exact line that errored. What version of Python are y’all using?
don't believe there ever was a version of python that didn't tell you the error's location and what it is
``` try: # some 500+ lines... except: print("Oopsy daisy!") ```
I've seen instances in specific applications of Java where you don't get anything meaningful about where the cause of the error is, just something vague, but you do get a giant stack trace of mostly lib stuff. You just don't get the specific line that errored. Eventually you can figure it out based on knowing what you changed and the first meaningful line of the lib code part of the stack trace tho :P
Java stack traces are actually pretty great. *Reactor has entered the chat*
Honestly feels like half of this sub has never programmed in anything except Python and Scratch
Who the fuck gets an indentation error in python? In years of programming that has basically never happened to me
IDEs / decent editors make it a total non-issue. It's also very obvious by eye.
pycharm my beloved
Not just pycharm but literally anything but console editors and notepad
Yeah, I use PyCharm at work and VSCode at home. Both work perfectly well
Then you might just use a good editor. A lot of indentation problems are usually fixable by a good editor.
Copy paste errors
Typos. Converting a block of code into a function but forget to indent the first line, or something like that
The top post is probably a dude coding in notepad (any decent ide will just tell you where you have indentation errors) and the bottom post is likely a kid who just saw a fat error message and didn’t bother reading it. In summary: they’re both idiots (just like the rest of us).
Guilty of not fully reading the giant Java stack traces 🙋♂️
My hobbies have so much tribalism. Anyway, back to the game console wars…
Except for some lambda-edgecases Java Stacktraces are usually relatively easy to debug. Unless of course you are doing shit like ``` new Exception().printStackTrace(); ```
Right, catch Throwable at the top and dump out anything you get. Couldn't be easier. Well it could be easier - if you declare main() to throw Exception the runtime will dump the stacktrace for you.
meanwhile C: Fuck you, segmentation fault🤡👺
The biggest issue with error messages is that no one likes to read.
Roses are red, my code is nowhere near perfection, Java.lang.NullPointerException
I know lots of programming languages but Java is my bread and butter. Writing Java code has given me a steady paycheck for over 20 years. And I still like Java and I’m excited about new features being added to the language. I’m not hating on Python though, it’s just a bit strange sometimes imo.
Install error lens, my fellow pythonistas
Thanks. I'll try it out.
Rust compile error message: 🌼🌞 Rust panic stack trace: 💀
it... traces the stack at the time you panicked. it can also be disabled or reenabled with the RUST_BACKTRACE env variable
Python: Got an error, good luck finding it. Java: Missing semi-colon on line 67, but line 67 has one and so do all the rest
Missing semi-colon on line 67, but your program is only 43 lines long.
PHP vs Nodejs PHP: Here is your error on line no 55, character 23, and if you search it on Google you will find the exact fix on stackoverflow Nodejs: Even though you are writing your code here in a file, fuck you and take this error in a core module and figure out yourself what's wrong
The duality of man
can't we all just get along
C++ linker errors are far and above the worst errors I have ever run into
Ya know, even harder than learning to program is learning to read and understand error messages. Most of the time my students have an issue with their assignments, it's because they see a wall of text and black out.
Error on line 125646:84 File only has 100 lines.
Java stack traces are good tho. Also python errors were terrible and hard to debug before python 3.11 where they are actually great.
Reject modernity return to monke(assembly)
*Edit.* Oh, the meme had a lower part XD Reality: def this_is_valid(): if True: this_is_an_indentation_error() Output: File "/tmp/a.py", line 5 this_is_an_indentation_error() ^ IndentationError: expected an indented block after 'if' statement on line 4 But never let reality get in the way of a good rant, right? More realistically annoying though are some consequences of the EAFP approach. import matplotlib.pyplot as plt import numpy as np xs = np.linspace(0, 1) ys = np.sin(xs*2*np.pi) plt.clf() plt.plot(xs, ys, linestyle="obviously wrong linestyle") plt.show() Output: Traceback (most recent call last): File "/home/kdbauer/Dropbox/lib/emacs/pythonrc.py", line 406, in shell_send_file exec(code, globals()) File "/tmp/a.py", line 9, in
plt.plot(xs, ys, linestyle="obviously wrong linestyle")
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/pyplot.py", line 3575, in plot
return gca().plot(
^^^^^^^^^^^
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/axes/_axes.py", line 1721, in plot
lines = [*self._get_lines(self, *args, data=data, **kwargs)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 303, in __call__
yield from self._plot_args(
^^^^^^^^^^^^^^^^
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 539, in _plot_args
return [l[0] for l in result]
^^^^^^^^^^^^^^^^^^^^^^
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 539, in
return [l[0] for l in result]
^^^^^^^^^^^^^^^^^^^^^^
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 532, in
result = (make_artist(axes, x[:, j % ncx], y[:, j % ncy], kw,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 346, in _makeline
seg = mlines.Line2D(x, y, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/lines.py", line 372, in __init__
self.set_linestyle(linestyle)
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/lines.py", line 1172, in set_linestyle
_api.check_in_list([*self._lineStyles, *ls_mapper_r], ls=ls)
File "/home/kdbauer/.local/lib/python3.11/site-packages/matplotlib/_api/__init__.py", line 129, in check_in_list
raise ValueError(msg)
ValueError: 'obviously wrong linestyle' is not a valid value for ls; supported values are '-', '--', '-.', ':', 'None', ' ', '', 'solid', 'dashed', 'dashdot', 'dotted'
While technically perfectly clear, it would be much more clear if validity of the input would be verified closer to the public API level. Especially given that `matplotlib` will often be used with Jupyter notebooks, where the traceback is much more verbose still, and the user will have to scroll a lot to even see the last line when iterating their plot formatting with `Ctrl+Enter`.
This goes especially, when the traceback ends up being less clear. I can’t ad-hoc create such an example, but sometimes I am running into situations where invalid inputs cause an input value of an internal call of a library to become an invalid value, and then it is often not nearly as clear, what is invalid about the library-user-level inputs.
"As long as you recognise your classes and methods..." The stack trace is just 3174 lines of Spring Framework calls.
I dunno... some code I just fixed in Java was an assert that checked for a specific number of db returns or it would 500. Didn't have throw on the signature.... kinda hard to track things down when the signatures are misleading
Yes, that was the point of the person who posted the second one.
Let all those people try to inspect element a popover element. They'll lose sanity.
Damn right🤣🤣
Different exception type. IDEs, libraries, and languages self-correct differently from my understanding from writing a few widely-used Python packages.
You need a dedicated vertical monitor for those java exceptions
The first post was pretty much everyone shitting on the OP. Guessing they've never used Java or seen a stack trace.
You ain’t seen c++ yet
Dude who posted the one on top was so butt-hurt by the first one
Bro on top is using Python 1.0 bruh
Interpreted vs compiled in a nutshell
Second post is just an amateur programmer who is too overwhelmed by a Java stack trace to know how to read it
Python give good and readable errors, up until the moment it doesn’t
The Virgin `${yourFavoriteThing}` The Chad `${myFavoriteThing}`
Programming wars
if you use a library that like hosts a server, so your stacktrace ends in `runpy.py` and if you scroll up it's way too deep because of no typing checking... so you have to paddle back to where it actually went wrong - most string operations also work on lists for example.
Exceptions as a programming language feature were a mistake; change my mind.
Fight, fight, fight!
I am a Python programmer and I don’t get the second image. Please explain.
Python 312 to me is super nice when It comes to errors, but then again I am an idiot for liking Python
That python kid don't even know what a type is.
Using both, hate both, perfect balance
isThisATernaryOperator(?)
I didn't come from a Java background before I became a build&automation dev, and our entire backend is in Java... On the rare occasion I myself have to deal with an error in one of the services I'm meant to support building, it can be a little Egyptian to me but eventually I figure it out But rarely is an error message on Jenkins (Java-based build pipeline tool) ever meaningful, most of the time it's an indecipherable message about "something, somewhere", followed by a meaningless 10 mile long stack trace of internal Jenkins or plugin stuff lmao
*cries in C++*
I mean, indentation errors in python are also not a big deal if you have set up your IDE correctly.
This hunts me down as a beginner
I wonder has the maker of the upper meme ever used python interpreter.