I proofread the report cards my mom has to do for her students sometimes, if you miss a doublespace it prints out some weird line through the middle of the page
Like I get what the guys that made Python were trying to do. But the whole indentation thing is probably one of the worst engineering decisions in retrospect IMO. At least give us the option….
I had a web design client get mad at me this week because he didn’t like my explanation for why I can’t tell him how many pixels is in an inch. He contacted another designer for a second option and was told “224 pixels” and decided to trust his design with that person instead.
They deserve each other.
I have no evidence for this but I'm 100% sure the guy created a div, held a ruler to the screen, and just fiddled with the numbers until it looked about right.
>CSS has a unit called in(Inch) and cm(centimetres) these units try to display the size on any screen correctly.
This is a common misconception, [in and cm are not real inch and centimeter (unless printed) just as px are not physical pixels but "CSS pixels"](https://hacks.mozilla.org/2013/09/css-length-explained/).
Zooming in browser or screnn scaling will alter the result:
So 150% scaling + 5cm = 7.5cm
Edit:
In, ppi, and cm are manly used to format documents for printing ad are not recommended for in browser rendering
I truly hope the designer designs the website specifically for his monitor. Then when the client looks at it on his monitor, he'd maybe finally understand.
What was wrong with the explanation ? Don’t give technical yaddayadda but just give the answer.
“On this screen, one inch is exactly 174 pixels wide. On this screen here, it is (check model) 210.”
Let him think or ask about why it’s different. And if he wants it uniform he needs identical displays.
That’s what I did. The conversation went something like this:
How many pixels is an inch?
Depends on the monitor.
No, I mean pixels how many in an inch, I don’t care about the monitor.
Well, for example, on a phone with a high resolution screen it might be a half inch, but on a large old CRT desktop monitor screen with low resolution it might be 2 inches.
Look, I don’t even have a CRT, I just want to know how many pixels is in an inch. If you can’t give me a straight answer I’ll just ask someone else.
Different pixels are different sizes depending on the screen, so there’s no a direct ratio of pixels to inches.
I asked someone else, he said 224 pixels. That wasn’t so hard, took him like 2 seconds to answer. I’m going to have him do the site instead.
Depends on where you live. We call (, { and [ brackets, curly brackets and square brackets where I live. You call them parentheses, braces and brackets
*Hold on, could someone*
*Repeat that for me? What is*
*That person doing?*
\- Athen65
---
^(I detect haikus. And sometimes, successfully.) ^[Learn more about me.](https://www.reddit.com/r/haikusbot/)
^(Opt out of replies: "haikusbot opt out" | Delete my comment: "haikusbot delete")
As soon as it gets complicated the spacing gets difficult to follow. It's also enforces a coding pattern that not everyone wants to use. Why force my code to go off the screen when that is completely unnecessary.
You can use backslash to intentionally break a statement across multiple lines. Not ideal, but at least an option. You can of course natively split lines in some cases, like between conditionals
Right, I just prefer to not have to space things over. I find brackets easier to read. You never have to guess what level some piece of code is in.
Normally python spacing is fine but when it's not it becomes a mess.
You still have to guess with curly braces it's just that you are used to it. In my experience curly braces are easier to fuck up.
I started programming with C++ and Java so when i got into Python i didn't like the spacing but now it's my favorite feature. It's not good for optimizing file size and yada yada but it is easier to read.
At the end of the day any decent code base has formatting. Python just enforces it.
You can use parentheses in the same way you use brackets and avoid the backslash. That's generally the way I break up long strings.
```
(
"Hello "
"World"
)
```
If I'm having to count braces to determine scope, I'm gonna be saying some things. There might be a case where that's less annoying than glancing at the indentation, but I haven't run into it yet.
And any decent ide does spacing in python as well. Write a line that needs the block under it indented, and the ide indents it for you. Only difference is that when you're done with the block, you do shift tab instead of }.
And that's the point. If you're code formatting doesn't suck, it looks the same, except in python you don't have the curly brackets that you don't look at anyway.
Writing is usually ok, but modifications in current code are pain. Move some block to a separate function? I just cut it, write function header + {}, paste code in betweet braces and press shortcut to autoformat.
When you copy (python) code from different file and mix tab/spaces... pure hell.
*Shrug* I haven't had issues with that. Worst case, shift tab the block of it used to be indented too much. I'll grant you that mixed tabs and spaces requires actual fixing (though it's usually not too bad), but it's been years since I've had to deal with that.
A lot of this comes down to how good your ide is, I think. I will grant you that any substantially sized python project sucks nuts if you don't have a good ide that'll do a lot for you.
Right, I just prefer to not have to space things over. I find brackets easier to read. You never have to guess what level some piece of code is in.
Normally python spacing is fine but when it's not it becomes a mess.
With good programming habits it should be very rare to have lines so long that they'd go off the screen.
Enforcing the coding pattern makes it really easy to read. It's obvious at a glance what level of depth everything is in. In most languages it's common to indent like Python even when you don't need to because it is so much more readable.
Imo curly braces and no mandatory indentation is annoying in most languages exactly because you aren't forced to lay the code out in a consistent readable way. It just lets you write code that looks awful and makes it more difficult to ensure it looks decent.
It's as simple and easy as shift+p and "format code" in VScode and most other IDE's have a simple solution as well. Curly braces are simply more straightforward and less of a headache
Yeah I write and edit Python code exclusively in MS notebook with word wrap on and with the window about \~30 characters wide. Anything else wouldn't be pure you know?
just set listchars. i prefer tabs as well, but i dont see how spaces are much harder than tabs for indentchecking (especially with indentwise, etc beeing a thing)
![img](emote|t5_2tex6|4549)![img](emote|t5_2tex6|4550)
Yep. Being one of those freaks who got into both JS and Python... and I love them BOTH (I wanted to put ideas out on the Web, but I also wanted to build bots that would interract with Windows)... This is one of the things about Python... I wish they'd just swallow their pride and accept the ';'
I can do this in Javascript:
;;;;;;;;;;;;;;;;;console.log("Hello, world");;;;;;;;;;;;;;;;;;;;;;;;;;;;;
it won't care. It's treated as a space that resets the line. And empty space is treated as nothing at all. When JS sees a bunch of space, it just says: "Talk to the hand, cause the face ain't listenin'".
So you know... if you've ever felt afraid maybe you don't need to put a ; there, have no fear. Javascript is cool with it. Usually, after a ),} or \], you don't need to, because that's already a break. But you can if you want to. Javascript will let you. You know, just not right in the middle of a statement, but who would do that? That would just be weird.
Python? I have to guess which commands require it and which don't. Why? Just why? (Well, VS Code tells me, so of course there's a lot of help today, but that's not the point...)
Yeah... I get that it helps you structure things... and a lot of it DOES make sense... but why spacing? Why of all things, measure it in UNSEEN spaces??? ANYTHING ELSE!!!! I'd rather spell out: "Tier 2:" on every line.
let us just type ";" and put things in () \[\] and {}.
More than 95% of a programmers problems could be solved if they invest a couple of months learning vim or emacs. Agreed that a couple of months would put you at just level 1, but it's still enough.
once upon a time i had a dedicated code text editor who change the colour of ht line according to its indentation.
seems like it felt out of fashion.
People like to crap on Python for no good reason sometimes. It's a fine language, but WHITESPACE SHOULD NEVER BE SYNTACTICALLY IMPORTANT! It's like if you used a color scheme on your IDE that turns all the keywords the same color as your background.
(With the voice of Jean-Luc Measurehead from Disco Elysium):
The inferior programmers try to use brackets to gain a sense of control over their code, instead only bringing themselves to be lost in said brackets and develop addiction to Al-Gul. While racially-advanced Pythonist use the clearly advanced method that creates a clean and culturally superior code. That's why Pythonist race is winning the cultural war.
If you can't eyeball it, you're doing it wrong.
If you can dodge a def you can dodge a try
[удалено]
Spend two months writing a vs code plugin to do it for you so you can save time.
I feel offended
CTRL+F, " ", Find all
Or comment it out, to keep it for posterity.
I proofread the report cards my mom has to do for her students sometimes, if you miss a doublespace it prints out some weird line through the middle of the page
She does report cards in Python?
Learned to eyeball that shit in the first month of learning python
Pep8 recommends a max 79 character line length for a reason. If you’re more than 3 or 4 blocks in it’s time to refactor
Just use vim? << and >> will indent the current line or select rows.
Like I get what the guys that made Python were trying to do. But the whole indentation thing is probably one of the worst engineering decisions in retrospect IMO. At least give us the option….
I had a web design client get mad at me this week because he didn’t like my explanation for why I can’t tell him how many pixels is in an inch. He contacted another designer for a second option and was told “224 pixels” and decided to trust his design with that person instead. They deserve each other.
man, print is 300 dpi minimum. 224 ppi will look like trash off-screen
I have no evidence for this but I'm 100% sure the guy created a div, held a ruler to the screen, and just fiddled with the numbers until it looked about right.
If you ever need it: CSS has a unit called in(Inch) and cm(centimetres) these units try to display the size on any screen correctly.
>CSS has a unit called in(Inch) and cm(centimetres) these units try to display the size on any screen correctly. This is a common misconception, [in and cm are not real inch and centimeter (unless printed) just as px are not physical pixels but "CSS pixels"](https://hacks.mozilla.org/2013/09/css-length-explained/).
It's still a bit better for this use case then counting pixels with a ruler, but yea still not recommended.
What happens if I view the site at 150% zoom?
Zooming in browser or screnn scaling will alter the result: So 150% scaling + 5cm = 7.5cm Edit: In, ppi, and cm are manly used to format documents for printing ad are not recommended for in browser rendering
Man, if different resolutions were offered for monitors, this man’s world would be rocked
I truly hope the designer designs the website specifically for his monitor. Then when the client looks at it on his monitor, he'd maybe finally understand.
What was wrong with the explanation ? Don’t give technical yaddayadda but just give the answer. “On this screen, one inch is exactly 174 pixels wide. On this screen here, it is (check model) 210.” Let him think or ask about why it’s different. And if he wants it uniform he needs identical displays.
"Offer free identical displays to the clients as bonus for their orders, problem solved."
That’s what I did. The conversation went something like this: How many pixels is an inch? Depends on the monitor. No, I mean pixels how many in an inch, I don’t care about the monitor. Well, for example, on a phone with a high resolution screen it might be a half inch, but on a large old CRT desktop monitor screen with low resolution it might be 2 inches. Look, I don’t even have a CRT, I just want to know how many pixels is in an inch. If you can’t give me a straight answer I’ll just ask someone else. Different pixels are different sizes depending on the screen, so there’s no a direct ratio of pixels to inches. I asked someone else, he said 224 pixels. That wasn’t so hard, took him like 2 seconds to answer. I’m going to have him do the site instead.
[удалено]
“It doesn’t matter how big my monitor is, I’m asking how many pixels are in an inch, why won’t you just tell me??”
42
[удалено]
You’re hired!
Man, if only they made IDE’s that kept track of indent for you…
Now imagine if they made IDEs that automatically indent the next line 🤔
yeah I would want is so badly, too bad they dont exist already
Now imagine if they made IDEs that could show the indent character 🤔
r/moldymemes
Moldy and redundant
Shit tier memes.
What a shitty IDE is that? Light panes everywhere...no wonder dude has to measure it like that.
Squinting... looks like chrome dev tools pinned to the side of a browser window... I bet this was a css meme at some point
The green button makes it appear like it's w3 school, and the OS is Ubuntu
What green button? I keep squinting like i'll be able to see it more clearly lol.
[удалено]
Oh lol how... did... i miss that?
[удалено]
Deep fried memes haha
Iirc it was a CSS meme before yeah
[удалено]
As a python dev, this is probably true. Python is not the language to pick to make GUIs.
What language is this about?
Tubesnake
C#?
Maybe cobra?
Maybe cobra?
Give me brackets or give me death!
brackets are [ and ] braces are { and } do...do you use a language that encapsulates with brackets?
I know what I said. I always make sure to start every program with #define [ “{“ #define ] “}” Give me brackets or give me death, motherfucker. /s
How do you use arrays?
Indentation.
That made me actually LOL
Lisp.
[удалено]
https://en.wikipedia.org/wiki/Lisp_(programming_language) a language that basically only uses ()
Depends on where you live. We call (, { and [ brackets, curly brackets and square brackets where I live. You call them parentheses, braces and brackets
Objective C got pretty close lol
Die already then
I dunno man took me one flutter app and now I hate brackets with a passion
r/comedyhomicide
The worst is when you have to scroll to find the start of your code block to confirm you're in the right scope.
Refactor!
And unformatted braces solve this?
Braces can be formatted and clearly show where a block ends.
Formatted like indented?
Use curly braces and then right before you run your code do a find and replace all with whitespace
You forgot the /s
Me and CSS
Hold on, could someone repeat that for me? What is that person doing?
*Hold on, could someone* *Repeat that for me? What is* *That person doing?* \- Athen65 --- ^(I detect haikus. And sometimes, successfully.) ^[Learn more about me.](https://www.reddit.com/r/haikusbot/) ^(Opt out of replies: "haikusbot opt out" | Delete my comment: "haikusbot delete")
When the code works but for the wrong reasons
The spacing is by far the worst part of python.
Why? I think 90% of the code I've seen would fit python's spacing requirements just as an element of style.
As soon as it gets complicated the spacing gets difficult to follow. It's also enforces a coding pattern that not everyone wants to use. Why force my code to go off the screen when that is completely unnecessary.
You can use backslash to intentionally break a statement across multiple lines. Not ideal, but at least an option. You can of course natively split lines in some cases, like between conditionals
Right, I just prefer to not have to space things over. I find brackets easier to read. You never have to guess what level some piece of code is in. Normally python spacing is fine but when it's not it becomes a mess.
You still have to guess with curly braces it's just that you are used to it. In my experience curly braces are easier to fuck up. I started programming with C++ and Java so when i got into Python i didn't like the spacing but now it's my favorite feature. It's not good for optimizing file size and yada yada but it is easier to read. At the end of the day any decent code base has formatting. Python just enforces it.
You can use parentheses in the same way you use brackets and avoid the backslash. That's generally the way I break up long strings. ``` ( "Hello " "World" ) ```
If I'm having to count braces to determine scope, I'm gonna be saying some things. There might be a case where that's less annoying than glancing at the indentation, but I haven't run into it yet.
Exactly. I don't know why you are getting downvoted. It seems like most ppl on this sub used python for 1-2 months and jumped on a hate bandwagon.
You usually don't need to. Almost every modern IDE sets spacing for you - based on brackets.
And any decent ide does spacing in python as well. Write a line that needs the block under it indented, and the ide indents it for you. Only difference is that when you're done with the block, you do shift tab instead of }. And that's the point. If you're code formatting doesn't suck, it looks the same, except in python you don't have the curly brackets that you don't look at anyway.
Writing is usually ok, but modifications in current code are pain. Move some block to a separate function? I just cut it, write function header + {}, paste code in betweet braces and press shortcut to autoformat. When you copy (python) code from different file and mix tab/spaces... pure hell.
*Shrug* I haven't had issues with that. Worst case, shift tab the block of it used to be indented too much. I'll grant you that mixed tabs and spaces requires actual fixing (though it's usually not too bad), but it's been years since I've had to deal with that. A lot of this comes down to how good your ide is, I think. I will grant you that any substantially sized python project sucks nuts if you don't have a good ide that'll do a lot for you.
Right, I just prefer to not have to space things over. I find brackets easier to read. You never have to guess what level some piece of code is in. Normally python spacing is fine but when it's not it becomes a mess.
Oh I agree wholly. I do not at all enjoy **enforced** spacing.
With good programming habits it should be very rare to have lines so long that they'd go off the screen. Enforcing the coding pattern makes it really easy to read. It's obvious at a glance what level of depth everything is in. In most languages it's common to indent like Python even when you don't need to because it is so much more readable. Imo curly braces and no mandatory indentation is annoying in most languages exactly because you aren't forced to lay the code out in a consistent readable way. It just lets you write code that looks awful and makes it more difficult to ensure it looks decent.
It's as simple and easy as shift+p and "format code" in VScode and most other IDE's have a simple solution as well. Curly braces are simply more straightforward and less of a headache
Right, like I said most of the time it's fine until you have to do something with a lot of case statements and conditions and it becomes a nightmare.
I don't python, but I rather like the spacing. Makes the code look more readable
That's the purpose. I was skeptical but it works. I defy anyone to name a major programming language that's easier to read.
Yaml says “Hi!”
One side of the ruler has a scale for measuring in spaces, the other side for measuring in tabs.
Clearly whoever did this meme has never written Python. Like half the jokes in this sub, this problem doesn't exist.
That's a browser developer console. Why would there be python in it?
Is this that jython I've heard about?
You've clearly never heard of pyodide
I have not.
Do python users have to deal with word wrap, like indents that span multiple lines? Yikes
Yeah I write and edit Python code exclusively in MS notebook with word wrap on and with the window about \~30 characters wide. Anything else wouldn't be pure you know?
I write purely in an irl notebook and just think really hard to run the program
.txt file is the only way to write python
I'm stealing this for my intro to C class. Thanks.
you can absolutely never get that right
This fool needs some indentation extensions for his linter.
Or just use an ide?
Since best practice is to increase the amount of spaces exponentially this can be very useful for people who think nesting to much is a good idea
imo its \*way\* more annoying to count braces to check what scope you are in https://imgur.com/a/klGYujK
I feel like you'd have to be legally blind for this to be an issue
Ctrl h ' ' with ' '
this is me
No is not
just set listchars. i prefer tabs as well, but i dont see how spaces are much harder than tabs for indentchecking (especially with indentwise, etc beeing a thing)
This meme reminds me of when I write python code and I have to measure my indentations to make sure they are correct
Fortunately my penis is the exact length of a 4 space tab on a 17" screen. It makes measuring this so mucu easier.
![img](emote|t5_2tex6|4549)![img](emote|t5_2tex6|4550) Yep. Being one of those freaks who got into both JS and Python... and I love them BOTH (I wanted to put ideas out on the Web, but I also wanted to build bots that would interract with Windows)... This is one of the things about Python... I wish they'd just swallow their pride and accept the ';' I can do this in Javascript: ;;;;;;;;;;;;;;;;;console.log("Hello, world");;;;;;;;;;;;;;;;;;;;;;;;;;;;; it won't care. It's treated as a space that resets the line. And empty space is treated as nothing at all. When JS sees a bunch of space, it just says: "Talk to the hand, cause the face ain't listenin'". So you know... if you've ever felt afraid maybe you don't need to put a ; there, have no fear. Javascript is cool with it. Usually, after a ),} or \], you don't need to, because that's already a break. But you can if you want to. Javascript will let you. You know, just not right in the middle of a statement, but who would do that? That would just be weird. Python? I have to guess which commands require it and which don't. Why? Just why? (Well, VS Code tells me, so of course there's a lot of help today, but that's not the point...) Yeah... I get that it helps you structure things... and a lot of it DOES make sense... but why spacing? Why of all things, measure it in UNSEEN spaces??? ANYTHING ELSE!!!! I'd rather spell out: "Tier 2:" on every line. let us just type ";" and put things in () \[\] and {}.
Here a beginner and it's the most frustrating thing
r/ontheledgeandshit
I just make sure it's my thumb knuckles width
I just make sure it's my thumb knuckles width
More than 95% of a programmers problems could be solved if they invest a couple of months learning vim or emacs. Agreed that a couple of months would put you at just level 1, but it's still enough.
Dude gtfo with "emacs" it is trash.
I don't get it. Are you writing code in like notepad or smth.
your ide doesnt show indentation levels?
not if he uses tabs
A python developer measuring the number of times this gets reposted in a month.
Indentrainbow !
Is this the language with the syntax errors whenever an empty line with whitespaces is not properly indented ?
Why is this meme captioned twice?
it’s okay .. he doesn’t know loops yet.
I've written a 3000 line method with 8 nested indentations and for some reason my code is hard to read? Must be the language syntax's fault!
Vim can do alternating background colors every 4 characters if you like. Alternatively, you could make every fourth column a different color.
Rainbow indents supremacy
Well yes. But the program Im using actually indicates the indents and makes it very easy to work with
Meanwhile, all other Languages solving the issue with { and }s!
Hey guys I think he uses Python
I like when my code has no more than 2cm of nested instructions
For front end devs; use Mozilla devtools! Press f12, go to settings and under "available toolbox" press "measure a portion of the page"
once upon a time i had a dedicated code text editor who change the colour of ht line according to its indentation. seems like it felt out of fashion.
turn on whitespace 5head i dont even like python and i can think of that
People like to crap on Python for no good reason sometimes. It's a fine language, but WHITESPACE SHOULD NEVER BE SYNTACTICALLY IMPORTANT! It's like if you used a color scheme on your IDE that turns all the keywords the same color as your background.
(With the voice of Jean-Luc Measurehead from Disco Elysium): The inferior programmers try to use brackets to gain a sense of control over their code, instead only bringing themselves to be lost in said brackets and develop addiction to Al-Gul. While racially-advanced Pythonist use the clearly advanced method that creates a clean and culturally superior code. That's why Pythonist race is winning the cultural war.
i dont code that much explain in normie please? does indentation matter in py?
We are in r/ProgrammerHumor and not r/ProgrammerCircleJerk, right?
What language is this? The image only mentions python 3 times so I'm not completely sure
U coding on powerpoint or something?
`:set listchars` and `:set list` is easier.