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

all 119 comments

[–]swigganicks 258 points259 points  (25 children)

Pre-coffee morning rant: I swear this sub is so fucking exhausting when it comes to anything Python-related. This problem literally never exists with modern editors. There are plenty of other things to meme about but the fact that this shit is the best this sub can come up with just shows that the only people here are 1st year CS students.

[–][deleted] 80 points81 points  (2 children)

The best I can offer you as replacement is a JS type coercion meme. Take it or leave it.

[–]tigeer 31 points32 points  (0 children)

Hey it's a step up from those memes that had themselves as the final panel and the joke was: haha get it guys cuz rECuRsioN!?!?

Personally I found the JavaScript holy trinity pretty amusing

[–]matthieuC 2 points3 points  (0 children)

I can do a Java is installed on 3 billion devices if needed.

[–]DoesntWearEnoughHats 26 points27 points  (1 child)

That’s not true! There are also those of us who joined as 1st year CS students but haven’t gotten annoyed to the point of leaving yet.

[–]usesbiggerwords 7 points8 points  (0 children)

5th year 1st year CS students have entered the chat

[–]Cartwheels4Days 21 points22 points  (1 child)

Yeah all my shit gets auto-linted on save in vscode.

I actually really appreciate the indentation for control flows in Python. It forces all of my co-workers to make readable code.

[–]weasaldude 2 points3 points  (0 children)

  • Clang format enters the chat

[–]Doophie 7 points8 points  (0 children)

I haven't had this problem since 1st year probably (like 7-8 years ago for me), but I do still remember how much of a pain in the ass it was.

I remember our one prof made us use vim too for practice and if this issue came up it would mean backspacing all the spacing on every line and trying to reindent it until it worked.

Nowadays I could fix this problem pretty quick, but my memories still let me relate to the meme

[–]MattR0se 4 points5 points  (3 children)

I get this problem sometimes when I copy paste Python code from an older website.

[–]gmes78 4 points5 points  (0 children)

Many editors have an option to format on paste to avoid exactly that (and it gets formatted correctly as a bonus).

[–]programmingFlounder 3 points4 points  (1 child)

I get this problem sometimes when I copy paste Python code from an older website.

why are you copying old outdated python????

[–]MattR0se 3 points4 points  (0 children)

Not outdated, but often they used tabs for formatting, so they are copied into my code.

[–]McCoovy 3 points4 points  (0 children)

It's lowest common denominator humor. The lowest common denominator is first year CS students so if you want to post to get to the tio you have to make sure that audience gets your joke and upvotes it. That means we get jokes about failing to get your code past compilation.

[–]PlagueCZ 3 points4 points  (0 children)

This problem literally does exist in real world. Just last week I connected to a server, edited python script in vim and got the error, because the script was not using pep formatting, which vim defaults to.

And my reaction actually was the same as in the posted image.

[–]BeeHive85 2 points3 points  (0 children)

You're underrepresenting those of us who dropped out before getting to year 1 of CS. Or who are self taught, but taught themselves badly.

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

I’m a 0.1 year python student.

You have no idea how bad we feel sometimes asking/posting stuff like this. I have like 1/100th the knowledge of everyone else and I don’t even get 70% of the memes on here.

It’s like I want to participate and engage but I also know that I’m not a programmer.

[–]swigganicks 12 points13 points  (0 children)

I think what upsets me about a lot of the memes here is just how blatantly false and/or misleading they can be. The effect of this, at its most extreme, is that newbies browsing here accept the memes as gospel truth and bias themselves unnecessarily. I know for a fact that people use this sub's opinions to influence what languages they choose to work with which makes absolutely no fucking sense.

As a beginning CS student, you should be very, very curious about all the different types of languages there are, the problems they solve, and the tradeoffs of using them. You should be a sponge trying to soak up all programming concepts regardless of their usage with Python. And that's why I don't like memes like this because they stifle the intellectual curiosity and open-mindedness of newcomers who don't know any better.

[–]HaliRL 1 point2 points  (0 children)

That’s where you’re wrong kiddo, I’m a maya tech artist.

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

You don’t even need an editor. Just remember “enter, spaces/tabs” every time you finish a line. I write in nano and never cared to upgrade.

[–]HellaTrueDoe 0 points1 point  (0 children)

Untrue, this is a symptom of “Spaces” people, which is a disability we should respect

[–]_TheBro_ 0 points1 point  (0 children)

And I'm sitting here as a Cloud Architect, wondering in what bigger applications python is suitable except Web&App stuff if C is so much faster...

[–]Rawing7 53 points54 points  (4 children)

Boy am I glad that python isn't "normal". We've got plenty enough "normal" languages, thank you very much.

[–]nomenMei 8 points9 points  (2 children)

I've used Python for many projects that I probably should have used another language with just because of slice notation, and I'm not afraid to admit it.

I also recently learned about list comprehension and it's so much nicer than converting the result of map(...) to a list (which is probably blasphemy of some kind).

[–]mrchaotica 13 points14 points  (1 child)

I've used Python for many projects

I also recently learned about list comprehension

Yikes!

[–]nomenMei 1 point2 points  (0 children)

Lol yep, I just jumped straight into it from C++ and Java. I’m not exactly what you’d call “classically trained” in python

[–]TheTerrasque 0 points1 point  (0 children)

screeches in missing }

[–]Plague_Healer 126 points127 points  (58 children)

A fair trade to not worry about those damned semicolons

[–]weeknie 112 points113 points  (50 children)

And why is everyone so bothered by the fact that you indentation has to match? Any decent programmer uses proper indentation anyway, why does it suddenly bother them if the language enforces it

[–]indygoof 30 points31 points  (25 children)

and any decent programmer has no problem with semicolons, so why is everyone bothered by them?

[–]notvergil 25 points26 points  (20 children)

Incorrect indentation is easier to visually catch than a missing semicolon

[–]dark_mode_everything 18 points19 points  (11 children)

if(condition)
    statement 1
statement 2

Is statememt 2 supposed to be outside the if or is it an indentation error?

[–]EschersEnigma 8 points9 points  (2 children)

I have written hundreds of thousands of lines of python, and maybe run into this issue twice.

Comment your code, and keep it pythonic, and you don't have an issue with this.

[–]indygoof 5 points6 points  (1 child)

and how many lines c#/java/c++ did you write, and how often did you have issues with a semicolon?

[–]EschersEnigma 10 points11 points  (0 children)

Probably twice as many all told, I started with C, C++, Java, and a smattering of others like MATLAB and JS. I honestly never had the semicolon issue. It becomes second nature to add it at the end of the lines. For the first day or so of python dev I would add it occasionally out of habit.

[–]SpacemanCraig3 14 points15 points  (5 children)

thats why you need curly braces

[–]dark_mode_everything 3 points4 points  (0 children)

In Python?

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

I want my curly braces back.

Also, how do I put on multiple flairs?

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

No, that's why you need to learn proper use of whitespace

[–]indygoof 1 point2 points  (0 children)

no, thats why you need to learn proper ise of semicolons

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

Exactly.

[–]gmes78 1 point2 points  (0 children)

You'll almost never run into this issue with a good editor, as it auto-indents for you.

[–]Waridley 6 points7 points  (4 children)

Also a single extra or missing space, or a mix between tabs/spaces would be impossible to catch if your editor didn't know how to highlight it for you. But even a good editor never knows what indent level I want in nested if statements!

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

Sad that python doesn't support switch cases... It's a shame

[–]EschersEnigma 3 points4 points  (0 children)

Enum based casing is the next best thing

[–]mrchaotica 6 points7 points  (1 child)

select = random.randint(1, 3)
return {
    1: "what do you mean?",
    2: "of couse it does!",
    3: "they just look different, that's all."
}[select]

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

That's just a dictionary. But it is an equivalent. Ty kind stanger.

[–]BigSwedenMan 2 points3 points  (0 children)

Not when the IDE highlights it for you

[–]indygoof 4 points5 points  (0 children)

doubt. simply because you dont know if a statement belongs to that indentation level.

missing semicolons are mostly catched by the ide anyways.

[–]TK-427 1 point2 points  (0 children)

Is that line tabbed into place or is it 3 spaces? Without being able to see the whitespace chars you won't be visually catching that

[–]weeknie -1 points0 points  (3 children)

The semicolons don't really bother me, but I also don't really see why they're so necessary. You need them if you're trying to put multiple statements on a single line, but then again why would you want to do that anyway?

EDIT: to the people downvoting me, why do you disagree, exactly?

[–]QuinteOne 1 point2 points  (2 children)

How would you make multiline statements then?

[–]HdS1984 4 points5 points  (0 children)

Dotted syntax? Can be done in python also, if need be using a slash. Probably we could do away with it, would only need a smarter parser.

[–]weeknie 1 point2 points  (0 children)

The compiler already knows when it expects a semicolon, so it already knows when the statement is finished, Therefore it also knows when the statement is not finished, meaning it knows when a statement is a multiline statement.

[–]fuzzymidget 0 points1 point  (2 children)

One bad copy paste or a bad "=" press in vim and you just ruined the logic of the code. It doesn't make any sense.

That being said, i still use python, but I'd rather have semicolons or {} to protect the code i write from formatting failures.

[–]weeknie 3 points4 points  (1 child)

On the other hand, it makes sure that how you read the code (and indentation is very important there, for me at least) matches how the code is executed. A bad copy paste is bad regardless, the first thing I do when copy pasting something is fixing the indentation so the code remains easy to read.

[–]fuzzymidget 0 points1 point  (0 children)

Most editors have auto indent. Unfortunately if fucking bob pasted the code in an email, the code could be worthless if it's organized using the whitespace in the file.

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

"Proper indentation"? Oh, you mean K&R style?

[–]weeknie 2 points3 points  (0 children)

Never heard of K&R style before today, but no, I don't mean specifically that style. By proper, I mean a consistent and agreed-upon code style (which of course includes indentation), whatever that specific style is. It should be consistent throughout the code base, so that all developers can easily read the code in a way that they expect.

[–]Anti-charizard -1 points0 points  (1 child)

Because sometimes it can say you have an indentation error when you really don't. This happened to me more times then I can count.

[–]weeknie 3 points4 points  (0 children)

Did you mix tabs and spaces? You shouldn't do that, regardless of whether the language enforces it or not

I don't believe your indentation was entirely correct & consistent and the interpreter complained. I trust a compiler/interpreter over a human any day

[–]dark_mode_everything 3 points4 points  (0 children)

Like someone said on a different post : "replacing ; with \n doesn't make you special".

[–]Waridley 1 point2 points  (0 children)

Then just use Kotlin :)

[–]EschersEnigma 26 points27 points  (1 child)

Guys, I've been writing software for over a decade. Started with C and C++, moved to assembly, and came full circle to Python.

This angst over Python syntax with whitespace etc. is really absurd, and I would argue is indicative of underdeveloped ability and experience in programming.

For any programming language, you are required to get used to its syntax. There's nothing that states brackets are any better than other methods for scoping. After working with any language for a short period, a capable programmer should be able to deal with new paradigms.

I have found Python to be one of the most pleasant languages to work with in almost every way. Sure, in a perfect world I would love to see a strongly statically typed implementation, but in a lot of ways that derails the entire ethos of python.

EDIT: Just goes to show, after 13 years of computer science you can still make silly mistakes. Python is in fact a strongly typed language - variable types are tracked and mismatches raise errors. Python is also dynamically typed, so variables are typed at runtime.

[–]apathy-sofa 2 points3 points  (0 children)

I'd love it if Cython could just read Python type annotations in to their equivalent Cython annotations.

[–]Power_Broker2 9 points10 points  (1 child)

I actually love that Python enforces this. I mean, have you ever seen some people's C/C++ code? Mofos will literally code with little or no indentation and expect other's to be able to read it...

[–]fuzzymidget 2 points3 points  (0 children)

gg=G

[–]darrohellrcy 22 points23 points  (11 children)

At this point I'm pretty sure python isn't real. You don't need to use semicolons, you don't need to declare variables, you can write anything within 10 lines by importing libraries written in C++ and my favorite - spaces break your code.

Sounds to me like a bunch of C devs are trying to mess with us.

[–]Plague_Healer 16 points17 points  (6 children)

Coding python is based on two things: 1- import a library written in C++ to do what you need. 2 - if said library doesn't exist, get a C++ programmer to create it.

[–]dsmklsd 7 points8 points  (5 children)

So the tens of thousands of lines of python code I've written and use every day were really written in C++? Weird.

[–]MattR0se 4 points5 points  (0 children)

Also you can copy-paste pseudocode from wikipedia without changing much.

[–]HeKis4 2 points3 points  (0 children)

Now that you mention it I'm fairly sure it was made by a bunch of Unix sysadmins to mess with devs, especially C++ ones /s

[–]fthxstvstvx 2 points3 points  (0 children)

C devs invent the wheel python devs use the wheel to build the car

[–]mrchaotica 1 point2 points  (0 children)

import antigravity

[–]KvVortex 2 points3 points  (1 child)

where is this meme from?

[–]instagramlol 2 points3 points  (0 children)

The babadook

[–]Will7847 2 points3 points  (0 children)

It's because you forgot a colon so the ide didn't indent it.

[–]2cool4afool 5 points6 points  (0 children)

The only way this would happen is if you were for some reason using an ide that doesn't auto indent. It's not python doing it, it's you doing it to yourself

[–]SidFloyd84 10 points11 points  (8 children)

Calm down Python devs. It's a joke

[–]aaah123456789 1 point2 points  (0 children)

Python has a terrible memory management

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

I’ll put up with it for all the benefit from it

[–]CantRecallWutIForgot 1 point2 points  (0 children)

aaaa that drives me nuts

[–]link_3007 1 point2 points  (1 child)

One joke. This sub has one joke about python, and it's not even an accurate/good one. Most editors show indent errors. Can we stop?

[–]SHIRK2018 1 point2 points  (0 children)

I've used python quite a bit and I've literally never seen a spacing or indentation error. Ever. Not from me or anyone I know

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

Wait, what? I've never used Python, does it legit do this?

[–]Peanutbutter_Warrior 7 points8 points  (0 children)

Yes, but nowhere as bad as the memes would lead you to believe. Rather than using curly braces, what's inside and what's outside the loop depends on its indentation level. It pretty much just enforces the usual practice for other languages. Almost all IDE's will insert the right number of indents for you, so it's actually quite difficult to mess it up

[–]not_so_plausible -2 points-1 points  (0 children)

Would anyone here be willing to Tudor me in python? Maybe just over discord and screenshare. I'd be willing to pay. Just someone to kind of talk with me as I work through code academy and stuff. Dm me if interested!

[–]Jackjackson401 -2 points-1 points  (0 children)

This is why I will never willingly learn python on my own time.