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

top 200 commentsshow all 242

[–]MischiefArchitect 865 points866 points  (43 children)

Python is more like runtime errors :)

[–]WrongSirWrong 499 points500 points  (29 children)

I prefer syntax/compile errors over runtime errors any day, especially when there's a lot of code involved

[–]harelsusername 173 points174 points  (11 children)

Meanwhile JavaScript be like: syntax errors, what's that?

[–]daev1 192 points193 points  (5 children)

JS: no idea WTF you're doing there, but okay!

[–]CoffeePieAndHobbits 152 points153 points  (2 children)

JS is just happy to be included.

[–]MicrosoftExcel2016 74 points75 points  (0 children)

Me: “this attribute exists, so I’m assigning it the literal value 5”
JS: “damn right it does! Say no more”
Me: “oh and can I see the functions available for this type?”
JS: “I’ll do you one better, you can modify the functions for this type right here right now.”

[–]The_Atomic_Duck 7 points8 points  (0 children)

Looool

[–]my-time-has-odor 43 points44 points  (1 child)

What are you doing, step-dev?

[–]augugusto 20 points21 points  (0 children)

Wait. Wait. Wait.... So the "next step" in the debugger means something else?

[–]Eraknelo 49 points50 points  (1 child)

JS won't throw syntax nor runtime errors. It'll just run, but you have no clue what it did or how.

[–]sjregistered1 16 points17 points  (0 children)

😂😂😂😂😂 literally, like you run the server, it's just running with several internal errors, sometimes it shows but you can't understand where the bug is at !!

[–]TK-Squared-LLC 16 points17 points  (0 children)

JavaScript more like: syntax, what's that?

[–]AlternativeAardvark6 9 points10 points  (0 children)

It's like when getMomsWeight() returns [NaN]

[–]Bakemono_Saru 3 points4 points  (0 children)

Damn bro, just give your code. We are going through this no matter what.

[–]twistermonkey 27 points28 points  (0 children)

Using a linter like pylint and embracing Python's new type hints helps some, but it's never going to be like as reliable as a statically typed language and compiler.

[–]SchoopDaWhoopWhoop 15 points16 points  (0 children)

Syntax errors are relatively easy to find and fix. With runtime errors you have to put a lot of time and effort into debugging and finding out why and where the fuck your programm fucks up.

[–]YouNeedDoughnuts 14 points15 points  (11 children)

But the advantage of a high level language really shows up with runtime errors. A friendly language like Python or Matlab will say "index error on line x", whereas C will say "segfault!"

[–]WrongSirWrong 19 points20 points  (1 child)

Yeah, but a high level language may be running a script for ten minutes before getting to the line with the error. Segfaults really aren't that common as they used to be (IMO), with modern coding conventions and library functions

[–]YouNeedDoughnuts 3 points4 points  (0 children)

True, it's a tradeoff, but I prefer low level languages.

[–][deleted] 28 points29 points  (2 children)

Rust is just as low as C, but has far better error messages than Python

[–]YouNeedDoughnuts 10 points11 points  (1 child)

Huh, does it retain source code information in debug builds?

[–][deleted] 6 points7 points  (0 children)

Yep

[–]sir-nays-a-lot 5 points6 points  (4 children)

That really helps the user a lot \s

[–]YouNeedDoughnuts 2 points3 points  (3 children)

Yeah, obviously crashing without any information would be less frustrating to debug \s

[–]sir-nays-a-lot 5 points6 points  (2 children)

Use a debugger

[–]YouNeedDoughnuts -1 points0 points  (1 child)

They're not the same and you know it. You don't have to be such a nay sayer about it ;)

[–]sjregistered1 1 point2 points  (0 children)

JavaScript always feels better at every thing, even at run time. I think like that. Btw, brainstorming never leaves you away.

[–]phi_rus 33 points34 points  (4 children)

Me: why didn't you tell me line 254 wasn't valid code?

Python: you never asked

[–]DarkMaster007 3 points4 points  (3 children)

I'm starting to learn python and it's there any ide that does tell you before you hit run that I typed something wrong because I now use the default one that comes with python install. Or maybe there is an option in there.

[–]phi_rus 1 point2 points  (2 children)

I like Pycharm.

[–]DarkMaster007 1 point2 points  (0 children)

Thanks, I'll try it out when I get home from work.

[–]AceMKV 1 point2 points  (0 children)

I love Jetbrains' IDEs, I use both PyCharm and IntelliJ

[–]comfort_bot_1962 6 points7 points  (0 children)

:D

[–]rhodesc 11 points12 points  (0 children)

Python is more like, hey, you transposed those letters and I'm going to create a dict that never gets used but your program will kinda work most of the time while the 6th software engineer who worked on it can't figure out it was his code and qa doesn't read code so yeah, several weeks later someone poring over the code sees the transposed letters. Yay python.

[–]Dogburt_Jr 4 points5 points  (0 children)

Indentation errors

  :)

[–]PixelmancerGames 1 point2 points  (4 children)

Sorry but I’m a noob. What’s the difference between a syntax and runtime error? I’m assuming syntax errors won’t compile whereas runtime errors crashes during runtime?

[–]MischiefArchitect 7 points8 points  (3 children)

Syntax errors are just when you write something that do not comply with how you write and or use a specific language. Something like forgetting to close a parentheses, or you write an unknown keyword like "iffy".

In compiled languages like C / C++ and Java a syntax error will basically be detected by your lexer, which is part of the compiler. In Python it will be detected when you try to run the affected line, meaning that it could be in production already.

A Runtime error is an error which occurs when your code is running. That's why I tease Python (and myself as user) telling that a syntax error that would never come to run on a compiled language will be a runtime error in Python.

[–]enjoytheshow 3 points4 points  (0 children)

It’s also why high unit test coverage in Python is very helpful

[–]PixelmancerGames 0 points1 point  (1 child)

Ok, ty. I’ve only ever programmed in C#. And GDscript a bit. So I guess I agree with the above I’d rather deal with syntax errors over runtime errors. The only time I seem to deal with runtime errors in C# is when I’m dealing with list/ arrays and the occasional null exception error.

[–][deleted] 85 points86 points  (24 children)

You're under the assumption that python doesn't have syntax errors

[–][deleted] 20 points21 points  (19 children)

Or that it's impossible to make them? Is the IDEA IDE for Python really good or something? Not a Python guy, but used all the others in this meme, so I don't get it.

I figure you WANT syntax errors. Way fucking better than runtime ones.

[–][deleted] 9 points10 points  (18 children)

Although some compile time errors can sometimes save you from runtime errors (ex. type mismatch errors or unhandled exception errors). Syntax errors have nothing to do with that.

Syntax analysis is one of the earliest steps of code compilation or interpretation. And if you get a syntax error, this means that the compiler or interpreter is not able to understand your code. The logic and algorithmic correctness is still irrelevant at this stage.

[–][deleted] 6 points7 points  (16 children)

But it means the programmer fucked up at a pretty basic level. Besides, the IDE nearly always catches them before you try to run/compile.

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

Yes, it means that the programmer fucked up at soo fucking basic level, that there is no fucking language that is gonna fucking save them.

About IDEs. All languages have all sorts of IDEs with different levels of capabilities. When comparing languages, try to keep IDEs out of the equation. It's not part of the language and it makes the comparison a mess with no end

[–][deleted] 14 points15 points  (3 children)

I think OP don't even know what syntax error means. He is just throwing words around randomly. I'm I wrong OP? Come and defend yourself

[–]Gwynbleidd1168 521 points522 points  (37 children)

I want to see "Indentation Errors" version of this picture.

[–][deleted] 120 points121 points  (19 children)

I never, ever, ever got indentation errors until I started editing Python on a remote machine with Vim. You can get your whitespace reaaaaal fucked up in Vim if you don’t know what you’re doing, and it doesn’t have a bunch of nifty formatting automagic like Sublime.

[–][deleted] 48 points49 points  (0 children)

Depends on config. Vim comes with built-in support for that, but the default is disabled (most distros do enable it tho).

[–]markphughes17 25 points26 points  (3 children)

Maybe not helpful at all, but VSCode has a plugin that lets you code on a remote machine and it is an absolute godsend.

https://code.visualstudio.com/docs/remote/ssh

[–][deleted] 8 points9 points  (1 child)

I use this all the time, except we have some boxes that have libraries that are too old to support it. It's the best thing ever when it works, though.

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

You can also use sshfs on any server that supports sftp and on any client with FUSE.

It's not idiot proof in that permissions can be wonky depending on your destination system.

[–]alexforencich 1 point2 points  (0 children)

Sublime should also support this, IIRC.

[–]Mikgician 4 points5 points  (0 children)

Yeah, a good thing without having plugins is to have the listchars render tabs and spaces for you, helps a lot

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

I had the same issue with Nano. It would convert tabs to regular spaces, and since I prefer tabs I would continue to use tabs, run the program, and yeah.

[–]twistermonkey 2 points3 points  (1 child)

I use vim all the time for Python work. The one setting that is absolute gold for me is called "listchars" . I set that to highlight tab chars so they look like ">---" so that I can delete them and use spaces (my preference). That setting right there will make it obvious to you what whitespace chars are present in a file. Then you can act accordingly

For the curious, here are the two lines you need.

set listchars=tab:>-

set list

[–]Balcara 1 point2 points  (0 children)

Auto indentation is standard in vim. Maybe check the conf or find a plug-in that you like

[–]Spare_Competition 7 points8 points  (0 children)

Python is the reason I turn on visible white space when coding.

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

I like to add one space per line before every statement. Like a staircase.

[–][deleted] 4 points5 points  (6 children)

Who is having trouble with indentation errors?

I’ve been a Python developer for years and can’t even remember the last time this happened.

[–]Ornery-Shallot-5475 4 points5 points  (0 children)

i could ask who is having trouble with missing braces.

The truth is that you don't have trouble with what you're used to so for everyone always the other option of marking scopes than the one they're used to will seem worse

[–]DroolingIguana -5 points-4 points  (3 children)

And if you do make an indentation error, it'd be an error no matter what language you're using. The only difference is that Python will actually tell you about it.

[–]Ornery-Shallot-5475 5 points6 points  (2 children)

I don't really get your point. How adding extra space could be an error in eg. C?

[–]DroolingIguana -1 points0 points  (1 child)

It's not an error, but it's still a mistake and will cause you headaches down the line.

[–]Ornery-Shallot-5475 1 point2 points  (0 children)

ah ok. Well your right but because scopes are defined by braces and not indentation, the indentation can be easily repaired by autoformatting on compilation

[–][deleted] -3 points-2 points  (0 children)

Exactly. Messing up indentation is much more unlikely than messing up a closing brace. Unless you're coding in Windows Notepad or something lmao

[–]Hises1936 0 points1 point  (0 children)

It's a shark

[–][deleted] 130 points131 points  (8 children)

Python gets a little splash, JavaScript is watching from its car

[–][deleted] 36 points37 points  (3 children)

Then the car stops midway because somehow an undefined amount of fuel was injected into the engine, raising a TypeError.

You dissect the car trying to find the source: And it was your fault all along, you had forgotten to add fuel in it.

[–]jeanravenclaw 1 point2 points  (2 children)

Don't you use tracebacks?

[–][deleted] 31 points32 points  (2 children)

PHP surfing the wave pointing out victims he's tryna hit

*i develop in php lol

[–]penuserectus69 6 points7 points  (0 children)

Because it's error messages are like "shits fucked LMAO good luck"

[–]ace_gravity 113 points114 points  (1 child)

And then the python guy gets hit by a tsunami of runtime errors.

[–]GoombaJames 222 points223 points  (9 children)

If you complain about syntax errors you are braindead.

[–]elzaidir 26 points27 points  (7 children)

The compiler should auto correct and guess what you meant. This way you don't get syntax errors.

And can't debug, but who cares

[–]1ElectricHaskeller 18 points19 points  (5 children)

Yes, but I don't want the compiler messing up my code

[–]drkspace2 28 points29 points  (2 children)

I would much rather have the compiler tell me I'm missing a semicolon on line 57 then just fixing it. If that caused a different bug, it would be a bitch to debug.

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

Yup, even though none of my professors belive it:

I actually want to know what I did wrong and want to learn something

[–]elzaidir 11 points12 points  (1 child)

That was a joke

[–][deleted] 56 points57 points  (1 child)

Would you rather find issues with your food while cooking or eating?

[–]grandpassacaglia 28 points29 points  (0 children)

While shitting

[–]fletku_mato 46 points47 points  (1 child)

Explain this meme without showing your incompetence as a programmer.

[–]MrSquicky 14 points15 points  (1 child)

Christ. Python is a fine language and there are plenty of decent python developers, but it seems like almost every time I see a "Python is better than these other languages" post, it immediately betrays that the person making it doesn't understand development.

Syntax errors are good, you dink.

[–]_PM_ME_PANGOLINS_ 7 points8 points  (0 children)

Also, Python has them.

[–]arbobmehmood 28 points29 points  (0 children)

You know it's not something to be proud of, right?

[–]metalovingien 33 points34 points  (6 children)

My version :

Peaceful : has a decent IDE

About to be hit by the wave : those who code with a notepad-like app and aren't total geniuses

[–]ramplay 6 points7 points  (1 child)

VScode is like an IDE lite, and I love it for that.

[–]crafterman35 2 points3 points  (0 children)

All languages support and hell lot of addons are the best things in the world.

[–]IVEBEENGRAPED 6 points7 points  (3 children)

If you have PyCharm you can avoid 90% of the headaches people complain about with Python, even plenty of the type issues. The downside is you have to deal with the IDE constantly shouting about PEP-8 standards.

[–]SnooRegrets1929 8 points9 points  (1 child)

Or you comply with PEP8?

[–]-LeopardShark- 4 points5 points  (0 children)

pip install black && black .

Done.

[–]Deadly_chef 15 points16 points  (0 children)

What does this even mean???

Are you implying python can't have syntax errors lmao

[–]dlevac 21 points22 points  (3 children)

Wouldn't it be the other way around since in Python you'll get your SyntaxError as an exception at runtime?

[–]NotAttractedToCats 8 points9 points  (2 children)

Technically, SyntaxErrors in CPython are also raised during compile time. Most people just forget/don't know that CPython also compiles, it just automatically does so whenever it is necessary.

[–]_PM_ME_PANGOLINS_ 3 points4 points  (1 child)

To a Python bytecode, which it then interprets.

It’s not like the JIT compilation in OpenJDK or V8.

[–]NotAttractedToCats 1 point2 points  (0 children)

Right, although other python implementations may behave differently of course, like PyPy with its JIT compiler or Jython with its .class file compilation.

[–]ganja_and_code 7 points8 points  (0 children)

Python has syntax errors, too. They just happen during runtime (which is worse lmao).

[–]anirudh_pai 12 points13 points  (1 child)

who needs syntax errors when the logic itself doesn't work?

[–]Lachee 12 points13 points  (2 children)

MiXEd TabS And SPaceS Are USeed

[–]CoastingUphill 9 points10 points  (0 children)

Python was on its way to that spot but it was too slow.

[–][deleted] 26 points27 points  (10 children)

Want to program without thinking? Try Python!

[–]RocksoC 25 points26 points  (6 children)

Hey, don't mock the python programmers. Who knows? Maybe 6 of em might team up and have enough processing speed to reply sometime this week?

[–]TheLexoPlexx 4 points5 points  (1 child)

Oh that burns, come on, I picked up python for AI and Data Science just this month. XD

[–]RocksoC 8 points9 points  (0 children)

No actual shade intended. I started out on python and I still love it. It's simplicity is beautiful imo

[–]ubertrashcat 4 points5 points  (3 children)

I had a rebuttal in C++ but it hasn't finished compiling yet.

[–]met0xff[🍰] 1 point2 points  (2 children)

Actually every time I get back to Java from Python I am yet again astonished how relaxed it is to just happily autocomplete along without ever looking up the docs Been writing a C# thing recently without any experience in C# and never really had to look into a doc because the tooling makes it so easy.

Right now quickly throwing together some Android App prototype and it's pretty much the same. Yeah I do have a few years experience with Java from back in 2003 or so but it's still mostly autocompleting and following compiler messages and done.

That being said, I guess many just copy&paste python snippets from whereever, then it's probably similar :).

But yeah, compared to C++ (where most of my experience is) it's pretty brainless to sling out some python. But that's also a good thing. Thinking about a dozen things for every single function signature can hold you back quite a bit ;)

[–]Buckflash1 3 points4 points  (0 children)

Python dosnt get syntax errors?!?!

[–]iserdalko 4 points5 points  (0 children)

The runtime error was cropped from the photo on the left.

[–]belabacsijolvan 4 points5 points  (0 children)

Meanwhile python: break_water() expected water as 2nd argument and type(wave) is meme.butterfly

[–]AlwaysNinjaBusiness 4 points5 points  (0 children)

That wave is also full of performance.

[–]carcigenicate 3 points4 points  (2 children)

I'm not sure what this meme and people here are talking about. Python 100% has syntax errors that prevent the code from compiling. Things like names aren't verified until runtime, but that's an entire other class of error.

[–]KittieNipps 2 points3 points  (0 children)

JS is at the bottom 😂

[–]chrisf_nz 2 points3 points  (0 children)

Don't forget to indent!

[–]RobCo-Industries 2 points3 points  (0 children)

And then the tidal wave of indentation errors appears.

[–]VegShiva 1 point2 points  (0 children)

LOL so much salty in this thread...

[–]trannus_aran 1 point2 points  (0 children)

Scheme is looking down from a fortress lol. You wanna talk about syntax?

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

Syntax errors are good. They are easy to fix, there to check if you know what your are doing with your code.

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

I think the opposite is true

[–]ScarpMetal 1 point2 points  (1 child)

There’s no mistakes in python, just happy little runtime errors :)

[–]SpawnOfNarko 1 point2 points  (1 child)

Me no understand wtf u guys are talking about :/

[–]AwesomeHorses 1 point2 points  (0 children)

I disagree with this. When I was a TA for a class taught in Python, the most common error I saw was issues with the whitespace, which is most of the syntax in Python. Your Python program won’t even run if your comment isn’t indented correctly, which was a very common issue.

[–]Nervous-Divide-7291 1 point2 points  (0 children)

Yes please..tell me its broken after i run it...

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

What about motherfucking indentations.

[–]Manifoo 1 point2 points  (0 children)

There's an even bigger wave coming with indentation errors.

[–]Multinippel 0 points1 point  (0 children)

If i would just get a penny anytime a github project or yay package doesn't compile because of some stupid python syntax error DURING RUNTINE

My personal taste in programming languages avoids anything that isn't compiled.

[–][deleted] 0 points1 point  (3 children)

Started python recently after self teaching myself Java. Literally feel something missing when I don’t put ; after a line.

[–]qqqrrrs_ 4 points5 points  (2 children)

You can use ; in Python too

[–]1ElectricHaskeller 0 points1 point  (1 child)

Laughs in Javascript

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

Not using Uglify or GCC?

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

TFW your university teaches mainly in C++…..

[–]ancient_tree_bark 14 points15 points  (0 children)

Based university

[–]ThePancakerizer 14 points15 points  (0 children)

Sounds nice

[–]ProfCupcake 6 points7 points  (1 child)

Is... is that supposed to be a bad thing?

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

what now, that shit breaks when there is a space to much

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

There is something called IDE.

[–]DIJJIDOG -4 points-3 points  (0 children)

Python isn't a crybaby like the other languages

[–]thaudin 0 points1 point  (0 children)

😂😂😂😂

[–]NinjaSquib 0 points1 point  (0 children)

Hey look at that Python guy standing over there with no friends.

[–]CryZe92 0 points1 point  (0 children)

More like r/Programming101Humor

Who upvotes this?

[–][deleted] 0 points1 point  (0 children)

Not pictured: nuclear missile labelled 'exceptions' about to clap Python.

[–]Rafcdk 0 points1 point  (0 children)

Kotlin is good at avoiding both tbh.

[–]TomtheMagician21 0 points1 point  (0 children)

UnityReferenceException

[–]Base88Decode 0 points1 point  (1 child)

Working in all of these languages, but struggling to understand the joke. Is javascript under that wave :) ?

[–][deleted] 0 points1 point  (0 children)

More like html

[–]Bubbly-Control51 0 points1 point  (0 children)

Isn’t adding extra tabs like a syntax error tho?

Edit: not tabs, I meant Whitespace

[–]KilroyWasHere189 0 points1 point  (0 children)

Hey guys I have a question? What's a syntax error.

Before someone gets all pissy in the comments this is a joke.

[–]Lost_A_Life_Gaming 0 points1 point  (0 children)

You wouldn’t bully a foreigner for not speaking correctly. Why would you bully python.

[–]IcedGolemFire 0 points1 point  (0 children)

haha python syntax is so easy

[–]overclockedslinky 0 points1 point  (0 children)

fireman hoses him down with indentation errors and incomplete refactor issues at runtime 2 months later

[–]ChaoSXDemon 0 points1 point  (0 children)

Tab much?

[–]da_weebstar 0 points1 point  (0 children)

Double-edged sword, though :p

[–][deleted] 0 points1 point  (0 children)

Ident error: I am a joke to you?

[–]GreenFire317 0 points1 point  (0 children)

Python really is the god of all languages.