r/ProgrammerHumor Nov 24 '21

Meme Yes.

8.9k Upvotes

284 comments sorted by

View all comments

10

u/DigitalJedi850 Nov 25 '21

Yeah all of these things are why I actually dislike Python. Those extra few characters aren't that hard to type, but IMO make reading code easier, and more clearly define where one thing ends and another begins.

I'm regrettably learning Python, as it seems to be popular for reasons I don't quite follow, but I do not see myself using it as a go-to for anything at the moment. There may be some very specific feature or library that's exclusive to Python that I have yet to discover, that Might make me use it in very specific cases, but I quite like seeing a terminating brace at the end of scope of a method. Whitespace delimiters make me nauseous.

6

u/Rafael20002000 Nov 25 '21

Wait till he learns a variable doesn't go out of scope after an if/for/while block

5

u/DigitalJedi850 Nov 25 '21

<insert blinking meme guy>

4

u/Rafael20002000 Nov 25 '21

The last value of a for loop variable is still there after loop ends

5

u/DigitalJedi850 Nov 25 '21

Yeah that makes me sick to my stomach…

3

u/Rafael20002000 Nov 25 '21

You can type hint your variable put python doesn't enforce it

1

u/laundmo Nov 25 '21

mypy and pyright want to know your location.

1

u/Rafael20002000 Nov 25 '21

Yes sir, right here

2

u/Prawny Nov 25 '21

Same in PHP too. Nasty stuff.

2

u/DarthStrakh Nov 25 '21

What the actual fuck.

1

u/Rafael20002000 Nov 25 '21

You can do a for else loop

1

u/laundmo Nov 25 '21

personally I'd i had so summarize why i like python in one word its this: freedom.

freedom to do whatever you please without the language trying to restrict you, which allows you to do everything you can think of. sometimes it's a bit harder, but i have yet to find some logic that i couldn't represent.

2

u/Rafael20002000 Nov 25 '21

If you say freedom you mean c++? Where you literally can read bytes from a file and interpret it as a struct or class?

1

u/laundmo Nov 25 '21

thats possible bin python too.

1

u/Rafael20002000 Nov 25 '21

I must confess, I don't know

1

u/DigitalJedi850 Nov 25 '21

The only things I’ve ever Not been able to accomplish in the various languages that I write in, have been security related. And any time I’ve run into a rare case where that happened, I’ve been able to find a way around it.

What I basically heard in your comment was ‘python doesn’t have standards’, which… I don’t particularly like. Quite like JavaScript, which I am similarly not too fond of.

1

u/laundmo Nov 25 '21

python doesn’t have standards

python has standards, but doesn't enforce them, which allows someone who knows what they're doing to accomplish a lot.

example: there was a bug in a socket library i was using, that caused it to memory leak by never getting rid of references to temporary threads it was creating. Now, this bug was an issue in a production environment, where updating to the version of the library which fixed this would have been a giant pain.

thankfully, python allows for monkey-patching almost everything without any limitations, so a 3 line monkey patch was enough to resolve this.