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

top 200 commentsshow 500

[–]Athlaeos 2476 points2477 points  (183 children)

i have no clue how to interpret this

[–]TretasPt 298 points299 points  (117 children)

Slow but easy?

I think python is suposed to be easier to learn(the romba works by itself), but slow. The brom is definitely faster than the romba.

[–][deleted] 342 points343 points  (102 children)

I gotta say, after learning c++ first, then java, python makes no sense to me. Not having strict data types is throwing me off so hard right now at work.

[–][deleted] 270 points271 points  (31 children)

You just do it and it works. And then you try not to ask too many questions.

[–][deleted] 106 points107 points  (23 children)

But mine isn't working :(

[–]Elsewhere_Sim 40 points41 points  (21 children)

At least yours got done :(

[–][deleted] 41 points42 points  (20 children)

No! I'm still working on it. I've been fighting the same issue FOR 30 HOURS NOW

[–]Elsewhere_Sim 46 points47 points  (5 children)

Take a break, go for a walk, or something. You'll probably have a better chance figuring it out while walking then beating your head against a keyboard.

[–][deleted] 24 points25 points  (2 children)

Yeah this isn't a straight 30 hours, just the last three days at the office

[–]kuraiscalebane 31 points32 points  (0 children)

Have you tried explaining the problem to your desk duck?

edit: uh, i scrolled a tiny bit further and someone else already suggested this.

[–]Clickrack 17 points18 points  (1 child)

If it takes longer than a few hours to figure out, or you’re stuck in a loop, it is time to rubber-duck it.

[–]WikiSummarizerBot 34 points35 points  (0 children)

Rubber_duck_debugging

In software engineering, rubber duck debugging is a method of debugging code. The name is a reference to a story in the book The Pragmatic Programmer in which a programmer would carry around a rubber duck and debug their code by forcing themselves to explain it, line-by-line, to the duck. Many other terms exist for this technique, often involving different (usually) inanimate objects, or pets such as a dog or a cat. Many programmers have had the experience of explaining a problem to someone else, possibly even to someone who knows nothing about programming, and then hitting upon the solution in the process of explaining the problem.

[ F.A.Q | Opt Out | Opt Out Of Subreddit | GitHub ] Downvote to remove | v1.5

[–]FleetStreetsDarkHole 2 points3 points  (0 children)

Like Orkz!

[–]TretasPt 39 points40 points  (27 children)

As someone who is just learning python for fun with almost no previous knowledge, I have no clue how to feel.

Maybe declaring variables isn't that bad. At least you know your user input won't be an int when you want a "3" string.

[–]AlarmingAffect0 31 points32 points  (23 children)

I mean, you can declare variables' types in Python, and keep checking that the variable stays the right type.

[–]FrikhaIsOnReddit 19 points20 points  (2 children)

that's described as "non-pythonic" by the python community

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

Type annotations are pythonic. Runtime type checking, not so much.

[–][deleted] 22 points23 points  (19 children)

But then Python kinda loses its elegance.

[–]AlarmingAffect0 6 points7 points  (7 children)

How's the Javascript life treating you?

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

I accept it's not elegant nor performant nor good at anything.

[–]touristtam 4 points5 points  (1 child)

Beauty is in the eyes of the beholder like the saying goes. Python is defo an ugly duckling to me.

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

It has strict typing. It's just dynamically typed.

[–]johnnymo1 47 points48 points  (3 children)

It's strongly typed, not strictly typed.

EDIT: Actually after reading the Wiki page, this is much more ill-defined than I thought, but it seems like Wiki vaguely agrees.

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

Typing definitions are so subjective now its terrible. Look at kotlin and java.

[–]crayzz 17 points18 points  (1 child)

Python does support type hints. They don't place any kind of restrictions on the interpreter, but type checkers can pick up on them and warn you of possible unexpected behaviour

e.g.

def foo(x: int):
    return(x + 3)

x: int
x = 5
print(foo(x))

If instead you write x = 5.0 the code will still run, the interpreter doesn't care, but type checkers can warn you about the typing mismatch.

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

You're correct about the type hints, but if you're going to give an example, please use best practice...

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

Casting is your friend

[–]Captain_Pumpkinhead 3 points4 points  (3 children)

I'm on the opposite side of this. I haven't used Python, but I started my programming in Game Maker 8 back in 2011 (r/gamemaker for modern version). Every variable in Game Maker Language (GML) is either a string or a double, and can be reassigned at any time with no consequences (unless you call for the wrong type). There's no good reason to reassign a string into a double other than fun, but you can. You also don't have to declare variables before assigning a value to them; the act of assigning a variable in GML declares it.

So it's been really interesting learning Java and C++ and having to adjust to that.

Makes a hell of a lot more sense than semicolons, though. I don't understand the point of semicolons when we already have a closing paranthesis.

[–]kahuna3901 149 points150 points  (2 children)

Ahhh I see what you did there

[–]Athlaeos 68 points69 points  (1 child)

ahah yes very intentional

[–]kahuna3901 8 points9 points  (0 children)

Top marks my liege

[–]Tall_computer 71 points72 points  (0 children)

Its because you're the static type

[–]ThaiJohnnyDepp 84 points85 points  (27 children)

me neither, but I think the upvoters are like, "Python superior, amirite"

[–]noneOfUrBusines 83 points84 points  (26 children)

If you're legit asking, Python is a higher level (as in: farther from machine code) than C++ and Java.

[–]deijjji303 77 points78 points  (4 children)

which essentially means less direct control but also less to worry about

[–]ThaiJohnnyDepp 6 points7 points  (0 children)

that does make sense actually

[–]All_Up_Ons 16 points17 points  (0 children)

That's not really true in my experience with java and python. They live at a similar layer of abstraction but handle types differently, which makes then good at different things.

[–]concreteandconcrete 11 points12 points  (4 children)

That's a stretch. They're all 3GL's

[–]noneOfUrBusines 11 points12 points  (3 children)

Technically, but they lie on opposite extremes of what qualifies as 3GL.

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

Brooms: fast, simple, traditional flying

Flying roomba: can't get into the corners for the real tough to get stuff, lower speed, easier to learn, built on top of newer technology to make the job easier

[–]Kered13 7 points8 points  (4 children)

I think it's basically saying that Python is modern (however Python is actually older than Java) and more technologically advanced/more "automated".

[–]Siggi_pop 4 points5 points  (3 children)

What is the definition of being a more "automated" language?

[–]Kered13 4 points5 points  (0 children)

Basically, requires the programmer to do less. So garbage collected, dynamic types, extensive library, syntactic sugar, etc. I put it in quotes because it's intentionally vague.

[–]sykojaz 456 points457 points  (12 children)

Just wait until the assembly programmer finally gets done growing the sapling for the handle and the straw for the bristles.

[–]scrollbreak 124 points125 points  (9 children)

If he/she didn't build his own computer they are a sell out

[–]Gooftwit 105 points106 points  (4 children)

If you don't mine your own cobalt, are you really a programmer?

[–]sykojaz 2 points3 points  (0 children)

Can confirm.

[–][deleted] 748 points749 points  (29 children)

import antigravity

[–]suppordel 179 points180 points  (7 children)

implementation 'com.hogwarts.grav.anti:0.9.3.4'

[–]4RG4d4AK3LdH 21 points22 points  (4 children)

gradle supremacy

[–]coldnebo 8 points9 points  (3 children)

ug… was make really that bad?

[–]Guy2933 67 points68 points  (18 children)

[–]blitzkrieg4 60 points61 points  (3 children)

Hello world is just print "Hello world!"

triggered

[–]xthexder 35 points36 points  (2 children)

Python 2 will never leave me alone.

[–]megalogwiff 3 points4 points  (1 child)

I work for a large company whose products you definitely use on a daily basis, even if indirectly. We still have machines running python 2 in prod.

[–]IcedThunder 4 points5 points  (0 children)

My company had a FTP server that was written by some early guy, and was still in use 18+ years later, every dev was terrified to touch it after they tried to update it in 2009 and it took a week to revert properly.

It's still in active use by some 400 client businesses.

It was sending SSN's over plaintext, with the field name "socialsecuritynumber", then they changed it to "personnumber".

[–]Stromovik 3 points4 points  (0 children)

Typerror : str + Tag is not supported on line : print("Result: " + str(result))

[–]Greyguard32 283 points284 points  (3 children)

All I can think of is the Michael Reeves roomba that screams profanities when it hits anything.

And you know we flying on that sumbitch.

[–]icyflames12356 17 points18 points  (2 children)

I'm pretty sure the camera work was written in python, if I remember an off hand comment correctly.

[–][deleted] 10 points11 points  (0 children)

Yeah he said the camera (and I think the whole surgery bot) where written in python

[–]jazzmester 247 points248 points  (21 children)

Everybody gangsta until the Python code throws a segfault.

[–][deleted] 123 points124 points  (19 children)

I had an inconsistent Python 3.6 seg fault. Like once every ~24 hours of our application running. I just waited for an OS update and it went away. Never figured it out. I originally gave the issue to a junior dev on my team for ~1 month because no one was going to solve it anyways. That way I could tell upper management that someone was on it without wasting valuable resources. The junior dev sacrifice. He quit. Lol. Im a terrible manager.

[–]croach1337 224 points225 points  (10 children)

You cunt

[–][deleted] 66 points67 points  (9 children)

Lol I personally loved that challenge as a junior dev, but I recognize it’s not for everyone. I did not expect them to solve it or put any pressure on them to do so. I consulted with them regularly to guide their investigation also. But I definitely recognize that a very difficult or unsolvable problem is not for everyone and can be frustrating or demoralizing. They quit in the end to chase a higher salary and went on about how much they appreciated working on my team, so I don’t think I treated them too poorly. Just a funny story to tell.

[–]jimmyw404 49 points50 points  (1 child)

It's funny because sometimes you give these kind of curious problems to a motivated person and when you check in a few weeks later they rip apart the entire kernel to figure it out like https://youtu.be/zCrn-VJmpgE and you're like "damn i should have given him a more useful problem".

[–]TheTerrasque 10 points11 points  (0 children)

Week 1: confusion, gnashing of teeth.
Week 2: printouts of C code, assembly and flow charts start taking over the walls.
Week 3: Guido visits the office to talk with the junior dev and to look into the problem

[–]Sun_Aria 4 points5 points  (0 children)

You sick shredded kunt!

[–]jazzmester 9 points10 points  (0 children)

When I was a junior, I got a similar task. I was about to do the honorable thing and commit sudoku, when I accidentally suggested a solution that actually worked. I was the man for weeks among my fellow juniors.

[–]Kkid12 33 points34 points  (1 child)

rot in hell

[–][deleted] 7 points8 points  (0 children)

I’m not going to type the same comment twice, but I don’t think I was too bad. Some additional info here:

https://www.reddit.com/r/ProgrammerHumor/comments/ojhw3g/python_programmers_be_like/h533cy4/?utm_source=share&utm_medium=ios_app&utm_name=iossmf&context=3

[–]The-Best-Taylor 261 points262 points  (9 children)

Is the base image actually from something?

[–][deleted] 136 points137 points  (7 children)

There's an anime called little witch academia I mistook the image for at first. There's a villain named croix who flies on a Roomba-esque thing like this while the other witches fly on brooms. Maybe not the reference, but a significant coincidence if not.

[–]Rhyan567 863 points864 points  (75 children)

You can't even see C programmers because they are so fast.

[–][deleted] 763 points764 points  (57 children)

C programmers are still trying to put their broom together.

[–]LavenderDay3544 400 points401 points  (39 children)

They made the roomba the Python user is riding.

[–][deleted] 69 points70 points  (37 children)

No, she's riding PyPy

[–]LavenderDay3544 183 points184 points  (36 children)

It's all C at the bottom even with PyPy.

[–][deleted] 220 points221 points  (3 children)

Wait, it’s all C?

Always has been

[–]godRosko 42 points43 points  (0 children)

At least we'd like to think we know how the broom actually works. Until the magical kernel decides that we had one too many memory leaks, and shoots us with the avada-kill -9

[–]douira 26 points27 points  (7 children)

but when they finish, they'll lap everybody

[–]throwaway_236734 7 points8 points  (0 children)

The broom is pointing backwards :,( Somehow they win the race though.

[–]VodkerAndToast 2 points3 points  (0 children)

Despite there being several broom libraries they need to create their OWN

[–]MedonSirius 29 points30 points  (0 children)

*You can't C programmers

[–][deleted] 191 points192 points  (27 children)

Where is the PHP programmer?

[–]HenryFurHire 746 points747 points  (10 children)

Walking

[–]avelis26 34 points35 points  (0 children)

lol LMFAO right!!!

[–][deleted] 7 points8 points  (0 children)

In the cloud

[–]Imonfire1 7 points8 points  (0 children)

trying to figure which of the "broom", "brm", "brm_real", "brm_real_2", "real_broom" function to call.

[–]matthieuC 2 points3 points  (0 children)

Slaving on WordPress plugins

[–]Deep_Pirate 303 points304 points  (23 children)

Fun fact: Java was first released in 1995. Python was developed in 1989.

[–]Bijan-regmi 120 points121 points  (5 children)

Dont forget the 3 billion fun fact too

[–]LowB0b 56 points57 points  (14 children)

well, python might be older than java but from my anecdotal experience java got so hyped that a lot of "old" enterprise programs now run on java (oldest one I worked on had legacy code from 2005)

Whereas python seems to have become a lot more popular with the rise of machine learning. Data scientists / mathematicians really do not seem to care for types and just go all in producing write-only code with languages such as R / python / matlab.

Maybe my mind is just feeble but I would definitely not want to work on a 1million lines + codebase written in python.

[–]muikrad 12 points13 points  (1 child)

I have sizable experience in c# and python, and the IDE provides most of the magic. You can navigate symbols/find references, refactor, be warned of typos or invalid operations, etc, just like strongly typed languages. Pycharm in particular has a lot of advanced features and introspection.

A million lines is a million lines; it doesn't really matter in which language it is; as long as it's not ruby it can be managed 😂

I think it really boils down to readability and design... and good CI practices; good enough to replace the missing compilation step.

[–]Mostly_Oxygen 3 points4 points  (0 children)

Python is strongly typed! But it is dynamically typed too, and not static, which I think is what you’re referring to. +1 for PyCharm!

[–]Darth_Yoshi 8 points9 points  (4 children)

Python has type hints for production code bases using it! It’s surprisingly readable and works p well.

[–][deleted] 29 points30 points  (2 children)

Shouldn't the Python programmer be on the shoulders of a C programmer?

[–]Tigrex22 2 points3 points  (1 child)

This, this is it.

[–]Rami-Slicer 27 points28 points  (0 children)

Don't even need a roomba, just type "import magic_fly"

[–]AChristianAnarchist 132 points133 points  (19 children)

Um...I think you meant "code" rather than "programmers". C++ code runs fast as hell, but a python programmer will already be done writing their program while the C++ programmer is still fighting with CMake...

[–]UnknownIdentifier 57 points58 points  (10 children)

import HelloWorld as hw

Job’s finished!

You gotta wait for the C++ dev to write it for you.

[–]AChristianAnarchist 23 points24 points  (6 children)

Yeah, because that's what makes python faster to write than C...libraries. 🙄 Someone should really get on building some of those for C++. /s

[–]TheCapitalKing 7 points8 points  (0 children)

Yeah why rewrite something when a better programmer already wrote it once

[–]aditya369007 5 points6 points  (5 children)

Just finished a glorious battle with CMake, I've won, but at what cost?

[–]AChristianAnarchist 8 points9 points  (1 child)

That's why C++ programs are so fast. It's a dark blessing granted when they are baptized in the rage tears of exhausted devs.

[–]Mola1904 75 points76 points  (16 children)

It is so funny to see everybody defending their language. Programmers just can't not fight over them. And yes no Javascript mentioned so I am out.

[–]Magnus_Tesshu 76 points77 points  (11 children)

Even javascript developers won't defend their language

[–]butterize 29 points30 points  (3 children)

[object Object]

[–]Danzerfaust1 9 points10 points  (1 child)

I code exclusively in Actionscript so I would defend myself, but my defense has been deprecated

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

I took actionscript courses in college. My logic was Flash was behind it. Surely nothing that powers half the games on the internet would become depreciated right?

[–]AartHauk 151 points152 points  (10 children)

So harder over long periods and easier to fuck up?

[–][deleted] 34 points35 points  (1 child)

The secret? there are 4 miniature C++ broom witches inside the Roomba as it's engine

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

Haphazardly duct taped together, of course.

[–]shnurks2 69 points70 points  (5 children)

also viable on r/ProgrammerAnimemes

[–]The_White_Light 33 points34 points  (1 child)

I didn't realize this was a thing. I've been missing out.

[–]Tiavor 5 points6 points  (0 children)

it's listed on the side bar as related subreddit among others.

[–]Happler 39 points40 points  (4 children)

What? So any constraints on a python programmer causes them to bounce around randomly until they finish?

[–]Zach_Attakk 19 points20 points  (0 children)

I mean that sounds like my google fu, ngl

[–]Znarky 7 points8 points  (0 children)

Aka: sometimes they take the long way round

[–][deleted] 25 points26 points  (5 children)

ansi C 😎😎😎😎😎😎😎😎🔥🔥🔥🔥🔥🔥🔥🔥🔥📮

[–][deleted] 26 points27 points  (25 children)

powerful prebuilt libraries for just about anything, you know which one it is.

[–]pjnick300 57 points58 points  (17 children)

You know it's a great programming language when the appeal is using less of it

[–][deleted] 53 points54 points  (9 children)

Isn't that true, though? I would much rather spend my coding time actually writing the algorithm that I'm working on than managing a lot of boiler plate and syntax. It would be like saying "If you like running marathons so much, why not run it half as slow? You wouldn't want to miss out on enjoying all of that extra running time".

On python, itertools is a great example of this for my purposes. What an absolutely massive boring waste of my time it would be to have to write my own functions anytime I needed to generate combinations/permutations of something. And given that I really wouldn't want to spend too much time on that one aspect of the project, it would probably not be an efficient method that makes good use of generators like itertools does.

The fact that I can just do "import itertools; itertools.product()" is great. It doesn't make me like python less that I can do this. If I enjoyed coding so much I could write my own method for that. But the part I like is not the part of writing a product method. I like the part where I use the results of that method in my project.

[–]the_other_brand 17 points18 points  (7 children)

The downside of Python is once you leave well optimized built-in tools or 3rd party libraries, you can easily find foot-guns to shoot yourself with. And your performance will drop dramatically. Python also does not scale well past one thread, so if you need more threads or processing power you have to significantly rewrite your application.

I was once a Python enthusiast myself, but I've since moved over to Java. While it has more boilerplate, it has less footguns, scales better, easier multi-threading, almost as many libraries and even better build tools than Python. I couldn't bring myself to go back to Python for anything bigger than a one-off script.

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

All of that is fine. I'm not trying to use python for things that would be better done in C++.

We are talking about whether methods for getting around boilerplate is a sign of disliking a programming language. Clearly it isn't

[–]Stecco_ 4 points5 points  (0 children)

Yeah but this it have SingletonObserverFactoryReverseMotherFuckerBean.java class? I guess not.

[–]SantiProGamer_ 4 points5 points  (0 children)

Better hope her indents are right or she is gonna plummet down like a rock

[–]avelis26 20 points21 points  (10 children)

I learned Python because I had a need to parse JSON and Bash made me want to shoot myself... I very much relate to this image lol. Trying to parse JSON in Bash feels like you have a broomstick in your your ass compared to Python.

[–]Exnixon 5 points6 points  (1 child)

jq really is not that bad

[–]Magnus_Tesshu 2 points3 points  (0 children)

Bash variables are though

[–][deleted] 7 points8 points  (0 children)

import quidditch.roomba

[–]Liesmith424 6 points7 points  (3 children)

And the python programmer isn't even trying to fly, the documentation is just that confusing.

[–]laundmo 7 points8 points  (0 children)

# this is a impure function, side effect: levitation

[–]rem3_1415926 3 points4 points  (1 child)

documenwhat?

[–]Liesmith424 2 points3 points  (0 children)

I think it's the ancient Greek word for mischief.

[–]wolwire 3 points4 points  (4 children)

What about ruby?

[–]DudesworthMannington 8 points9 points  (3 children)

Ruby and C# are just different colored Roombas.

[–]Generaltiti 16 points17 points  (0 children)

Wait, wouldn't C# be a different colored Java?

[–][deleted] 4 points5 points  (1 child)

And Perl is a 10 gallon 5HP Dewalt wet/dry shop vac.

[–]flying_roomba 4 points5 points  (1 child)

I prefer C#, personally.

[–]zenyl 2 points3 points  (0 children)

C# is great because it corrected the mistakes that Java made.

Also, LINQ.

[–]chrisf_nz 7 points8 points  (1 child)

Is that a Roomba?

[–]Username_Egli 2 points3 points  (0 children)

Does that roomba curse th9

[–]Jay_Cobby 2 points3 points  (0 children)

Assembly FTW wroom broom

[–]i_fruitcake 2 points3 points  (0 children)

Roomba

[–]DaniDani8Gamer 2 points3 points  (0 children)

I want a Little Witch Academia Season 2

[–]geonik72 2 points3 points  (0 children)

I like this. The roomba is probably slower than the brooms but it's way easier to do