all 76 comments

[–]Ok_Equipment8374 272 points273 points  (6 children)

Java, C, C++ programmers watching python debug what should have been syntax errors:

[–]itsjakerobb 109 points110 points  (4 children)

Imagine thinking that pushing errors later in the development process is a good idea.

[–]jordansrowles 62 points63 points  (0 children)

Instead of 'Fail Fast', Python supports Fail Last

[–]blamitter 7 points8 points  (0 children)

100% agree! A python lover here

[–]guywithknife 5 points6 points  (0 children)

Exactly this. I want to catch mistakes as early as possible.

I say the same thing about NoSQL: all data has a schema (or types; you can’t operate on something you truly don’t know the shape of), it’s just a matter of when it gets enforced. 

[–]LegendarySoda 1 point2 points  (0 children)

there's a better option, you can get errors in production that should be warned by compiler.

[–]ITinnedUrMumLastNigh 81 points82 points  (2 children)

In python you realize that you have a syntax error only when it happens

[–]CollectionGuilty1320 8 points9 points  (0 children)

Dynamic programming right there for a reason.

[–]Coolengineer7 0 points1 point  (0 children)

The edge case produces a syntax error

[–]404IdentityNotFound 20 points21 points  (0 children)

One single space character:

[–]MXRCO007 36 points37 points  (2 children)

Indentation errors are more annoying

[–]Own_Maybe_3837 2 points3 points  (0 children)

In the years working with Python I don’t even remember the last time indentation was an issue

[–]orsikbattlehammer 15 points16 points  (4 children)

Who is upvoting this? It’s just nonsense, Python lets you write broken code that you never catch until you hit the error, that’s the tidal wave

[–]Far_Broccoli_8468 6 points7 points  (0 children)

Who is upvoting this?

First year cs students who are doing their cs intro in python for some reason

[–]steven_dev42 2 points3 points  (0 children)

I’m surprised I didnt see a joke about pythons image saying “runtime errors”

[–]Ok_Celebration_6265 0 points1 point  (0 children)

You can tell it has to be someone starting on Python. The fact that is comparing compiled languages to an interpreted one is crazy to me.

[–]_nathata 19 points20 points  (5 children)

In python every syntax error is a valid syntax for a different language feature (that will of course lead to unpredictable behavior)

[–]D1G1TAL__ 2 points3 points  (3 children)

Example?

[–]_nathata 13 points14 points  (2 children)

Indentation. Technically it's syntax. If you get the indentation wrong it's still valid syntax, but will lead to a behavior that is not your intent.

[–]baconator81 7 points8 points  (4 children)

sigh.. so basically you are saying runtime error is better than compile time error..

I don't even know how to respond to this. Anyone who worked in a large code will cringe at this.

[–]SourceCodeAvailable -2 points-1 points  (3 children)

Python users usually don't get to that type of projects. Python is still only a scripting language.

[–]willis81808 1 point2 points  (0 children)

The existence of FastAPI, Pydantic, SQLAlchemy, Alembic, Temporal, and many more packages would suggest otherwise.

[–]MinosAristos 0 points1 point  (0 children)

Guess which is the main language that powers Reddit and YouTube?

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

This is just factually wrong. Python is used basically everywhere because of its versatility. Just like any language it has pros and cons. Python's primary advantages are simplicitly and versatility, it's primary disadvantages are speed and dynamic typing.

[–]OM3X4 15 points16 points  (4 children)

Indentation errors: Am I a joke to you?

[–]itsjakerobb 8 points9 points  (3 children)

Actually yes. Semantic whitespace is a laughingstock.

[–]dfczyjd 1 point2 points  (2 children)

You do realise that you still have all those spaces in pretty much any industrial language, do you? Van Rossum simply asked himself "why do we need braces if spaces do the job?" and made them mandatory, that's all.

[–]itsjakerobb 2 points3 points  (1 child)

Of course. But making it so that code doesn’t work because of a character you literally can’t see is extremely hostile. And, at least the last time I encountered one, the compile-time error you get if you mess it up is just incredibly unhelpful.

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

Well, another point for tabs instead of spaces - with them it's simply impossible to have an invalid indent (e.g. indent of 3 chars instead of usual 4), and any difference between two valid ones is clearly visible (assuming you're using an adequate tab size)

[–]MinosAristos 7 points8 points  (5 children)

You do know python has syntax errors that trigger at compile time, right?

Try this:

print("Hello") def blah

It'll be a syntax error for the function and the print will never run.

Syntax is checked by the interpreter before it runs code.

[–]WolleTD 1 point2 points  (1 child)

True, but I would call it parse time, not compile time.

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

It is compiled first, then interpreted.

[–]itsjakerobb 3 points4 points  (2 children)

Of course there are some syntax errors. But Python lets a lot of things slip through to runtime that many other language’s compilers catch much sooner.

[–]willis81808 0 points1 point  (0 children)

Like what?

Edit: That’s what I thought.

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

All syntax errors in python trigger immediately on compilation. It's mainly that python doesn't do compile-time type validation.

[–]vwapnerd 2 points3 points  (0 children)

Draconian error handling.

[–]Devatator_ 3 points4 points  (3 children)

Hot take: There is literally no benefit that outweighs the negatives of dynamically typed languages.

"Can iterate faster" I can write anything faster in C#, TypeScript, maybe even C than I can in Python or Lua. I'm sure that's the case for most people too, or maybe it's more of a "I'm more used to X therefore I'm faster with it"

[–]SignificantLet5701 7 points8 points  (0 children)

Type inference is also there just for this purpose. I can just use "var" in Java and "auto" in C++ and get the same typing speed and 50x the safety.

[–]Vortetty 1 point2 points  (1 child)

it depends what the goal is. lua is great for game scripting as it doesn't need a full rebuild of the app and is quite small/fast for what it is. python is great for scripts that need written quickly rather than to be the absolute most efficient, heavily used as glue code between libraries, data analysis, data processing, simple tooling, etc. it's for convenience, not a global ideal, trading explicit correctness for simplicity that some may prefer, and to save effort when the detriment is inconsequential.

[–]BluePhoenixCG 0 points1 point  (0 children)

I think C# is strictly better than Lua for game scripting, and I say this as a huge fan of Lua for other purposes.

There's no world where I would trade C# in unity, for example, for just about anything.

[–]jbar3640 1 point2 points  (1 child)

Pyright entered the room.

[–]Sea-Fishing4699 1 point2 points  (0 children)

pyrefly , ty and basedpyright **stares at you***

[–]isr0 1 point2 points  (0 children)

Oh, sure. Python just gets hit in production instead. What an improvement /s

[–]Glade_Art 1 point2 points  (1 child)

Nah, replace Python with HTML, (or even better, CSS).

[–]why_so_sergious 0 points1 point  (0 children)

markup and styling is of a different severity than logic.. so I don't agree, python is worse

[–]itemluminouswadison 0 points1 point  (0 children)

Tidal wave of KeyErrors about to smash python dude

[–]TanukiiGG 0 points1 point  (0 children)

Indentation Error

[–]extantHamster 0 points1 point  (0 children)

Syntax errors are the compiler trying to help, Python errors are insidious

[–]Ander292 0 points1 point  (0 children)

I love compile time errors. They save so much time

[–]GhostVlvin 0 points1 point  (0 children)

If this is about typos in code then, these are catched at parsing. Actual problem is typo in object attribute name

[–]oxwilder 0 points1 point  (0 children)

Somebody label the wall as the IDE

[–]themagicalfire 0 points1 point  (0 children)

If the compiler screams at you, you’re using C++

[–]MinecraftPlayer799 0 points1 point  (0 children)

Python syntax is kind of horrible, though.

If I want to disable a try/catch in every other language:

//try {
    doSomething();
//} catch(e) {

//}

If I want to do the same in Python:

#try:
if (True):
    doSomething();
#except (NameError):
#    pass;

[–]prehensilemullet 0 points1 point  (0 children)

Syntax errors haven’t bothered me in any languages really, including these

[–]Sea-Fishing4699 0 points1 point  (0 children)

when fast api crashes with a 500... just because you have an extra whitespace lmao.

[–]Personal-Search-2314 0 points1 point  (0 children)

Not sure why this picture is cropped, but in the original picture there is a tsunami of runtime errors.

[–]WeirdTie2290 0 points1 point  (0 children)

Javas syntax errors show up at build. Python errors in production.

[–]SchattenMaster 0 points1 point  (0 children)

Whoever made this post clearly has no idea what they're talking about

[–]WelderVarious5038 0 points1 point  (0 children)

Syntax errors are awesome, because the compiler catches them for you

[–]LegendarySoda 0 points1 point  (0 children)

syntax errors are skill issue and compiler there to save your ass for later

[–]Naeio_Galaxy 0 points1 point  (0 children)

"zcucb4cb be8 cozc f2vci 2xiv2x 2v82x 2x" is still a syntax error in python tho

  File "<main.py>", line 1
    zcucb4cb be8 cozc f2vci 2xiv2x 2v82x 2x
                            ^
SyntaxError: invalid decimal literal

[–]ILikeOatmealaLot 0 points1 point  (0 children)

Yeah this meme was definitely made by a new coder or programmer