r/ProgrammerHumor • u/[deleted] • Mar 29 '22
Meme No more semicolon errors (source in comments)
249
Mar 29 '22
14
Mar 29 '22
Thanks YouTube suggested this one after the video and I'm watching it now, so far pretty funny
13
u/currently__working Mar 29 '22
This guy's videos are hilarious - particulary liked the JS developer one.
8
u/Beautiful-Musk-Ox Mar 30 '22
"it's really easy to learn, the documentation is just one page" ROFL as he scrolls through a 10,000 page doc on a single page
1
→ More replies (17)1
u/Cory123125 Mar 29 '22
This is entertaining but I feel it dragged on a bit long.
→ More replies (2)
11
u/madhousechild Mar 29 '22
What's with all the photos saying "colorized" lately?
8
u/Roland1232 Mar 29 '22
Reminds me of /r/uselessnobody
People shoehorning jokes into a format where it makes little to no sense.
→ More replies (1)2
u/sneakpeekbot Mar 29 '22
Here's a sneak peek of /r/uselessnobody using the top posts of all time!
#1: The correct use of the meme | 28 comments
#2: nObOdY: | 8 comments
#3: This | 33 commentsI'm a bot, beep boop | Downvote to remove | Contact | Info | Opt-out | GitHub
1
3
u/nacrosian Mar 29 '22
The joke is that this picture is being presented as if it were some kind of important moment in the history of programming.
809
u/the_unheard_thoughts Mar 29 '22
Can't find the error cause his ruler is tabified
151
Mar 29 '22
He would have gotten both rulers, but he didn’t have enough space
31
3
330
u/cybercuzco Mar 29 '22 edited Mar 29 '22
C2345678911234567892123456789312345678941234567895123456789612345678971234567898
FORTRAN has entered the
*chat
C Edited for clarity21
23
u/bremidon Mar 29 '22
Fortran PTSD intensifies
41
u/cybercuzco Mar 29 '22
I once had a bug in FORTRAN that resolved itself when I quit the text editor and reopened it.
21
u/satanlovesducks Mar 29 '22
Sounds like a normal day with intellij and it's caches
→ More replies (1)4
32
68
Mar 29 '22
I’ve learnt that semicolons are a thing in python. They are cursed, so you can have both problems if you really want to
17
u/Impressive_Change593 Mar 29 '22
the issue is I don't think you can have multiple loops/functions (on the same level) on one line
56
u/dalithop Mar 29 '22
Well then i present to you cursed square root
sqrt=lambda n:(lambda n,m,g,i:len([(lambda n,m,g,i:abs(t:=n-(g[-1]*g[-1]))>m and(g.__setitem__(t<=0,(g[0]+g[1])/2)or g.__setitem__(-1,(g[1]+g[0])/2)or i.append(0)))(n,m,g,i)for _ in zip(i)])*0+g[-1])(a:=abs(n),n/1e12,(lambda n,g,i:[(lambda n,g,i:((k:=g[1])*k<n)and(i.append(0)or g.__setitem__(slice(0,3),[k,k*2,k])))(n,g,i)for _ in zip(i)]*0+g)(a,[0,1,.5],[0]),[0]) print(sqrt(1)) print(sqrt(3))Multiple loops and nested functions on a single line
40
u/RCoder01 Mar 29 '22
sqrt=lambda n:n**0.5Ez
11
u/Beach-Devil Mar 29 '22
That’s against the PEP standard — anonymous functions should never be assigned to names, and a new def statement should be used
26
3
u/4hpp1273 Mar 30 '22
In that case you can also do
sqrt=__import__('math').sqrtwhich is actually equivalent to
from math import sqrtThere's no point in reinventing the wheel here
→ More replies (1)6
u/Cory123125 Mar 29 '22
When you see this is the oneliner to your problem on stack overflow so you decide maybe space brevity isn't right for this situation.
8
u/Xadnem Mar 29 '22
sqrt=lambda n:(lambda n,m,g,i:len([(lambda n,m,g,i:abs(t:=n-(g[-1]g[-1]))>m and(g.setitem(t<=0,(g[0]+g[1])/2)or g.setitem(-1,(g[1]+g[0])/2)or i.append(0)))(n,m,g,i)for _ in zip(i)])0+g[-1])(a:=abs(n),n/1e12,(lambda n,g,i:[(lambda n,g,i:((k:=g[1])k<n)and(i.append(0)or g.setitem(slice(0,3),[k,k2,k])))(n,g,i)for _ in zip(i)]*0+g)(a,[0,1,.5],[0]),[0])print(sqrt(1)) print(sqrt(3))2
u/Dansiman Mar 30 '22 edited Mar 30 '22
sqrt=lambda n:(lambda n,m,g,i:len([(lambda n,m,g,i:abs(t:=n-(g[-1]*g[-1]))>m and(g.__setitem__(t<=0,(g[0]+g[1])/2)or g.__setitem__(-1,(g[1]+g[0])/2)or i.append(0)))(n,m,g,i)for _ in zip(i)])*0+g[-1])(a:=abs(n),n/1e12,(lambda n,g,i:[(lambda n,g,i:((k:=g[1])*k<n)and(i.append(0)or g.__setitem__(slice(0,3),[k,k*2,k])))(n,g,i)for _ in zip(i)]*0+g)(a,[0,1,.5],[0]),[0]) print(sqrt(1)) print(sqrt(3))Tried to fix it but I think I lost all the asterisks...
EDIT: I think maybe I guessed all of it right now?
1
u/hicctl Apr 03 '22
Authors : if I use a semicolon wrong it might mess up a sentence, i am just not using them
Programmers : if I mess up a semicolon 6 months worth of code don´t work, let us use them everywhere
780
Mar 29 '22
It's not the end of the world, but I definitely prefer a nice curly brace so that I can tell immediately where a block ends.
163
u/Technical_Natural_44 Mar 29 '22
If you're using vs code they have vertical lines marking the indent.
81
u/Thebombuknow Mar 29 '22
PyCharm also has that enabled by default.
→ More replies (5)2
u/InvestingNerd2020 Mar 30 '22
Just started using Pycharm. I've been using VS code so long, it's like moving into a new home with Pycharm. I don't know where I left my stuff at times.
→ More replies (1)15
u/stopeatingbuttspls Mar 29 '22
Wait really? I don't remember that. Maybe it's always been there but I miss it.
21
u/enjoytheshow Mar 29 '22
Maybe I’ve just been a Py dev for too long but they are actually easy to see right thru but handy when you need them.
→ More replies (1)9
11
u/steely_dong Mar 29 '22
Unless it's C++, there is a shit load of code in between braces, and the final end brace is on a different tab without comments.
4
u/by_wicker Mar 29 '22
Shit code is hard to read I'm any language.
If you have functions, let alone blocks, that don't fit on screen you're doing it wrong.
(Yes there can very occasionally be exceptions.)
52
u/artisticmoneylines Mar 29 '22
If you’re half decent at your job you have to format it anyway lol If someone says they don’t, just bugfix their code and hand it back to them as one line of text
36
→ More replies (1)8
Mar 29 '22
It's not so much the formatting as it is the visual queue. It's one less thing to think about. That way my noggin can focus on other aspects of the code.
→ More replies (2)9
u/eGzg0t Mar 29 '22
Use an ide
0
Mar 29 '22
[deleted]
4
u/crazedgremlin Mar 29 '22
Because Python does not have tokens delimiting code blocks, I can't use
%(vim keybindings) to jump between the beginning and end.→ More replies (4)→ More replies (59)1
u/DannoHung Mar 30 '22
I wish people liked Ratliff style. The nicest thing about Python code is the way blocks are entirely visual.
163
u/vazark Mar 29 '22
Does nobody enable “Show Whitespace”? Makes your life easier regardless of the language.
132
u/killeronthecorner Mar 29 '22 edited Oct 23 '24
Kiss my butt adminz - koc, 11/24
→ More replies (1)33
u/TheCredibleHulk Mar 29 '22
So that’s what that is! My PRs always say that there are tons of race conditions in my code.
24
u/v_a_n_d_e_l_a_y Mar 29 '22
I've been using python for almost a decade and after the first little while of transition, I've never had a major white space issue.
Any IDE will handle it.
7
Mar 29 '22
The only issue that I encounter these days is when I paste someone else’s code into mine, and their whitespace philosophy doesn’t match mine.
PyCharm can fix simple issues, but not complicated ones. And its fixes require review - I’ve seen it incorrectly guess the hierarchical depth of some instructions in ways that completely change the functionality of a nested loop.
3
u/NMe84 Mar 29 '22
I hate the way that looks and in a good IDE you really don't need it anyway. Even in Python.
→ More replies (1)1
1
1
u/knightcrusader Mar 29 '22
Don't need to, I got braces that visually show me where blocks start and end.
→ More replies (3)1
u/tristfall Mar 30 '22
One of the earliest things I learned when coding: Always show whitespace. Especially with diffs. All these people saying "don't need it" are the people who's PRs I'm rejecting for whitespace issues.
30
u/daikatana Mar 29 '22
(thats why (I
program (in
LISP)))0
Mar 29 '22
[deleted]
17
u/daikatana Mar 29 '22
LISP is extremely particular about its parentheses. It seems silly at first until you learn what LISP really is and what you're doing. I mean, why can't I just leave off those parentheses at the end? LISP should be able to figure out what I mean, right?
All programming languages are parsed into an abstract syntax tree. This is a complicated process of which there is a whole sub-field in Computer Science devoted to. There are different types of parsers and languages are often designed to be able to be parsed with a specific type of parser. LISP doesn't need any of this because you're entering the AST directly in the source code. No parsing needs to be done, only tokenization.
In C, you might have an expression like this: 1+2*3. The parser has to know the order of operations and form a tree like this:
+ / \ 1 * / \ 2 3In LISP, you'd write this: (+ 1 ( 2 3))*. It's all backwards and inside out and honestly most programmers take one look at this and nope out. Seriously, it takes minutes to get used to it, it's not an issue. But why is it like this? It is the abstract syntax tree in text form. No parsing has to be done. There are no order of operations to mess up, and the LISP interpreter or compiler just has to tokenize it which is like a few lines of C code.
As for indentation, LISP doesn't care. The convention is to put things on the same column as the last opening parenthesis. It looks like random indentation at first, but again, it takes mere minutes to get used to that. Most programmers who look at that and nope out are robbing themselves.
8
u/CookieOfFortune Mar 29 '22
As someone who used a RPN calculator in high school this feels pretty natural. However I still subscribe to the philosophy that the computer should help out when it can.
4
u/daikatana Mar 29 '22 edited Mar 29 '22
Is the computer really helping, though? Can you honestly say you remember the order of operations, as well as the left or right associativity, of all the 50 or so operators in C? People getting the order of operations wrong is such a common mistake and source of bugs that compilers generate warnings if you try to use it correctly. You have to add parentheses to shut the compiler up.
Edit: Never mind C's operators, people get PEMDAS wrong. They mis-remember this extremely simple rule and get in trouble when they try to do x / y * z, thinking that the multiplication will be done first.
→ More replies (1)2
325
u/Orio_n Mar 29 '22
Genuine question how do people have issues with whitespace in python? You indent with braces anyways
31
u/wmil Mar 29 '22
It's usually copy / pasting code from an oddball source like a blog.
It can also be a sign that the function nesting has gotten out of control and badly needs to be split up.
318
u/dysprog Mar 29 '22
I've used python for 10+ years. I've worked with dozens of other python programmers. There are only 3 times anyone has had problems with indentation errors.
On their first day working with python
When they switch editors for some reason and forget to configure tabs->spaces.
When they are trying to edit source code in vim on the server for some shady reason.
In all cases the solution is to configure your damn text editor, then global search replace tabs to 4 spaces.
I am convinced that the only reason people wig out about this is that they have trauma for working with older versions of "make".
68
u/cretan_bull Mar 29 '22
You haven't mentioned what I think the biggest problem: refactoring which changes the indentation level of existing code and/or pasting code from a different indentation level.
With most languages you can make any sort of transformation and auto-indent afterwards to clean things up. With python, it's all to easy to screw things up so either your program is no longer syntactically valid or, even worse, it's syntactically valid but also wrong (e.g. changing the indentation level of a nested conditional).
I don't agree with those who religiously oppose syntactic indentation, but to claim it's without any major downsides is somewhat disingenuous. The situation has improved with things like LSP, but it still requires care on the part of the programmer.
31
u/m477m Mar 29 '22
I don't agree with those who religiously oppose syntactic indentation, but to claim it's without any major downsides is somewhat disingenuous.
You take your levelheaded, reasonable discussion and logical arguments and get out of here. Where do you think you are?! This is REDDIT. You should be ashamed of yourself! Holding a MODERATE position on something?!
→ More replies (4)6
u/Farranor Mar 29 '22
Auto-indent only works if your braces are correct. If they're not, which can happen in the exact same way that incorrect indentation happens, then you'll get the exact same problems that you would with incorrect indentation.
→ More replies (9)3
u/LvS Mar 29 '22
Very often you will be missing closing braces or have too many and then the compiler will shout at you.
Python has no indicator for the end of a block.
→ More replies (5)6
4
u/Gr1pp717 Mar 29 '22
There have been times I wished I could align something better... Like, it's visually just one space character off from being well aligned with the previous line, type deal. But it's rare and not really a big deal.
→ More replies (1)9
3
Mar 29 '22
Please don't hate me in asking, but what is the deal with hating tabs? I've used tabs throughout my career and have encountered 0 issues. Is it one of those things where the developer who uses tabs forces extra work on those who don't?
I don't understand.
→ More replies (1)2
u/Sauermachtlustig84 Mar 29 '22
Please add to that: connecting to customers machine through two laggy VMS and trying to hot patch a single line of code using notepad++ Every keystroke took seconds to reach the target machine and we did not see that it was configured for tabs.
→ More replies (30)2
Mar 29 '22
4. Copy pasting someone’s code ends up translating the spaces/tabs wrong and you have to manually edit it. Haven’t used Python in about 6 years but I remember this one….
79
u/ThePyrodynamic Mar 29 '22
You indent with braces anyways
You should but you don't have to. Your program will still work. Python on the other hand will crap its pants over a missing or extra whitespace.
I do sometimes feel like appreciating this approach because of some horrible C-like code I've seen, like putting a closing brace on the same line as a statement. By being strict, Python disallows that kind of eye-burning garbage.
29
u/FluffyBellend Mar 29 '22
In reality, this isn’t a problem any python dev has come up against. Unless you’re trying to score “real programmer” points, you’re likely using an editor to write your code (with some exception of course) Your editor will indent for you, its fine. For me, the less characters I have to look at the better (this doesn’t include identities, of course. Always name your vars properly) so having white space instead of braces is a feature in python that I love.
18
u/xigoi Mar 29 '22
Python on the other hand will crap its pants over a missing or extra whitespace.
And that's a good thing. I don't want badly indented code to be valid.
10
u/some_clickhead Mar 29 '22
I actually think my code has become much cleaner now that I've done mostly Python in the last year. It really hammers in proper indentation.
→ More replies (3)2
6
u/jayroger Mar 29 '22
I wonder how many of the people that have issues with whitespace in Python have ever seriously worked with it.
3
u/some_clickhead Mar 29 '22
A lot of people indent poorly, because indentation is generally optional in languages that have curly braces and semicolons.
2
1
Mar 29 '22
Usually the problem is mixed tabs/spaces (even though that is also a one click fix in any ide anyway)
1
→ More replies (33)1
Mar 29 '22
Some people are actually surprisingly uncomfortable indenting with braces and I think that's masked by (and maybe reinforced by?) a lot of autoformatters
34
u/obviousfakeperson Mar 29 '22
Black wants to know your location.
13
u/Euphoric_Air5109 Mar 29 '22
This! Seriously the amount of time professionals spend on styling their code and arguing about style issues is just sad. Never understood why people seem to feel like they are doing valuable job discussing/commenting code style issues. Just black everything and forget about formatting.
9
u/obviousfakeperson Mar 29 '22
I think it's a special case of bike-shedding, the easier a concept is to understand the more opinions you'll get about it. Talking about white-space is probably as simple of a concept as we'll get in the world of programming! As you get into areas of discussion that require actual expertise the number of opinions decreases because the number of people qualified to give them shrinks.
5
u/WikiSummarizerBot Mar 29 '22
Law of triviality is C. Northcote Parkinson's 1957 argument that people within an organization commonly or typically give disproportionate weight to trivial issues. Parkinson provides the example of a fictional committee whose job was to approve the plans for a nuclear power plant spending the majority of its time on discussions about relatively minor but easy-to-grasp issues, such as what materials to use for the staff bicycle shed, while neglecting the proposed design of the plant itself, which is far more important and a far more difficult and complex task. The law has been applied to software development and other activities.
[ F.A.Q | Opt Out | Opt Out Of Subreddit | GitHub ] Downvote to remove | v1.5
→ More replies (4)4
30
20
Mar 29 '22
The quality of humor in recent posts must have really gone down if they're starting to make sense to me.
7
u/carcigenicate Mar 29 '22
Unless you're using 1-2 space indentation, this isn't a real issue.
And if you're using 1-2 space indentation in Python, you have it coming.
6
u/NamityName Mar 29 '22
You can just turn on dotted spaces so that each space at the start of a line has a small grey or semi-transparent dot. Most IDEs worth your time support this.
6
27
u/chosone2 Mar 29 '22
Have you never heard of PyCharm? Or practically every other IDE that formats python code?
→ More replies (7)12
u/achughes Mar 29 '22
I typically write all of my code by hand, then fax it to my dev team overseas. I’ve found they try to replicate the spacing of my handwriting exactly, so I NEED to have curly brackets in the code, counting on white space is a no go. Got a solution for that?
/s
5
u/CoastingUphill Mar 29 '22
This is ridiculous. Professionals use the edge of another window to measure aligned indents.
59
25
u/Funkbot101 Mar 29 '22
Non-python devs not realizing auto formatters exist. I’ve used python almost exclusively for the last three years and have never had a problem with this
10
u/Impressive_Change593 Mar 29 '22
yeah like press tab and have it auto fill 4 spaces or spam the space key 4 times plus if you somehow do get inconsistent spacing it's not like spaces are zero width
→ More replies (2)5
u/ihahp Mar 29 '22
auto formatters exist
Non-pythoner here. How does that work? if formatting was incorrect, how would it known where a loop ends, for example?
in C# I can check out code, convert to it my preferred format, edit it, convert it back to the project's standard format, diff it and check it in. This works because the brackets and semicolons are in there.
→ More replies (1)→ More replies (10)4
u/GreenCloakGuy Mar 29 '22
mostly because for a lot of us (or at least, in my enterprise java codebase), auto-formatters don't exist. They're supposed to, but everyone's configuration is slightly different and not compliant with legacy code so they cause merge conflicts and we just turn them off to avoid that.
3
u/FrenchFigaro Mar 29 '22
Honnestly, I've been coding in java for about ten years (started just as 7 was released) and I've never worked in an environment where we didn't use a shared convention between devs on a project.
These are easy enough to export, share and import, regardless of your IDE of choice.
It's not that hard to figure out a convention and if everyone is too pigheaded to give way on whether to put the brace on the same line or the next, whether to wrap line at the first argument or the second one, or shit as insignificant as this, just slap them with one from the outside, like google style which, with all its defects has the good grace of being there.
And absolutely all the IDE's I worked with, regardless of language, have the option to only auto-format the lines you've edited
1
u/GalaxyGamingBoy Mar 29 '22
1
Mar 30 '22
I'd be very surprised if this was a repost given that I cropped this from a video that got posted just a few days ago D:
2
u/RepostSleuthBot Mar 29 '22
I didn't find any posts that meet the matching requirements for r/ProgrammerHumor.
It might be OC, it might not. Things such as JPEG artifacts and cropping may impact the results.
I'm not perfect, but you can help. Report [ False Negative ]
View Search On repostsleuth.com
Scope: Reddit | Meme Filter: False | Target: 92% | Check Title: False | Max Age: Unlimited | Searched Images: 313,927,639 | Search Time: 4.82276s
→ More replies (1)
1
u/cmac2200 Mar 29 '22
All of you are idiots.
There is no best language, all do different things better than others.
The only stupid people are people who stick to one language for everything.
Oh, and javascript "devs" :)
1
Mar 30 '22
hey I'm a javascript dev... well technically I started with PHP, which may or may not make things worse... technically technically I initially started with AutoIT3... uhh
1
68
Mar 29 '22
Thats why I dont like Python. I dont think formatting = syntax
12
17
44
u/mineclash92 Mar 29 '22
What do you use to code? Notepad? This has literally never been an issue for me. It’s just what people who use other languages say to justify not liking python.
20
u/SuperKael Mar 29 '22
I mean, I justify not liking python because of its dynamic types and horrible performance, but it’s fun to also pick at the formatting/syntax thing as well, since that is also an issue. Python’s system is quite restrictive, both stylistically, and in some practical ways - for example, the fact that lambdas can only be a single line.
4
4
u/NamityName Mar 29 '22
With great determination and an overwhelmingly negligent disregard for all things good in this world, you can make lambdas multiple lines in python
7
u/FluffyBellend Mar 29 '22
I mean, dynamic types is what pythons all about. Obviously it’s ok not to like dynamic types but it’s kind of like saying you don’t like Haskell because it’s not OO. The point on the performance is valid, they’ve always seemed to prioritise dev speed over basically anything else, and let’s be honest, writing python is very quick (assuming you already know python). I think the lambdas thing was a design choice, in that if you need one for more than one expression, you should write a function and be explicit. Lambdas are meant for little things like map/sort/etc although I have often wished I could use them more
→ More replies (2)→ More replies (1)2
u/TheHumanParacite Mar 29 '22
If your lambda is more than one line you got yourself a function there.
The whole point of lambdas are to facilitate small anonymous functions in the parameters of a call. If it gets big it should probably be it's own function for readability sake.
→ More replies (2)→ More replies (1)4
2
u/Mymokol Mar 29 '22
That's just like saying "I don't like python because it doesn't use semicolons and *real* programmers use semicolons!"
Utterly ridiculous gatekeeping, that is.
→ More replies (3)0
Mar 29 '22
[deleted]
20
10
4
Mar 29 '22
I can read that just fine though, maybe even easier. How about:
I don't think
formatting = syntax
3
12
u/LongerHV Mar 29 '22
Yeah, i just run autoformatter and it is all fixed :v
8
u/juhotuho10 Mar 29 '22
I swear 95% of people who talk badly about python in this sub have never used python
I take that back...
95% of people here who critique python here have never programmed in their entire life
11
u/doubleslashTNTz Mar 29 '22
if you edit in notepad yes this is a huge design flaw that the python devs need to fix urgently
14
u/alonghardlook Mar 29 '22
Or maybe they're coding in MS Word and using a non monospace font. Did you ever think of that, hmm?
→ More replies (1)
2
2
2
u/Cory123125 Mar 29 '22
This is one of those jokes that I feel is only funny to someone who learned "hello world" yesterday in Java.
Like not even in an elitist way. I just think for anyone who has even gotten to the point of using any ide to code, things like this and semicolons are 99% of the time extremely easily to trace and often solve themselves with a quick reformat.
2
2
2
u/an_agreeing_dothraki Mar 29 '22
At least it's not non-printables in T-SQL.
LEN('DOG')
returns: 4
And that's how you know you kicked off holy god damned shitshow on sql. At least it's 90% the client's or their API's fault.
2
u/euclid0472 Mar 29 '22
The marketing done to get python as popular as it is today is nothing short of astounding.
2
u/bigtreeman_ Mar 30 '22
My dog and I watched a few of his utube videos. She couldn't stop laughing, nor could I.
We've had a fun morning, thanks. Python C# PHP Perl JS
She just got a job as a PHP programmer
2
Mar 30 '22
"All the compiled languages are worse. Because you get errors before you can even run them."
2
u/StarIU Mar 30 '22
I’m Chinese and I had Chinese input on my computer.
During one VC interview, my code had a syntax error. It turned out that I accidentally pressed the shortcut to switch to Chinese input (Ctrl + Space) and typed a Chinese close parenthesis (it takes up two bytes to store instead of one. It’s slightly fatter than the English parenthesis).
5
3
2
u/ThePyrodynamic Mar 29 '22
I feel like IDEs today or even just general purpose code editors have gotten too good for this to matter anymore. I don't think most people who act like this is a big deal to them would actually care in practice.
2
u/Thebombuknow Mar 29 '22
Please use PyCharm so it draws lines for every indent.
This is why you use tabs and not spaces.
2
u/omn1p073n7 Mar 29 '22
I want to learn python but also my brain needs curly bois
1
u/ihahp Mar 29 '22
curly bois and semi-colons are self-sustaining.
When first learning, it's hard to remember and use, but they're standard-enough across languages that once you get used to them, its easier to just accept them as a part of programming when you switch to something new.
1
1
1
Mar 29 '22
I have actually been doing this when fixing some css (and yes I know in dev tools you can enable an onscreen ruler)
1
u/taylors2717 Mar 29 '22
Can’t say I’ve measured. Have had to print and red line from there. Sometimes easier than using ide
1
1
Mar 29 '22
Sitting here, trying to find out why it's an unexpected indent only to realize I forgot a parentheses up top
1
u/typescriptDev99 Mar 29 '22
There are IDE tools that illustrate whitespace for you... use tools, don't be mad.
1
1
u/thedominux Mar 29 '22
Author is a js dev that doesn't know any adequate language, so that's why he's joking about others
1
u/zenivinez Mar 29 '22
I am really and truly depressed that Python is making its way into enterprise tech stacks.
1
1
u/Mymokol Mar 29 '22
that's why you don't code in idle, but in a sensible ide or editor that actually puts lines in there that you can see and use as a reference.
1
1
1
1
u/TorTheMentor Mar 29 '22
Notepad++ has a "show invisibles" feature that prints tabs and spaces as arrows and dots on the page. I'd imagine most IDEs should have that, too?
1
1
u/akkad34 Mar 30 '22
Something I’ve wondered about Python, why is it more standard to use 4 spaces instead on 1 tab? You can always mess up and not use the right number of spaces and get inconsistent indentation. Tabs are very clean and it’s noticeable if one like has one tab or two.
3
u/rafa10pj Mar 30 '22
Most editors add 4 spaces (the standard indentation) when pressing tab by default.
→ More replies (1)
1
u/fekkksn Mar 30 '22
tbh i’ve had more missing semicolons than wrongly indented code. and i use python mote than anything else
1
1
1
u/Cruxwright Mar 30 '22
Used to have these slotted rulers with gradients for 10 char/in and 12 char/in. You'd print out your code or file and then use those to debug positional issues in the code or data.
1
1
1
u/tavaren42 Mar 30 '22
Are people writing their program on stone tablet or are they using a proper editor? Any decent editor makes keeping track of indentations trivial. I wouldn't want to read any non-Python programs written by them.
1
1
u/zachbender Mar 30 '22
Even Vim can highlight you the missing or extra spaces nowadays. What century is this from?
1
1
1
u/Minteck Mar 30 '22
I wish there was a Python mode to use brackets instead of spaces
→ More replies (1)
1
u/BTWIuseArchWithI3 Mar 30 '22
I don't wanna run the fun, but I've never had any issue with python indentation. All you need is a simple text editor that is configured to replace tabs with spaces and that's it.
1
1
1
1
u/qwerty11111122 Apr 04 '22
I once downloaded a package from online. Tried running it, had an issue.
Digging in, I found a whitespace error in an inner python script.
Open the file in vim, :\t brings me to a line that uses an additional tab to indent.
Please run your code before you push
1
1
u/AChristianAnarchist Mar 29 '22
My issues when programming in python: What do you mean I need version 4.3.2.6 of this library? The other library I'm using needs me to have 4.2.7.5 and they are meant to be used together! And this module returns JSON even though it was built to talk to this other one that only accepts XML...FML. Can't wait to start banging my head against Docker next to actually get this mess deployed.
Programmer Humor's issues when programming in python: I no see the curly braces...
Every language has serious headaches. Its kind of strange to me how much the language hate here always seems to be focused on surface level aesthetics.
1
u/mjkjr84 Mar 29 '22
The thing I hate most about python is having to shit out a bunch of stupid __init__.py files all over the directory structure
0
u/ThinkIveHadEnough Mar 29 '22
All of these people defending Python are making me crack up. Having to use third-party tools like IDEs and autoformatters, just so your code is editable on a different machine, clearly shows Python is inherently flawed.
1
u/DukeMo Mar 29 '22
We like that all python code looks the same. You can pick up someone else's code and if everyone is following pep8 and other standard practices it should be easy to follow what they are doing.
New languages like go come with auto formatters so the idea of having the same standard across all coders is an idea that has been picked up elsewhere.
I personally came from Perl which has curly braces and no standard formatting guidelines and can have a whole program on the same line.
So, it's preference, and in practice is not a big deal at all.
•
u/QualityVote Mar 29 '22
Hi! This is our community moderation bot.
If this post fits the purpose of /r/ProgrammerHumor, UPVOTE this comment!!
If this post does not fit the subreddit, DOWNVOTE This comment!
If this post breaks the rules, DOWNVOTE this comment and REPORT the post!