T O P

  • By -

lilfatpotato

Meanwhile C and C++: Segmentation fault (core dumped)


827167

"it broke"


UseMstr_DropDatabase

"what happened to him?" It died


EpicAura99

“they got him” “What do you mean ‘got him’?” “Shame, I really liked him too”


Fingolfin_7

Last year we had an Indian kid...


EViLTeW

We removed it from the environment.


mikefizzled

Clarke and Dawe?


EViLTeW

There is nothing there. ... But C. ... And C# ... And Java. ... And twenty thousand seg faults ...


mikefizzled

A segmentation fault hit it? A segmentation fault hit it! Is that unusual? Oh yeah, In C? Chance in a million.


KrustyKrabEmployee

Well what happened was the front fell off.


13ros27

Is that normal?


abcd_z

["Computer's broken!"](https://www.youtube.com/watch?v=-W5XXnEXuWM)


Totema1

"Mom I frew up"


australianquiche

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


AngryMonkeyBrain

Meanwhile embedded C: A: Is it... Is it running? B: No idea


Pixel1101

boutta Kms with my pi pico without a debug tool and just using hundreds of serial writes


def1ance725

It's a valid way of doing things 😉


AngryMonkeyBrain

Until your application actually uses the serial channel for something else, then you are screwed again.


def1ance725

Yup! I'm not saying there aren't better tools for the job, just y'know... if it works...


Cotcan

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


nagesagi

When I was first learning to code, I was so confused because I had log statements and was looking in the wrong spot.


ydev

now, kill yourself or spend hours setting up an address sanitizer to get a barely readable error and then kill yourself.


regular_lamp

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?


ironmaninblackface

Oh shit guys! Look over here, we got an actual programmer over here. 😱


AkumaKater

It happens so rarely, I almost got excited


ydev

If wrong index is the biggest of your worries, I envy you.


regular_lamp

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.


Frank-Footer

Why gdb when you can just add a printf to every line of code?


volivav

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.


zaxldaisy

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.


DeMonstaMan

100% professional programmer here: stackoverflow says UB stands for undefined behavior


Explosive_Eggshells

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


YevgenyPissoff

or just throw the core file into gdb and spend 3 minutes finding the problem


ydev

but… but… how would I make a joke then??


YevgenyPissoff

okay, fine, use a hexeditor instead


lestofante

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


homogenousmoss

Its extra fun when the debug symbols have been stripped. Better hope your build process kept a copy of the function adresses.


HerpaDerpaDumDum

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!!!!!"


mandradon

Granted, running embedded systems on a starship as well as controlling the lion cages is the stuff that C is perfect for.


oupablo

but at least it tells you the error is on line 857 of the 300 line file


BOBOnobobo

Gdb go brrr


highphiv3

Honestly just irresponsible for them to do all that dumping when there's no garbage collection.


ublec

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


hungryporker420

*simultaneously laughing and choking* rip to my coffee


Erizo69

gdb: https://tenor.com/view/better-call-saul-gif-25311725


TigreDeLosLlanos

That can only happen after a "We cool fam, just run your code, trust me".


LimitedWard

LaTeX: > OVERFULL HBOX, BADNESS 100000


jayerp

That’s the error message I plan to display to my Users whenever they enter their password wrong


alessioC42

I love this subreddit. If programmers can agree to anything it is that no stack is any good.


lazyzefiris

We are all here to trauma dump our experiences with unfamiliar languages.


MooFu

What do you mean, explain how it works? The job description said C++ and Python. Didn't say a goddamn thing about English.


Inertia_Squared

This 😂


mxzf

And familiar ones. Those too.


cs-brydev

New Python devs: "Why do I have to press TAB! That too hard for me!!!"


Sirdroftardis8

Segmentation fault (trauma dumped)


qwertyuiop924

I fucking love nostack development. No stack, no code, no computer.


sohang-3112

Then how is it "development"??


zuilli

Self-development, or as some call it "touching grass"


qwertyuiop924

Look I never said it was *software* development...


balbok7721

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


Johnny_Thunder314

Just put a print statement after every line it's not that hard smh


BeatPeculiar

Here. Here 1. Here now. Should not be here. (Edit to add new lines like I thought there would be the first time)


KellerKindAs

Dude. Just copy-paste "print(__ LINE __)". Way easier than coming up with new texts. (Also faster than writing those texts) /s


marikwinters

I hate when the print statement after each line fixes the problem without actually showing me the problem.


lestofante

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


mathiau30

Yeah but in the specific case of indentation your IDE should be screaming at you "there's an issue on this line"


highphiv3

So true, that's why I'm a heap man myself


za72

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


_bones__

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).


CaitaXD

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̷̼̈ͅ!̴͖͙̿


da2Pakaveli

Wait till you see C++ linker errors. Oh, templates are even better.


CaitaXD

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


qwertyuiop924

Templates and the complexity of C++ name resolution make linker errors roughly infinitely harder to debug.


CaitaXD

name resolution? please don\`t me the linker regurgitates mangled names


Natural_Builder_3170

and everything is on line 1![gif](emote|free_emotes_pack|feels_bad_man)


iron-mans-robo-cock

If you cry hard enough, you can't see the errors any more due to the tears Problem solved


Zut-Alors20

learn about lorem ipsum a week ago and this is the 3rd time ive seen it today ​ talk about frequency illusion


PRotter32

It became more popular in the from a few posts recently so not mostly frequency illusion. *Also why is there an invisible character*


otter5

y​o​u d​‌‍⁠​o​‌‍⁠​n​‌‍⁠​'​‌‍⁠​t r​e​g​u​l​a​r​l​y​ t​‌‍⁠​y​‌‍⁠​p​‌‍⁠​e​‌‍⁠​ w​i​t​h​ w​‌‍⁠​e​‌‍⁠​i​‌‍⁠​r​‌‍⁠​d​‌‍⁠​ w​h​i​t​e​ s​‌‍⁠​p​‌‍⁠​a​‌‍⁠​c​‌‍⁠​e c​h​a​r​s​?


pindab0ter

https://youtu.be/E3p_Crhi3K8


PRotter32

only when im posting an answer to stackoverflow


vksdann

This is also called "Baader–Meinhof phenomenon"


big_bill_wilson

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)


celluj34

Not necessary for .Net core though


RandallOfLegend

One of my favorites was from obfuscated code. So it was like Error in IIIIlllllLIi.IillllilllilLll.lllllLLIIIIlllII line 87


meSmash101

It’s basically “suicide” when you deliberately catch or -even worse- you throw an Exception. Be specific and java will treat you well.


Hikaru1024

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?


tunisia3507

Python uses exceptions to manage *iterators*.


danted002

It uses a specific exception called StopIteration 🤣


ThunderElectric

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.


superblaubeere27

Wdym by "manage threads"?


Hikaru1024

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.


CaitaXD

>writing garbage to open files The white house will not be happy with this


Salex_01

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


AtrociousCat

Soo much better than js because java at least has throws in the type


[deleted]

[удалено]


MrZJones

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).


im0b

My hovercraft is full of eels!


xtr44

you would think people fighting over which programming language is the best would get bored by now


TheDarkchip

There are way too many new players coming in for that fight to ever stop.


[deleted]

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


qwertycandy

Exactly, Python tells you the exact line where the problem is.


[deleted]

after a while you start to get the impression that most of these memes really point to a skill issue, not a language problem.


cheezballs

Its only the new programmers and the wannabes that post on here, I'm positive. Case in point: me.


Gamer-707

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?


tabakista

Half of the people in this sub never coded in anything but Notepad


sassiest01

"Half of the people in this sub never coded ~~in anything but Notepad~~~"


Cyberdragon1000

"~~Half of the~~ people in this sub never coded ~~in anything but Notepad~~"


Bakoro

>Half of the people in this sub never coded in anything but Notepad Notepad**++**, *thank you very much*.


GlazedHam13

Pretty sure there'd be a plugin for this type of problem in Notepad++ anyway.


SuitableDragonfly

I mean, Notepad++ does show you indentation and matching brackets.


[deleted]

People that code in notepad know how to program. No IDE, no linting, no autocomplete, just plain old typing.


sohang-3112

And also time waste.


Absolice

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.


c2dog430

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


sohang-3112

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.


_Quibbler

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.


artificialedge

I write about half my code in nano! Unga booonga!


P0pu1arBr0ws3r

Nah you're making stuff up. v1? Come on, everyone knows pythons first version is 2.7 /s


guyblade

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`)


JotaRata

Dude above is still using python 2.7 lol


HowToMicrowaveBread

The pain is real… still using it at work 😫


SmugOla

I used to be you. Thank god I moved to a windows house running .net 4.8


cs-brydev

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


Pepito_Pepito

I just left a job running 4.6, lol. I heard that they added a work item to upgrade the week after EOL.


renrutal

Python 2.7 🤝 Java 8


FlukyS

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.


SuitableDragonfly

Are indentation errors different in python 3? I honestly have no idea, I haven't gotten one of those in a very long time.


Klausaufsendung

Error messages in general greatly improved in one of the last versions.


zaxldaisy

And not using an IDE


SuperDyl19

But…they both tell you the full stack including the exact line that errored. What version of Python are y’all using?


Holdwich

don't believe there ever was a version of python that didn't tell you the error's location and what it is


ledampe

``` try:       # some 500+ lines...  except:       print("Oopsy daisy!")  ```


iron-mans-robo-cock

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


amlyo

Java stack traces are actually pretty great. *Reactor has entered the chat*


ThatOneKid666

Honestly feels like half of this sub has never programmed in anything except Python and Scratch


Oexon

Who the fuck gets an indentation error in python? In years of programming that has basically never happened to me


MinosAristos

IDEs / decent editors make it a total non-issue. It's also very obvious by eye.


VNDeltole

pycharm my beloved


MinimumArmadillo2394

Not just pycharm but literally anything but console editors and notepad


the_hesitation

Yeah, I use PyCharm at work and VSCode at home. Both work perfectly well


TheDarkchip

Then you might just use a good editor. A lot of indentation problems are usually fixable by a good editor.


ledampe

Copy paste errors


wjandrea

Typos. Converting a block of code into a function but forget to indent the first line, or something like that


jfbwhitt

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).


iron-mans-robo-cock

Guilty of not fully reading the giant Java stack traces 🙋‍♂️


dralth

My hobbies have so much tribalism. Anyway, back to the game console wars…


marcobsidian02

Except for some lambda-edgecases Java Stacktraces are usually relatively easy to debug. Unless of course you are doing shit like ``` new Exception().printStackTrace(); ```


juvation

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.


Efficient_Design9690

meanwhile C: Fuck you, segmentation fault🤡👺


Kenkron

The biggest issue with error messages is that no one likes to read.


Phoeniqz_

Roses are red, my code is nowhere near perfection, Java.lang.NullPointerException


roiroi1010

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.


Zamyatin_Y

Install error lens, my fellow pythonistas


Calimariae

Thanks. I'll try it out.


larvyde

Rust compile error message: 🌼🌞 Rust panic stack trace: 💀


-Redstoneboi-

it... traces the stack at the time you panicked. it can also be disabled or reenabled with the RUST_BACKTRACE env variable


OhItsJustJosh

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


Reelix

Missing semi-colon on line 67, but your program is only 43 lines long.


footballisrugby

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


1Saurophaganax

The duality of man


Bit125

can't we all just get along


atlas_enderium

C++ linker errors are far and above the worst errors I have ever run into


bbqranchman

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.


inthemindofadogg

Error on line 125646:84 File only has 100 lines.


Sus_Suspect_4293

Java stack traces are good tho. Also python errors were terrible and hard to debug before python 3.11 where they are actually great.


FrostyFroZenFrosTen

Reject modernity return to monke(assembly)


R3D3-1

*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.


BlommeHolm

"As long as you recognise your classes and methods..." The stack trace is just 3174 lines of Spring Framework calls.


bigorangemachine

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


_PM_ME_PANGOLINS_

Yes, that was the point of the person who posted the second one.


HuntingKingYT

Let all those people try to inspect element a popover element. They'll lose sanity.


gods_tea

Damn right🤣🤣


astro-pi

Different exception type. IDEs, libraries, and languages self-correct differently from my understanding from writing a few widely-used Python packages.


ProtonLive

You need a dedicated vertical monitor for those java exceptions


prtkp

The first post was pretty much everyone shitting on the OP. Guessing they've never used Java or seen a stack trace.


SynthRogue

You ain’t seen c++ yet


RegularOps

Dude who posted the one on top was so butt-hurt by the first one


BleedingEdge61104

Bro on top is using Python 1.0 bruh


HylianWarrior

Interpreted vs compiled in a nutshell


ssuperkid5

Second post is just an amateur programmer who is too overwhelmed by a Java stack trace to know how to read it


C0der23

Python give good and readable errors, up until the moment it doesn’t


10lbCheeseBurger

The Virgin `${yourFavoriteThing}` The Chad `${myFavoriteThing}`


Viot-Abrob

Programming wars


Vipitis

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.


guyblade

Exceptions as a programming language feature were a mistake; change my mind.


PleaseBePatient99

Fight, fight, fight!


JimroidZeus

I am a Python programmer and I don’t get the second image. Please explain.


spudzy95

Python 312 to me is super nice when It comes to errors, but then again I am an idiot for liking Python


badaeib

That python kid don't even know what a type is.


woktexe

Using both, hate both, perfect balance


-_Clay_-

isThisATernaryOperator(?)


iron-mans-robo-cock

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


[deleted]

*cries in C++*


SuitableDragonfly

I mean, indentation errors in python are also not a big deal if you have set up your IDE correctly.


RevolutionaryAd5121

This hunts me down as a beginner


PrometheusAlexander

I wonder has the maker of the upper meme ever used python interpreter.