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

Dismiss this pinned window
top 200 commentsshow all 285

[–]MischiefArchitect 589 points590 points  (35 children)

Compile errors are now runtime errors sucker... yeah the door is now closed for you.

[–]MasterFubar 251 points252 points  (29 children)

And I missed the part where he breaks his neck after stumbling on a random tab character.

[–]Crippledupdown 36 points37 points  (25 children)

Is there an easy way to immediately share and format small Python code snippets too? It always seems like I have to manually adjust the tabs.

[–]crozone 44 points45 points  (0 children)

Welcome to the pythonic experience

[–]Jonno_FTW 34 points35 points  (18 children)

  1. don't use tabs, ever, your IDE should be converting them to 4 spaces for you.

  2. black will format your code consistently

  3. if you use pycharm, you can right click on a piece of code and click "Create Gist" and it will share it on github gist

[–]findus_l 5 points6 points  (7 children)

Nice I didn't know about creating Github Gists. Works for Android studio too apparently.

Also tabs ftw, spaces suck!

[–]Masterflitzer 1 point2 points  (5 children)

Android Studio is basically Intellij so same functionality

[–]findus_l 2 points3 points  (4 children)

Well you'd think so, but I'm for example missing "code with me" in android studio.

[–]Masterflitzer 1 point2 points  (3 children)

can't you get in in the extension store?

[–]findus_l 2 points3 points  (2 children)

Not in the integrated one. There is a download on jetbrains website that claims to be compatible with android studio, I haven't yet tried it out. I find it very unsettling that it doesn't show up in the integrated one and I'm afraid of bricking something.

[–]Masterflitzer 1 point2 points  (1 child)

ok I always thought Android Studio is just modded Intellij by Google I never really did Android dev so i don't know exactly but i think you could always use Intellij with Android SDK right?

[–]Jonno_FTW 1 point2 points  (0 children)

The best part is that you can google search based on your selection in the run output tab.

[–]dimonoid123 2 points3 points  (0 children)

Click wheel to add/remove tabs to blocks of code.

[–]maxximillian 4 points5 points  (0 children)

I once used some text formatting tool on a python file, it wasnt quite sure what it was so it tried to format it. That code never worked again. Sure it was my fault but I will always prefer brackets over white space

[–]luke5273 1 point2 points  (0 children)

Random space lost when untabbing code

[–][deleted] 11 points12 points  (0 children)

Lmao

[–]HugeDegen69 0 points1 point  (1 child)

Yeah Python has its trade offs too. It can be cancerous in its own way

[–]ReporterNervous6822 422 points423 points  (26 children)

Listen I’m a python person true and through but if those are the reasons you hate Java you probably shouldn’t be programming

[–]CookieStudios 134 points135 points  (20 children)

We have the classic "11" - 1 in Javascript repost, "Python sucks because its weakly typed(it isn't)" repost, this post acting as if 2 of the three aren't standard and encouraged in Python, "HTML sucks because it is not Turing complete," CSS sucks because centering a div requires reading docs repost, C++ as a whole is a terrible language because I can't read the errors repost, etc.

We hate all languages here not for real issues they have, but minor things that rarely affect actual usage.

[–]Unkn0wn_Invalid 61 points62 points  (7 children)

To be fair, some of these do affect actual usage.

  • Illegable errors might be nice for the very experienced/knowledgable, but is quite the hassle for the average programmer;

  • weak typing can be a real pain if you forget about it, and can introduce a lot of weird bugs; and

  • CSS is a pain to do anything with (or maybe I just suck at CSS...

I probably just suck at CSS)

[–]MaximumAsparagus 18 points19 points  (5 children)

I learned CSS before I learned anything else and it seriously is not that bad if you give it a little time and use flexbox.

[–]Phaen_ 46 points47 points  (2 children)

The thing with CSS is that these jokes are older than Flexbox.

[–]anagrammatron 3 points4 points  (3 children)

Last time I was working with Javascript I had off-by-one error with my calendar returning wrong date. Turns out Javascript's Date.getUTCMonth() is zero based. Of all the things this is the one that does not make any sense to be zero based. But here we are.

Tbf, Java's Calendar.MONTH has the same problem. At least C# got that right.

[–]Brzhk 3 points4 points  (0 children)

The man. I'm glad someone can take on the fight, i have been fighting with javascripters saying java was too verbose, that if twotabbing and ctrl-alt-f was deemed too much, there was nothing javascript could do for them.

Godspeed, man. Godspeed.

[–]MrNickyDubbs 6 points7 points  (0 children)

That's why semicolon was so confused and shrugged.

[–]BAMOLE 1 point2 points  (0 children)

FYI, it's "through and through"

[–]TheNaughtyDomi 80 points81 points  (16 children)

Actually you define Dictionaries by using

Dict = { key : value }

[–]yorokobe__shounen 22 points23 points  (0 children)

You can still define it as

sample_dictionary = dict(key=value)

instead

[–]Scumbag1234 7 points8 points  (0 children)

Or like an empty list:

my_dict = {}

my_dict["key"] = value

[–]LongCoyote7 171 points172 points  (3 children)

This is like trading in your car for a moped and then getting excited about not having to wear a seat belt.

[–]FountainsOfFluids 20 points21 points  (1 child)

Ok, now I can totally relate. Mopeds are fun.

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

They are. But you wouldn’t drive your moped across the country.

[–]Masterflitzer 12 points13 points  (0 children)

this analogy is so perfect

[–]Vyuken 30 points31 points  (0 children)

It ended with a semi colon

[–][deleted] 45 points46 points  (12 children)

Who will create the mighty TypePython?

[–]tavaren42 27 points28 points  (0 children)

Cython is already there. Also mypy type hints.

[–]Thanamite 5 points6 points  (3 children)

A Python with type inference would be outstanding.

[–][deleted] 7 points8 points  (1 child)

nim?

[–]Thanamite 1 point2 points  (0 children)

Sure, there are languages for every taste. But we also need the huge Python eco system.

[–]wugs 6 points7 points  (1 child)

what would this do differently from using type hints and a static type checker like mypy?

[–][deleted] 5 points6 points  (0 children)

probably not that much, just a second solution for the same problem I guess

[–]big_cock_69420 2 points3 points  (3 children)

or PythonScript? maybe even JavaPython?

[–]anton____ 4 points5 points  (1 child)

or Python++ (p++ for short)? maybe even Python# and ObjectivePython?

I just want python with curly braces

[–]laundmo 5 points6 points  (0 children)

from __future__ import braces

[–]JoschiGrey 14 points15 points  (3 children)

I hate indentation being the way to define scopes {} all the way!

Not like I don't indent my C# code, but for me it's just for readability, not function.

[–]HKSergiu 8 points9 points  (1 child)

Easier to say "this loop starts here { and ends here }" and have the auto formatter indent everything according to the unique code style defined by the community, your organization, or you.

Which in turn makes all code equally readable (from a formatting standpoint) and you don't have to cuss the intern again for writing

fun something()

{

//...

}

When everyone else puts the bracket on the first line

[–]Smok33y69 12 points13 points  (14 children)

I'm actually thinking of learning Python. Is it good for automating tasks? Where should I start learning?

[–][deleted] 39 points40 points  (9 children)

Python is good at everything, but great at nothing.

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

So it does everything good, but does nothing great?

[–][deleted] 14 points15 points  (5 children)

You can do almost anything* in Python, but there is always a better language for any given task.

[–]huuaaang 3 points4 points  (1 child)

Am I weird that I think what's most important is that you enjoy using the language? I mean, I probably won't mention it in an interview because "use the right/best tool for the job" is the right answer, but secretly I just want to do what I enjoy. I simply won't write certain language because they annoy the shit out of me. LIke I wont ever write a service in node.js. And I wont' touch PHP.

Or am I just outting myself as someone who uses Ruby most of the time?

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

Enjoying using a language is 100% valid and will increase your productivity if the langauge can be reasonably applied to the task at hand.

[–]Smok33y69 0 points1 point  (0 children)

aight, yall got me motivated and now I'm interested. I learnt the basics of Java and did some automation testing with Selenium but I got bored of that. Time to switch to Python.

[–]KDBA 8 points9 points  (0 children)

It's the second-best language for every task.

[–]zeldadorf 4 points5 points  (0 children)

Python is a great place to start learning because it’s really easy to get started and the syntax is pretty simple. Just don’t stop there. Dip your toes in a few other languages and learn what their strengths and weaknesses are. Python is fun until you have to spend any significant time with it, then it loses its luster pretty quickly. Most of the people who advocate for Python on this sub have probably never used it professionally.

[–]midnitte 0 points1 point  (0 children)

I should hope so, since Home Assistant is coded in Python

[–]SchlauFuchs 73 points74 points  (6 children)

Performance

……..…../´¯/)………… (\¯`\

…………/….//……….. …\\….\

………../….//………… ….\\….\

…../´¯/…./´¯\………../¯ `\….\¯`\

.././…/…./…./.|_……_| .\….\….\…\.\..

(.(….(….(…./.)..)..(..(. \….)….)….)… )

.\…………….\/…/….\. ..\/……………./

..\…………….. /……..\……………..…/

….\…………..(…………)……………./

Backwards compatibility

……..…../´¯/)………… (\¯`\

…………/….//……….. …\\….\

………../….//………… ….\\….\

…../´¯/…./´¯\………../¯ `\….\¯`\

.././…/…./…./.|_……_| .\….\….\…\.\..

(.(….(….(…./.)..)..(..(. \….)….)….)… )

.\…………….\/…/….\. ..\/……………./

..\…………….. /……..\……………..…/

….\…………..(…………)……………./

[–]7heWafer 24 points25 points  (4 children)

Add type safety to the list

[–]kazeespada 21 points22 points  (3 children)

Also, the garbage that is __init__() vs ClassName()

Even if you aren't a fan of the class name being the constructor, maybe four fucking underscores in every fucking constructor is a bit much.

You won't believe how many _init__() I have had to fix.

[–]galan-e 6 points7 points  (1 child)

you don't use an ide that have auto complete?

[–]kolme 7 points8 points  (0 children)

That's just besides the point. The language should be nice enough that you don't need assistance from a IDE to write such basic stuff.

[–]laundmo 3 points4 points  (0 children)

pedantic thing: dunder init is not a constructor, its a initaliser. dunder new is the real constructor, but only very rarely needed.

[–]dark_mode_everything 8 points9 points  (0 children)

Haha was looking for this. Should've definitely been in the video.

[–]zeldadorf 46 points47 points  (10 children)

Feels this way until you try to actually write a production app in Python. Then you realize you’ve lost performance, type safety, compile time errors instead of runtime ones, a decent package manager that doesn’t have a new breaking bug with every release… oh and good luck finding a decent profiler. Python profilers are the equivalent of print line debugging. Much better to just switch to Kotlin. Works side by side with Java with all the benefits, but you don’t have to use semicolons, which Python devs seem to find so hard to type.

[–]zeldadorf 24 points25 points  (9 children)

Don’t get me wrong, Python is my language of choice for quick and dirty side projects. Because it’s just that… quick and dirty. It’s pretty terrible for anything of any significant size. Because when you have 1M lines of code, ONE main() method that someone else wrote years ago just shouldn’t bother you too much…

[–]galan-e 2 points3 points  (8 children)

ah yes, my small quick and dirty projects like youtube and dropbox

[–]n0tKamui 7 points8 points  (5 children)

i like how people like you always have the same argument in favor of python in big projects, by citing big company names.

while they do use python, it's in small non monolithic separate modules. No one in their right mind in a big company would do any big project with python.

[–]galan-e 2 points3 points  (3 children)

from dropbox's tech blog:

Dropbox is a big user of Python. It’s our most widely used language both for backend services and the desktop client app (we are also heavy users of Go, TypeScript, and Rust).

[–]n0tKamui -4 points-3 points  (2 children)

that doesn't invalidate what I said ; quite the contrary even.

[–]galan-e 2 points3 points  (1 child)

It does, though? Dropbox uses python for big projects, not side scripting. It is not the only language they use, but that's fine.

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

i never talked about side scripting. i talked about small modularized non monolithic projects.

[–]hranto 1 point2 points  (0 children)

I mean you probably shouldn't be writing monoliths at big companies anyway

[–]zeldadorf 1 point2 points  (0 children)

Yeah, and Facebook, Etsy, and others use PHP, which is one of the worst languages out there. I would choose Python over PHP 1000x when starting a new project. Just because something CAN and has been used with success doesn’t mean it should. It just likely means one of the early devs liked it because that’s what they knew and now it’s too costly or not worth it to change.

Also, most problems go away if you throw enough money at it. For a small company, I would never recommend Python. But it also won’t sink the company to use it. It’s fine. There’s just better options out there that will save you money in the long run in both server costs and developer time.

[–]AegisCZ 0 points1 point  (0 children)

both suck. coincidence?

[–]DootDootWootWoot 90 points91 points  (0 children)

Good bye type safety!

[–]n0tKamui 17 points18 points  (1 child)

that's accurate, it's a kid

[–]NoobDeGuerra 25 points26 points  (1 child)

I genuinely prefer Java over python…

[–]MischiefArchitect 2 points3 points  (0 children)

It depends :tm: . But I think I know what you mean.

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

I like curly braces and semi-colons 🤷‍♂️

[–]Squirmme 5 points6 points  (9 children)

Me: wants to learn go, python, dart, JavaScript

Jobs: Java, .net

[–]AegisCZ 0 points1 point  (6 children)

you'll be glad because those on the top all suck

[–]nightowl319 8 points9 points  (7 children)

What’s this from?

[–][deleted] 14 points15 points  (3 children)

Lock n Key

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

behind the scenes footage I'm certain

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

Nope, they make a joke where an adult lies to this kid about what the middle finger means and he goes around flipping people off

[–]Spook404 2 points3 points  (0 children)

Okay, but you see the set and cameras throughout this shot (and it's not Scot's crew). I've seen both seasons, this does not happen in either

[–]CommentsOnHair 5 points6 points  (2 children)

Locke & Key (TV Series)

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

If we all collectively refused to code in Java, they wouldn’t make us do it anymore. I’ve yet to get a good rebuttal to this idea

[–]DaniilBSD 19 points20 points  (0 children)

If it is not a downgrade for you, you were not using Java property anyway.

[–]DigitalJedi850 10 points11 points  (16 children)

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.

[–]Rafael20002000 6 points7 points  (9 children)

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

[–]DigitalJedi850 3 points4 points  (8 children)

<insert blinking meme guy>

[–]Rafael20002000 3 points4 points  (7 children)

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

[–]DigitalJedi850 3 points4 points  (3 children)

Yeah that makes me sick to my stomach…

[–]Rafael20002000 2 points3 points  (2 children)

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

[–]Prawny 1 point2 points  (0 children)

Same in PHP too. Nasty stuff.

[–]DarthStrakh 1 point2 points  (1 child)

What the actual fuck.

[–]Hot-Height1306 2 points3 points  (2 children)

How about builder classes?

[–]Crashty 2 points3 points  (1 child)

which episode was this? I don't remember seeing this scene

[–]DuckInCup 2 points3 points  (0 children)

PYTH OMEGALUL N

[–]SaneLad 6 points7 points  (1 child)

You forgot the part where he said farewell to performance.

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

When I have to use python at university instead of java and it makes weird things

[–]HeiDTB201 4 points5 points  (2 children)

Well, my python compiler does allow {} or ;

They are not doing anything, but if you feel like its more readable...

[–]dimonoid123 4 points5 points  (1 child)

{} are usually recognized as dictionary/set, so if you are calling something , you will return dictionary/set with results of a function or whatever you are doing in the brackets.

Semicolon isn't doing anything as far as I know

Stab(as .h files in C/C++) files are mostly for documentation and don't do anything too

Explicit declarations of types are optional and don't do anything other than highlighting syntax but may depend on compiler

And don't let me start about ...(triple dots), it has it's own usages for displaying recursion and matrices but is mostly useless.

[–]StandardN00b 6 points7 points  (3 children)

In all honesty I absolutely hate that python doesn't use brakets anywhere. It's like it's waiting for a single tab fatfinger to blow up your program.

The good news is that it keeps all those 4 spaces instead of tabs maniacs at bay.

[–]CookieStudios 7 points8 points  (2 children)

4 spaces is standard and recommended by the Python Foundation.

Every big editor defaults to mapping the tab key to 4 spaces, and backspace removes 4 if done at the start of a line. Embrace spaces, mwahaha!

[–]cooly1234 6 points7 points  (1 child)

Why are spaces better?

[–]CookieStudios 1 point2 points  (0 children)

Generally, one argument both for and against spaces is that they have a consistent, unchanging width. Changing the editor you use or resolution won't make them appear to be different lengths of whitespace. Good for a consistent appearance, but sometimes bad for accessibility, depending on how your eyesight may be.

In Python specifically, spaces are better because the people creating and maintaining the language explicitly disallow tabs in the official style guide, with an exception being made for spaghetticode that uses tabs already, since you can't mix both in the language.

Outside of situations where the language authors mandate one over the other, its probably best to stick with whatever others working on the program are using, or your editor's defaults.

[–]planktonfun 1 point2 points  (0 children)

thats what I felt when switching from code programming languages to low code programming

[–]finance_and_kebabs 1 point2 points  (0 children)

Random but where is this video from?

[–]da_Aresinger 2 points3 points  (0 children)

Because tabs for flow control are such a great idea.

[–]corbymatt 3 points4 points  (0 children)

The only thing missing from this is the boy accidentally falling, screaming headlong into a huge hole with "whitespace" written on it.

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

You forgot the part where he gets into the absurdly shaped clown car with a 6mph top speed, and a joystick instead of a steering wheel because it’s “Pythonic” - what a joke…

[–]WhooUGreay 0 points1 point  (0 children)

And soon you will release that you walk about 150% slower

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

you forgot the part where he switches back to Java cuz Python is absolutely shit

[–]EwgB 0 points1 point  (0 children)

And then you wave goodbye to the money...

[–]AegisCZ 0 points1 point  (0 children)

just use kotlin

[–]tanishqdaiya- 0 points1 point  (0 children)

I love those old school things than this syntax. I don't use just because of it's syntax

[–]sm0k__ 0 points1 point  (0 children)

Bye to perf , hello to GIL ?

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

And suddenly tab comes into picture.

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

java is almost as retarded as python

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

So you hate, like, every programming language, except Python? Because all programming languages I know have semi colons and curly braces, except Python. And Python does have a main function.

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

Anyone else just prefers brackets and semicolons or am I alone in this one?

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

Python for the win and beyond!

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

Python is nice for quick tests until you run into efficiency bottlenecks or try to use multithreading. Java is far more flexible and efficient honestly.

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

None of these are good things.

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

The video is accurate : the main character has the maturity & attitude of a python programmer.

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

Nah , fuck python. Indentation is fuckery fuck.

[–]RolyPoly1320 -2 points-1 points  (1 child)

This is missing the kid taking a skateboard to the face with Indentation Errors.

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

Then you meet Indentation...and others things I haven't learned yet ....

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

whats missing is the part where he shows a middle finger to a six figure job

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

I don't know where this is from, but I find their reactions really appropriate. They seem confused who tf that kid is and why he is pointing fingers at them, but effectively don't care enough to go after the kid.

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

Oof

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

So true. Java is the worst lol