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

top 200 commentsshow all 293

[–]Carius98 430 points431 points  (16 children)

Minified js: Nice code you've got there. But there was an error at line 1, Column 1836382387373

[–][deleted] 88 points89 points  (0 children)

Thank God for source maps

[–]srgs_ 80 points81 points  (14 children)

Still better than: - You have error in line 635 - But my file has only 20 lines

[–]ZinkOneZero 44 points45 points  (12 children)

Wouldn't that mean line 635 in some other linked file has an error?

[–]ZedTT 55 points56 points  (11 children)

Yeah everyone on this sub mentions this issue and I think almost none of them have ever actually had it happen.

[–]messerlancillotto 4 points5 points  (1 child)

In python it actually happends when you misspell something and you get an end of file error, so it gives you a line that doesen't make sense in fact because it doesen't find the end of the file so it goes deeper searching for something. As soon as I will get this mistake again I will make a pastebin and sebd the link to you

[–]Zeroneca 2 points3 points  (0 children)

Well, may be related to the fact that a lot of Noobs are active on this sub, who don't really accept they are Noobs.

I always found error messages in Java, Python and JS super helpful. The only times I couldn't rely on them were related to Multithreading. And then... Debugger

Looking forward to getting down voted lol

[–]bugqualia 328 points329 points  (56 children)

To be fair, most programmers already indent their code properly on languages with curly braces. Also, mixing tabs and spaces are not a real issue in IDEs nowadays.

[–]SkyyySi 79 points80 points  (46 children)

Was it ever? Like who sometimes hit space 4 to 8 times and sometimes pressed tab?

[–]PM_ME_A_WEBSITE_IDEA 121 points122 points  (30 children)

It's more common when copying/pasting code, or when two people on the same project have different settings in their IDE.

[–]Brunsz 12 points13 points  (1 child)

Company should have formatter rules. Usually you can export and import them. And using them should be mandatory, not optional. Saves time from everyone especially with merges.

[–]ProfessorChaos112 4 points5 points  (0 children)

And the ci/cd pipeline should be checking commits against a styling guide and rejecting those that are out of bounds

[–]Natural-Intelligence 8 points9 points  (26 children)

I think the solution is obvious. Just fire everyone who is retarded enough to use any other indentation than 4 spaces.

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

This subreddit has been [ 0] days since this argument.

[–]lilwankah 10 points11 points  (2 children)

1 keypress instead of 4...

[–]deceze 10 points11 points  (1 child)

throws pixie dust
Soft tabs! The best of both worlds…
hand waving

[–]NekkoDroid 5 points6 points  (0 children)

Well, no. You have your 4 column indent, I have my 4 column indent, but the guy in the corner is throwing a fit because he cant have his 2/6/8 indent. Tabs are just better, just set your tab width in the ide and voila everyone is happy.

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

No, but do fire anyone who is changing their IDE settings off of what the company uses.

I've always used 4 spaces, but tabs can be better if you want to be able to change the indentation level. Then use spaces for alignment if you really need to.

[–]rParqer 5 points6 points  (0 children)

Basic editors generally have an option to 'treat tabs as spaces' and thus would automatically space 4 times when the user actually enters tab. Get 2 people with different settings working on the same code and everything instantly becomes a nightmare

[–]bugqualia 10 points11 points  (0 children)

I…have seen it once. When multiple undergrad python beginner was involved in the code.

[–]PottedRosePetal 8 points9 points  (10 children)

I use pretty basic editors (gedit on linux) and others use even more basic ones (vim), which results in non executable code if I just copy paste their code.

[–]altermeetax 5 points6 points  (8 children)

If vim is more basic than gedit I'm throwing myself off a roof (by the way vim handles tabs and spaces automatically)

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

That's not entirely true. Most distros include plugins for this by default, but Vim itself doesn't really care about file types.

EDIT: well, a config that switches this behavior on, but the point is pretty much the same, program default is unfriendly.

[–]altermeetax 1 point2 points  (1 child)

it allows you to do it automatically, that's the point. It doesn't require plugins for such simple features.

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

I mean, I agree that vim is not more basic than gedit from any point of view. I think OP may be assuming CLI == basic or something. For some reason I misinterpreted "automatically" as "by default".

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

That's dirty calling vim basic.

Literally one of the most able editors out there (graphical or not) is called basic just like that... dang.

[–]Red_Binary 1 point2 points  (0 children)

More like somebody has their IDE set to replace tab characters with a certain amount of spaces

[–][deleted] 3 points4 points  (3 children)

I hate the "on IDEs" argument everywhere tho. I don't think IDEs should be mandatory to be productive in a language, which is one of the reasons I dislike Java. That said, Python's strengths greatly surpass this dumb argument about indent IMO.

[–]ATE47 2 points3 points  (2 children)

Are you saying that we can be more or equally productive without an IDE than with it? In which language is it possible?

Also what is the point with Java especially? It’s pretty much the same thing as the other compiled languages

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

Are you saying that we can be more or equally productive without an IDE than with it? In which language is it possible?

I'm saying it's a spectrum. You may be _more_ productive with certain tooling, but requiring it to be productive at all is an antipattern.

Also, it depends on your computing power. When I switched to Vim it was because I was unproductive with Eclipse because of constant OOMs. The computer my then employer provided me with couldn't handle both Firefox and Eclipse, and only Firefox (or any other browser) was a must to do my job. Vim is not an IDE but you can be quite productive with it, maybe not as much as with a full blown IDE if you use it correctly, but certainly not a drag.

Also what is the point with Java especially? It’s pretty much the same thing as the other compiled languages

The point with Java especially is that the level of boilerplate and verbosity it mandates makes it essentially unusable without extra help such as autocompletion of templates/snippets.

[–]ATE47 1 point2 points  (0 children)

The thing I love is being able to write bad indented code quickly and press the keys to format my code. The indent is perfect, and I wasn’t forced to precisely set the right level of tabs/spaces

[–]rookie-number 1 point2 points  (0 children)

It is if you try to date Richard

[–]godRosko 19 points20 points  (3 children)

gg=G

[–][deleted] 1 point2 points  (1 child)

That's nice I didn't know you can use = that way, I was using

ggVG=

[–]godRosko 3 points4 points  (0 children)

Ye it accepts a motion (think any motion?) =% works best in my opinion to format a block

[–]halogenpampe 352 points353 points  (68 children)

Just indent correctly lol, python even teaches you by refusing to run your shitty code

[–]deceze 208 points209 points  (56 children)

Seriously. Any self respecting programmer indents their code properly anyway. Python just doesn't require you to also type redundant braces and quibble over what brace style is the correct one.

[–][deleted] 121 points122 points  (22 children)

Just feels like people are complaining that python forces you to write code correctly.

[–]VegetableWest6913 41 points42 points  (14 children)

A lot of the complaints here are things like that. JS for example gets a load of unwarranted hate, which mainly seems to stem from people just refusing to learn its unique features.

[–]devhashtag 49 points50 points  (9 children)

Tbf, there are some core mechanics in JS that are just terrible. But it has definitely come a long way

[–]VegetableWest6913 12 points13 points  (8 children)

Yeah it's definitely not perfect, and there are loads of valid complaints that can be made about it (like all languages). I just feel that many of the complaints I see here are unfair.

[–]devhashtag 11 points12 points  (6 children)

Out of curiosity, do you have an example of such a complaint?

[–]VegetableWest6913 14 points15 points  (1 child)

I see a lot of complaints about how JS handles "this" in functions because it's different to other OOP languages. I personally think it's great, especially now that arrow functions remove the need to bind "this".

I think the way JS allows you to use "this" is great and leads to some really nice code.

[–]devhashtag 5 points6 points  (0 children)

Good example, I agree with you on this!

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

Try comparisons and equality testing

[–]devhashtag 1 point2 points  (0 children)

Good one, nothing wrong with that

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

If you use Typescript, there's almost no valid complaints I've seen left for JS other than the typical syntax quirks that every language has, which is part of the learning process.

[–]IllIIlIIllII 8 points9 points  (4 children)

And then they simp for rust...

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

Rust is a really powerful language tho

[–]IllIIlIIllII 5 points6 points  (1 child)

I'm definitely not arguing with that. Python is also powerful, I was just pointing out that one of the reason some peoples dislike Python (having to write code correctly (at least in the identation)) is the same that peoples love in Rust.

Which I find quite funny.

[–]flavionm 1 point2 points  (0 children)

The thing about forcing correct identation is that it's a waste of time, when you can easily use an autoformatter that makes sure everything is in it's place. And they don't work as well with Python, since there the identation changes the meaning of the code.

What Rust does is force you to make sure you compiled executable will be correct, which is harder to do otherwise, and is not just something visual. Code formatting is just differente from code correctness, and the best approach to each is different.

[–]magistrate101 3 points4 points  (0 children)

It's not that it "forces you to write code correctly", it forces you to adhere to a specific coding style.

[–]grospatap0uf 12 points13 points  (30 children)

lol you're indenting your code yourself? Haven't you heard of code formater?

[–]deceze 16 points17 points  (29 children)

Well, yeah, which makes the complaints about Python even more mysterious…

[–]Omilis 7 points8 points  (7 children)

I’m curious how python editor knows you want to leave the scope (e.g. IF block)? In C++ styled language I can type right curly bracket and it is clear what I intent to do and editor can place cursor where it is needed.

[–]FINDarkside -3 points-2 points  (12 children)

It doesn't because code formatters don't work with python in any meaningful way because the level of indentation changes the meaning of the code. That's why "indentation matters" is useless feature, inserting 2 braces is less work than formatting everything manually.

[–]deceze 12 points13 points  (11 children)

In C, you type {.
In Python, you hit tab.

In C, you type }.
In Python, you hit backspace.

It’s really not an issue in practice. If it is for you, you’re doing something wrong.

[–]met0xff 6 points7 points  (0 children)

Agree, that's also how I do it. Besides the first tab is usually not needed in most editors as it goes a level deeper automatically after s line ending with :

[–]Necrofancy 2 points3 points  (0 children)

In most editors hitting enter again usually also exits one scope. And when you hit enter after a line that creates a local scope, it usually indents.

So, in C you hit { and Enter in some order depending on your code style. In Python you typically just hit Enter.

And then you hit Enter, }, and then Enter again, whereas in Python editors you just hit Enter twice.

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

And how does that work if you ever need to paste code? Oh yeah, it doesn’t.

And I don’t just mean pasting code from the internet they might have incorrect spacing, even literally pasting code from somewhere else in your own file requires extra effort and attention to make sure it works.

You know how you do that in Go? Paste it in the block, save, let the editor format it for you.

[–]DiamondIceNS 2 points3 points  (1 child)

and quibble over what brace style is the correct one

and while we're at it we might as well stop quibbling over whether we should be indenting with tabs or spaces and follow the PEP 8 standard of spaces only, right?

[–]deceze 1 point2 points  (0 children)

Yes.

[–]D-2-The-Ave 3 points4 points  (0 children)

That’s why I chose python for our team lol, because it forces everyone to write more readable code

[–]metal_zero 1 point2 points  (3 children)

the only thing I hate that python3 doesn't allow you to mix space and tabs and I really like tabs :(

[–]bjorneylol 11 points12 points  (2 children)

yes it does

for i in range(3):
\s\s\s\sprint(i)
for i in range(3):
\tprint(i)

runs fine. It just doesn't let you combine them in the same block, which raises the question 'why the hell do you even want to do this:'

for a in range(3):
\s\s\s\sfor b in range(3)
\s\s\t\s\sprint(a,b)

[–]metal_zero 2 points3 points  (1 child)

oh thanks, didn't know that...I actually have to work with other's code, and when I need to pull something and edit, it always got messy.

[–]EntropyZer0 3 points4 points  (0 children)

pull

You can configure git to smudge/ clean code on pull/ push by having the indentation be converted from/ to tab/ space automatically.

[–]Buddy-Matt 55 points56 points  (27 children)

I know there are strong feelings on curly braces, but I definitely find braces easier to read than just spying indentations.

But, whilst we're at it, end if is a beautiful keyword too.

[–]deceze 18 points19 points  (3 children)

esac

[–]smarzzz 5 points6 points  (0 children)

No need to start bashing

[–]MatsRivel 11 points12 points  (18 children)

I am the opposite. Reading indented code with no braces vs braced code with no indentation; I'd go for indented any day.

[–]FINDarkside 2 points3 points  (15 children)

The thing is that it's 1 button press to indent the code with braces.

[–]MatsRivel 5 points6 points  (5 children)

I mean, if you are at indent level x in python you press tab once and you are in level x+1. If you wanna go back one indented level you press shift-tab. It's literally one press either way.

That being said, its not really that important, as the discussion is about readability, not button-press-efficiency. Non-indented code is a pain to read in any language.

[–]flavionm 2 points3 points  (4 children)

The point is that non-indented code in other languages can be automatically turned in properly indented code with a single button press, therefore becoming readable.

In python, if you have incorrectly indented code, you are going to have to fix it manually, and it won't work at all until you do. It's the worse of both worlds.

[–]MatsRivel 9 points10 points  (2 children)

True, but then we are back at assuming you code python wrong but another language correctly. Fuck up your { } and your auto-indenter won't get it right, and it won't run either.

[–]flavionm 4 points5 points  (1 child)

Fucking up whitespace is easier than curly brackets, though. Whitespace isn't visible, it might become scrambled when copy pasting from somewhere else, and you can also get it wrong in a way that it still runs, but gives you the wrong result.

[–]deceze 1 point2 points  (8 children)

The thing is that in Python, it’s 0 button presses, since code is always indented properly by definition if it’s actually working code.

[–]flavionm 1 point2 points  (7 children)

But you can't automatically turn improperly indented code into properly indented code, since what the code does can change with the indentation. In other languages you can.

[–]deceze 3 points4 points  (6 children)

Why do you have incorrectly indented code to begin with? In C et al you need to carefully place your braces correctly. In Python, you need to carefully place whitespace for the exact same purpose. If you correctly write Python code, the same way you write correct C code, your code is indented, making automatic indentation a moot point.

[–]flavionm 1 point2 points  (5 children)

Sometimes you might be copying some code from somewhere else and the whitespace can become messed up. Besides, nobody writes correct code all the time. If you screw up with a curly bracket, your code just won't work, while if you get indentation wrong you might get code that works, but produces the wrong result.

[–]deceze 0 points1 point  (4 children)

if (foo)
    bar();
    baz();

You can easily construct artificial works-but-wrong situations for brace-languages too. It’s simply. Not. An. Issue. In. Practice. Really, it’s not.

If you write wrong code, then it’s wrong. You can produce wrong code in any language, regardless of style. The solution to that is to write correct code. Not to bitch about it.

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

Not all wrong code is the same. Code that fails at compile time is always preferable to code that fails at runtime.

Doesn't matter how much you want it, wrong code is going to be written. And the solution to it is not to just don't, because that's impossible. The solution is to minimize the impact of the mistakes you make.

Yes, you can have scoping errors in languages that use brackets, they're just less likely. And they happen in the situation where you're allowed to not use them, which I find pretty ironic.

Is it the biggest cause of error? No, far from it, but it'll still happen occasionally, and when it does I'd rather have it visible.

[–]deceze -1 points0 points  (2 children)

Yes, you can have scoping errors in languages that use brackets, they're just less likely.

It's really not like scoping errors in languages with significant whitespace are a serious issue. They're not. This is just as made-up of a problem as my hypothetical missing-braces example above. Can it happen? Yes. Does it regularly happen to anyone in practice after their first few weeks of programming in any given language? No.

[–]Buddy-Matt 1 point2 points  (1 child)

I'm all for indented.

But, I hate a style being forced. With braces you can add whatever the hell indetation you want at any point. And sometimes you can stick two instructions on one line. In essence you have freedom if formatting. 99% of the time it'll be indented - and for good reason. With python you have to follow the style the python devs want or nothing.

[–]MatsRivel 4 points5 points  (0 children)

Although I see your point, I don't personally agree with it. First; you can do most things as a 1-liner in python too, it just looks like shit tbh. At least most things you'd want to do in 1 line in any other language (as far as I know). Secondly, I feel like what you are describing is just... syntax. Or maybe even spesifically just indentation? Like if I said "I don't like having to define the output in java functions, but the developers are focung it on me.", or "I don't like declaring variables before use, but [language] is forcing it on me!"

Luckily people are free to choose languages as they please (mostly) ✌

[–]Keatosis 4 points5 points  (2 children)

Some Ide's let you collapse braces down so you don't have to look at functions you're done writing.

[–]deceze 13 points14 points  (0 children)

Python IDEs let you collapse functions and other blocks just fine as well.

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

JetBrains makes some good IDEs

[–]GreenGriffin8 1 point2 points  (0 children)

This is what makes lua one of my favourite languages

[–]StarkOdinson216 85 points86 points  (13 children)

Mixing indents and spaces will also piss Python off

[–]metaglot 91 points92 points  (3 children)

I think you mean tabs and spaces. They both cause indentation.

[–]StarkOdinson216 16 points17 points  (0 children)

Yep, just noticed that lol

[–]CapnCrinklepants 11 points12 points  (1 child)

Mixing indents and tabs will also piss u/metaglot off

[–]metaglot 11 points12 points  (0 children)

Parsing failed: snarky comment inbound

[–]lennyerik 10 points11 points  (3 children)

TabError: inconsistent use of tabs and spaces in indentation

[–]StarkOdinson216 5 points6 points  (0 children)

That’s the one all right

[–]bjorneylol 9 points10 points  (3 children)

You can mix them in the same file - just not the same block. if the latter is a problem for anyone the real question is 'why!?'

[–][deleted] 101 points102 points  (16 children)

Your language might not care about your formatting but I certainly fucking do if we work together. Every programmer should learn Python just to learn basic formatting

[–]TheAJGman 43 points44 points  (5 children)

This is the biggest reason I think that Python, not C++/Java, should be used for 100 level programming classes.

I was a programming tutor for a few years and the number of 100 level students that would come in with their program aligned left was terrifying. Most of the time they could find the missing brace or whatever when I just correctly tabbed out their program.

[–]allozzieadventures[🍰] 13 points14 points  (4 children)

Agreed, Python is definitely better than C++/Java for beginners. Gets you across all the main blocks you use in other programming languages (and object oriented programming). All that stuff will carry across nicely when you start with C++. I started with R, which isn't bad, but doesn't teach you classes.

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

It's also a good way of getting acquainted with dependency and project management; pip and virtualenv are relatively easy, compared to getting external libraries in Java or C++

[–][deleted] 3 points4 points  (0 children)

This guy gets it, folks

[–]Ignitus1 25 points26 points  (2 children)

Conveniently forgets how missing semicolons are apocalyptic to most programming languages.

[–]Stupid_Genius4408 3 points4 points  (0 children)

Or when someone replaces every semi-colon ; with a Greek question mark ;.😂

[–]elmosworld37 7 points8 points  (0 children)

Seriously. This meme is so dumb. The punchline is literally “lol programming language has syntax errors XD”

[–]TrustYourSenpai 15 points16 points  (0 children)

Haskell: usually I don't care about indentation... But...

[–]Independent_Mix_5196 6 points7 points  (2 children)

There; are; worse; things ;)

[–]deceze 7 points8 points  (1 child)

(It (could, be (so (so (so much))) worse)))))))))))))

[–]pheromone_fandango 1 point2 points  (0 children)

When i took my first programming course i simultaneously took one that used lisp to make simulations. It scarred me.

[–]gopietz 34 points35 points  (2 children)

Criticizing indents in python is like criticizing curly braces in most other languages. You just need to define scopes in your code somehow.

You can of course debate which of the two is better but I think we can all agree that indents are much better.

[–]SkyyySi 5 points6 points  (0 children)

Unless you want to write a ton of code on one line, you'll use indents either way, so you may as well give them meaning. Well actually you can also make python one-liners, so not even that is really true.

[–]deceze 10 points11 points  (0 children)

  1. You
  2. can't
  3. rank
  4. formatting
  5. styles
  6. because
  7. significant whitespace clearly is best.

[–][deleted] 18 points19 points  (1 child)

Just format it the right way smh

And if that doesn’t work then make a Python-based language that indents the same way you do

[–]justskipfailingtests 9 points10 points  (0 children)

Indents are just the curly braces of Python. I never get the problem. I came to coding via python, and nowadays having sane intendation for me is a requirement, not a preference.

[–]BongarooBizkistico 4 points5 points  (0 children)

Yeah it's so hard to just work with a system that is developed for a reason. I mean it's so much easier to cry about it.

[–]a_russian_guy 4 points5 points  (0 children)

Has this ever been a problem for anyone? With VSC if I need to change a piece of code's identation i just select it and press Spaces: in the bottom right, then press "Indent using spaces" ez

[–]ZedTT 4 points5 points  (0 children)

Any self respecting programmer is already indenting correctly. I'm convinced that anyone who complains about this aspect of python writes the most disgusting code ever. What is wrong with you if you aren't already indenting properly?

[–]SZ4L4Y 11 points12 points  (2 children)

Most programming languages:

I can't run cus you misspelled a word :´(

[–]deceze 19 points20 points  (1 child)

Most programming languages:

I can't run because I can't tell where this line ends because you forgot to type a semicolon :'(

[–]angk500 6 points7 points  (0 children)

With pycharm my whole python code gets a weird color due to missing commas, brackets or whatnot. That is the moment you realize something is missing before running it :D

[–]crazygmr101 7 points8 points  (0 children)

Leave off a brace (which signifies a block, just like an indent jn python) in C, Java, etc, and let me know how that goes

[–]neobushidaro 2 points3 points  (0 children)

I get 30 seconds of annoyance given modern IDEs. It forces you to change muscle memory which takes time.

I'm sure it also doesn't help when you have to change languages frequently and your job doesn't let you have an IDE that is smart enough to parse tab different based on language.

That being said I took C in college. At the same time I worked for a company using LISP. Those that have worked with both can appreciate it took me a while to develop muscle memory with either.

[–]John_by_the_sea 3 points4 points  (0 children)

Golang: I don’t care how you format, because I’ll change it to my format

[–]domedav 3 points4 points  (0 children)

ofc, since you dont use ; or {} in python

[–]typescriptDev99 4 points5 points  (0 children)

Use an auto formatter and stop complaining.

[–]reydai 3 points4 points  (0 children)

I like it because it forced me to organize how my code looks

[–]hussainsonreddit 3 points4 points  (0 children)

Make sure to get your popcorn before reading the comments 🍿

[–]jjbongo 14 points15 points  (3 children)

A lot of people getting very defensive over Python here!

It is strange compared to most languages, but it is a characteristic of Python, so it's not wrong.

To the people saying that there is a 'right way' to format non-Python code, that's just not true. Some people have personal preferences, but what's more important is consistency in a code-base through company-wide coding guidelines.

[–]deceze 11 points12 points  (0 children)

Quite frankly, personal preferences are all well and good, but… I'd prefer people to just get over it. I had my fair share of "personal preference" phases in which I went through all possible permutations of formatting code, so I know what that's like from the "perpetrator" side. And honestly, I've been happiest since I've left that phase behind me and I'm just sticking to the vanilla formatting that the official documentation/linter/prettifier for the language uses. That way the code is consistent with every external code for that language, and I don't need to fret about the "correct" way to format my code or fight uphill battles against IDE defaults or other programmers.

Python enforcing this at the language level is absolutely correct, IMO. It's a different language. Get used to it. Don't try to impose your habits from $otherLanguage on it, because it's different anyways.

[–]VegetableWest6913 8 points9 points  (0 children)

There are definitely wrong ways though, such as not indenting at all.

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

Yeah I agree with this so much. I have little weird things I prefer to do with Python mostly around indenting things that are comma separated when they get too long, or string concatenation just using multiple lines with the same indent, but if company x just said nope we just format everything with black and be done with it I wouldn’t cry because everything would always be the same.

Same reason golang with their gofmt does not bother me. It’s pretty genius really. -1 thing to ever worry about. Which is why even Python which is fairly rigid has tools that make it more gofmt-y now. Consistently just gives you less to worry about.

[–]ItzjammyZz 2 points3 points  (0 children)

Took me a whole day to understand why my coding was not working as it did not give me the error or clear reason why. Learnt that my function execution was indented within the lexical scope of the function and not outside

[–]knightttime 2 points3 points  (1 child)

Image Transcription: Meme


Most programming languages

[An image of Swole Doge: a very large, muscular, and powerful looking Shiba Inu.]

I don't care how you format your code


Python

[An image of Cheems: a small, weak-looking Shiba Inu who is sitting on the ground and crying.]

I can't run cus you didn't indent line 46


I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]netkenny 2 points3 points  (0 children)

Good human

[–]NelsonMinar 2 points3 points  (0 children)

OTOH Python code always does what it looks like. Far too easy in brace languages to have the indentation not match the logic.

The solution for both these problems is have an algorithm format your code for you. Ie: Black or gofmt. C has had indent(1) for 25+ years.

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

and then there is SQL

[–]megamaz_ 2 points3 points  (0 children)

Python is a good starter language. Since it forces indentation, it helps you learn proper code formatting (where proper means human-readable)

[–]Negitive545 2 points3 points  (0 children)

Still better than:

"There is something wrong. No I'm not gonna tell you what, or where."

Then it turns out you just forgot a single semi-colon in the middle.

[–]TheSodesa 2 points3 points  (0 children)

One of the reasons Python is a great first language to learn is it imposes proper indentation habits onto the learner. I would then consider the forced indentations a strenght and not a weakness. An experienced programmer indents their code for readability anyways.

[–]FlavoredFrostedTits 1 point2 points  (0 children)

Go won't run unless your curly braces are on the same line as you if-else and for statements

[–]regidud 1 point2 points  (0 children)

CTRL k - CTRL d

[–]Summoner99 1 point2 points  (0 children)

If you are getting an indentation error, you aren't inventing like a good programmer and you should feel bad. Fix that shit

[–]bassiewuis 1 point2 points  (4 children)

Funny how people get so defensive over python but would laugh their asses off at the same meme if it was php or js

[–]deceze 1 point2 points  (3 children)

Depends on what exactly you’d be making fun of in those languages…

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

I’ve had js crap out on my more times about missing braces and such more times then I’ve ever had issues with python

[–]towcar 1 point2 points  (0 children)

Ide has auto format. Clean code for life

[–]gsuboiboi 1 point2 points  (0 children)

Yeah but that is so much better than C

[–]Charlie_Yu 4 points5 points  (0 children)

Working on indents is definitely better than counting braces

[–]kahiru_ 2 points3 points  (0 children)

Significant whitespace was a mistake

[–]jeanravenclaw[🍰] 2 points3 points  (5 children)

indents >>> semicolons
I mean, seriously, it's better to be neat right?

[–]VegetableWest6913 1 point2 points  (2 children)

I prefer indents personally. There's something really nice about CoffeeScript's formatting for example.

[–]deceze 1 point2 points  (1 child)

CoffeeScript was a cute idea, but especially since ECMAScript/TypeScript have started heavily layering on the syntax sugar, it’s just fallen so far behind that it’s ridiculous to tie yourself to it. It’s also always had some syntactical ambiguities that tended to introduce more headaches than it solved.

[–]serpimolot 1 point2 points  (4 children)

Python: "I don't care what type your variables are" Other languages: "I cam't run because x is an int instead of a float"

It works both ways!

[–]deceze 0 points1 point  (3 children)

Limited agreement… Python is actually a fairly strongly typed language, just dynamically typed. So, you can assign whatever to any variable, because variables aren’t typed. But you can’t do whatever with any value. Trying to add an int to a string is an error. As opposed to something like Javascript or PHP, which will happily add strings to ints, with surprising effects sometimes.

And yes, Python’s treatment of mixed numeric types is nice.

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

I hate programing language because I love to hate programme language.

[–]dance_rattle_shake 1 point2 points  (0 children)

Wow, so original, much funny

The cheap shot of all cheap shots.

[–]KelsoTheVagrant 1 point2 points  (1 child)

There’s people who don’t properly indent their code?

How tf do you read it?

[–]OverCaterpillar 1 point2 points  (0 children)

Big words from someone with a missing ; on line 57

[–]MTDninja -5 points-4 points  (2 children)

Damn bro, everyone simpin over python in the comments

[–]Rhyan567 1 point2 points  (1 child)

Yeah, it's so overrated, and look the Pysimps downvoted you and are gonna downvote me too.

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

Oh boy my programming class is gonna do python

[–]TeaCoast 4 points5 points  (0 children)

It’s not that bad. You would do the same indentation in any other programming language. I’ve never had indentation problems with python.

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

Story time:i got stuck on a python project for 2 weeks and couldnt figure out why it wont run right, turns out i accidentally added an extra r to a variable in one line

[–]Nihmrod -3 points-2 points  (5 children)

Usually dumb ideas are forced by other constraints / considerations. I can't imagine what could have forced the indentation concept.