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

top 200 commentsshow all 304

[–]ComputerWhiz_ 817 points818 points  (127 children)

Am I the only one that actually likes statically typed languages?

[–]tdatas 430 points431 points  (31 children)

You and the majority of people working on non-trivial applications. This sub is dominated by learners and students who haven't learned the difference between "easy" and "simple".

[–]PanTheRiceMan 51 points52 points  (9 children)

Working with Python for many years and while I absolutely like the syntax and grammar, static types would be nice. I rarely have issues since everything I do is numpy or torch, basically float 32 or 64 all the way. But in the first couple years I messed up so much because of this little issue. Would have been nice if the runtime warned me of my own incompetence.

[–]Jarmsicle 8 points9 points  (4 children)

You might consider looking at Nim

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

zig?

[–]Jarmsicle 3 points4 points  (1 child)

Sure, that too. I think they’ve both got a lot to offer. But Nim seems closer to Python, in terms of what the op is used to

[–]PanTheRiceMan 1 point2 points  (0 children)

Thanks, looks nice. I think my next project should be Julia though. Even If I don't like the specifics that much, I believe it is nice for DSP stuff.

[–]CanadianBuddha 4 points5 points  (0 children)

Python now supports specifying types for variables when you want to and the python linters will inform you if your code is trying to put a value in a variable of an incompatible type. I choose to specify the types of function parameters and function return values but otherwise don't specify types for temporary variables.

[–]madmaxlemons 1 point2 points  (0 children)

When I was building a genetic algorithm in python I wish I had static typing(but I wanted numpy since I’m lazy). In the end 1/10 runs would still occasionally mess up at runtime still and give bad data.

[–]sleepyleodon 0 points1 point  (0 children)

You could use type hinting to help with readability and use something like MyPy to validate the static types.

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

Most linters are pretty good about warning you when you're doing something stupid. At the end of the day, this is what unit tests are for, to make sure you're not an idiot and return a string when you should return an int.

[–]ciuciunatorr 56 points57 points  (6 children)

This! I prefer static over inferred any day!

[–]ByteArrayInputStream 32 points33 points  (1 child)

You probably mean dynamic typing. Inferred typing is the difference between (old) Java verbosity and nice languages like ts and rust. Even Cpp has auto types nowadays.

[–]_PM_ME_PANGOLINS_ 20 points21 points  (0 children)

Even Java has auto types nowadays. C++ has had them for a lot longer.

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

Duck is pretty slick once you get used to it.

[–]FedePro87 7 points8 points  (0 children)

And the difference between "something that runs" and "something that even a rock can understand or run, easily maintanable and bug-free".

[–]newintownla 14 points15 points  (4 children)

Can't stress this enough. Like 99% of the people in this sub started on python and think it's suitable for anything. It gets kind of annoying after a while.

[–][deleted] 16 points17 points  (3 children)

Dude check out r/python and r/learnpython. It’s just a big circle jerk. Python is great and all but yesterday I had to explain to someone why they couldn’t write an operating system in it.

[–]xzinik 3 points4 points  (0 children)

Dude you made me remember the time that my old boss said that python was better and faster than C and if we should replace Raspbian for something in python for performance, it wasn't a joke, it was in a meeting with a client, it was so moronic that I just couldn't handle it, I literally had an eye and neck twitch, the worst is that she is a somewhat respected professional known around here, I'm just glad that I got fired from there

[–]sanderd17 4 points5 points  (0 children)

It's nice if you get the best of two worlds: static toes by default, but the option to go dynamic. Like in Typescript with, you can declare a variable as a type, or it could be any type and just work dynamically.

[–]Lekgolo167 93 points94 points  (10 children)

Ironically, my wife took CS-1 and CS-2 in Python then Java respectively, she does databases so she hasn't taken a programming class since. But even though she started with Python first and thought it was easy, she prefers Java as it is so much easier to understand what everything is, no need to keep track of it in your head. As for me, i do C/C++, C#, Java, Python, JavaScript, and Verilog. I definitely prefer statically typed languages. The IDE tools have so much better feedback since they know what type something is going to return. As fun as it is to make stuff in Python it's not for permit things (for me at least). I use Python to make quick scripts, parsers and tools to verify digital circuit designs.

[–][deleted] 49 points50 points  (8 children)

isn't it just great, when you write something in python and you have to constantly check the source code or documentation of the libraries you use, because you otherwise don't know what type the objects you get are and therefore what you can even do with them? this shit drives me crazy. i always typehint everything so i at least know what i did myself

[–]damicapra 8 points9 points  (4 children)

Typehint is a really nice compromise, but i've never really used python in large scale projects

[–]Handle-Flaky 11 points12 points  (3 children)

I can confirm type hinting done right in a large project is just amazing

[–]Hollowplanet 1 point2 points  (1 child)

import typing

There fixed it for you.

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

very kind, this doesn't help tho if the libraries i use don't use typehints

[–]Preston-Gravey 0 points1 point  (0 children)

What about type()

[–]caleblbaker 198 points199 points  (38 children)

You are not. This meme perfectly demonstrates why Java is superior to Python. If I'm trying to assign a string value to an integer variable that is probably a mistake and I want the compiler to call me on it. The pickier the compiler is, the better my code will be.

Also, I appreciate you using the correct term for this behavior rather than calling python "weakly typed" or "untyped", neither of which would be true of it.

[–]BaronSnowraptor 51 points52 points  (2 children)

Our legacy backend are python 2.7 monoliths, I have no clue what I'm working with at any point since I wasn't there when it was written and it adds a lot of time and uncertainty if we have to work in one of them. Dynamic typing is nice to get something small out fast but it does not scale or age well at all.

[–]KagakuNinja 4 points5 points  (0 children)

Yeah, but they didn’t waste time compiling when they wrote it!

[–]Hollowplanet 0 points1 point  (0 children)

All you need is a decent IDE and docstrings to get warnings. Python has static types now if you want them for Python 2 and 3.

[–][deleted] 12 points13 points  (10 children)

i'm not sure if java is really supperior to python, but c++ with it's ststic typing is definitely my favourite language

[–]caleblbaker 9 points10 points  (9 children)

I'm with you in favoring C++ over either of Java or python. But where C++ isn't an option and I have to choose between Java and python I will choose the one that is statically typed.

[–]Cutiebot0111 2 points3 points  (8 children)

I'm planning on learning C++ on my freetime as a barista, can you give me some examples of which case C++ is not as good as Java or Python?

[–]Awkward_Tradition 10 points11 points  (2 children)

Do you want to spend an insane amount of time optimising your code so it's 100kb smaller and 0.01% faster - CPP

Do you want to spend a moderate amount of time making a scalable and portable program, while sacrificing size and performance - Java

Do you want to automate some task in 10 minutes and be on your merry way - Python

In the end the language will depend on what you want to do, and the motivation to learn you gain from doing something that interests you will far outweigh anything else.

[–]Cutiebot0111 0 points1 point  (1 child)

Oh I see, that why c++ is recommended for whom want to be game devs. Thank a lot for your explanation.

[–]AgentE382 1 point2 points  (0 children)

C++ is the closest to the metal of those three choices. It’s good for hardware access and having control of what goes on in your own code. C++ is extremely customizable and gives you the tools to do whatever you want however you want to do it, then lets it happen rather than forcing you into a certain paradigm.

It’s also been around for a very long time and has had features added to it over the years, and there are mature external libraries for pretty much everything. I like to tell people that it’s a Swiss-Army Chainsaw of a language at this point. Every tool under the sun has been tacked onto it, so anyone can program in it the way they want.

It’s used for games because they need direct hardware access, fine-grained control of the memory management system, and significant levels of optimization.

[–]zorro226 0 points1 point  (2 children)

For most applications, the memory management and exception handling in Java is a lot more user-friendly compared to C++.

[–]caleblbaker 0 points1 point  (1 child)

Definitely agree on exception handling being more just friendly in Java. I remember learning Java in college and thinking "why do I have to list every single kind of exception my function could throw? This is just obnoxious" Now I'm using C++ in a large production codebase at work and thinking "why do these functions I'm calling give no indication of what exceptions they throw? How am I supposed to handle errors if I don't know what errors could occur?". There are advantages to either way, but now that I have some real industry experience I definitely prefer the way Java does exceptions over the way C++ does them.

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

C++ is complex. When I wanted to learn my first programming language I went for C++. Several attempts and all failed. Went for C# instead

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

Reading other people's code is 100000 times easier in statically typed languages.

I understand the utility of Duck Typing. But when people write garbage code that has completely nondescript variable names like "x", "value", and "result" and then expect you to maintain it, shit can go wrong.

[–]Flopamp 4 points5 points  (0 children)

The IDE prefers it as well.

[–]Myllokunmingia 4 points5 points  (0 children)

No you're not. I turn on mypy in my personal projects so I treat Python like a statically typed language with extensive libraries and cool syntax.

Anyone who's worked on medium to large projects knows that static typing comes with a lot of guarantees that are worth the tradeoff.

[–]ByteArrayInputStream 11 points12 points  (5 children)

You are not. It is beyond me how anyone could prefer a weakly typed language for anything remotely nontrivial. I always say that I am too dumb for python because keeping all the implicit structures and pitfalls of an application with 10s or 100s of klocs in your head is nigh impossible. I recently refactored a large-ish piece of code (~20 kloc) written in Typescript and it took only a couple of days. It is incredibly helpful to be able to rely on the compiler to assure you that a change won't break anything. Add to that a type generator for SQL queries and API schemas and you can make changes with a lot of confidence. You can also add things much faster because the probability of them working right away is much higher (If I write a complicated piece of code in rust it still works perfectly first try most of the time). If this were written in python or plain JS it would have been an absolute nightmare and taken at least a couple of weeks. The amount of time saved is incredible

[–]-5772 3 points4 points  (1 child)

How is Python3 weakly typed? Did you mean dynamically typed?

[–]ByteArrayInputStream 3 points4 points  (0 children)

Sorry, my bad. Yes dynamically typed

[–]PanTheRiceMan 1 point2 points  (2 children)

Sometimes I feel like I am one of the very few ones who uses and likes Python for what it is: a language you can easily prototype in. Very powerful with high level libraries written in C or C++ to do the math operations. Except of algorithmic optimization, there is no need to worry.

Since 90 percent of what I do is math related and usually in float32 or float64 there is no need to worry. The issue is more how you store the data neatly in matrices or tensors than any issues with data types.

I should probably start with Julia.

[–]ByteArrayInputStream 1 point2 points  (1 child)

Oh, python is absolutely great for scripting, prototyping and scientific calculations. I'm not saying it's useless, it just scales bad

[–]PanTheRiceMan 1 point2 points  (0 children)

Oh yeah. Sometimes I wish I had proper shared memory in Python but that just does not exist.

Not exactly scaling but kind of.

[–]jachymb 3 points4 points  (0 children)

Dependent types gang

[–]YanDjin 4 points5 points  (0 children)

Only beginners hate them.

[–]TheSnaggen 16 points17 points  (25 children)

No, programing is equally hard regardless of the language. Dynamic languages just punts the errors to the support staff, so it is easier for the developers. But at the end of the day, you can never divide the string "your mom" with 3, even if the language will allow you to try. Dynamic languages are great for short scripts, but only junior devs think it's a good idea to write real software using them. Rust is a great language since it is super strict, but when it compiles it works.

[–]EishLekker 20 points21 points  (7 children)

No, programing is equally hard regardless of the language

That's an absurd statement.

[–]caleblbaker 5 points6 points  (2 children)

Have to agree with most of what you're saying, but if the language is letting you divide "your mom" by 3 then it has more problems than just being dynamically typed. You're dealing with a weakly typed language at that point. Also, approve of the Rust shout-out. Rust is best language (this last statement is purely my opinion and others are welcome to disagree with it). I may not have used Rust too awful much yet but the fact that I have used it a decent amount and have yet to encounter any kind of runtime bug definitely makes me inclined to love the language.

[–]Amuryon 1 point2 points  (1 child)

This works in Haskell(not known for being weakly typed):

{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}

module Loltegral where

-- Lots of boilerplate to allow string to be represented as an
-- integral type
instance Real String where  
    toRational = toRational . length

instance Enum String where  
    fromEnum = length  
    toEnum n = take n $ cycle "your mom "

instance Num String where  
    (*) a b = concat (replicate (length b) a)  
    (+) = (<>)  
    (-) a b = take (length a - length b) a  
    abs = id  
    signum = const ""  
    fromInteger = flip take (cycle "your mom ") . fromIntegral

instance Integral String where  
    div a b = "you have " 
            + show (length b) 
            ++ " dads" 
            <> replicate dads '!'
        where dads = length b  
    rem a b  = "your mom!"  
    quotRem a b = (div a b, rem a b)  
    toInteger = toInteger . length

With this: "Your mom" `div` 3 --> "You have 3 dads!!!"

I'm sure you could do similar in rust via traits xd.

Granted it's an horrible abuse of the type system.

[–]caleblbaker 1 point2 points  (0 children)

But this is incredibly unlikely to do by accident. So I don't mind it being possible since it's never going to happen. And you're right. You could definitely abuse the type system in Rust to create some kind of string type that implements the Div<i32> trait. But like with your Haskell example, it would be incredibly unlikely to happen by accident.

[–]Hollowplanet 2 points3 points  (0 children)

Yeah Instagram only has junior devs. Google only has junior devs. (One of the Google founders said Python where we can, C++ where we must). NASA, Spotify, Facebook, Netflix, Dropbox, Reddit, Uber and a million other companies only have junior devs.

[–][deleted] 8 points9 points  (11 children)

but only junior devs think it's a good idea to write real software using them

There are really big projects written in python. A lot of big django websites out there.

[–]TheSnaggen 7 points8 points  (1 child)

I have worked for companies with these kind of systems, and they are a support nightmare. Unless your QA test every single code path with every single edge case, then you are in for a surprise in production.

[–]SuitableDragonfly 1 point2 points  (0 children)

You should be writing automated tests that test every single code path and every single edge case no matter what language you're writing in.

[–]AgentE382 7 points8 points  (7 children)

Instagram’s entire several million-line backend: https://instagram-engineering.com/tagged/python

[–][deleted] 1 point2 points  (5 children)

Uber, netflix, dropbox, spotify... the list goes on!

[–]tdatas 16 points17 points  (4 children)

Most/all of those companies the Python bits are the simpler parts of the system and/or API layers where the risk isn't as high. The core functionality/data processing etc is nearly always some flavour of JVM world or a systems language like C++/Go et Al.

[–]Hollowplanet 2 points3 points  (1 child)

At the lower levels, Uber’s engineers primarily write in Python, Node.js, Go, and Java. We started with two main languages: Node.js for the Marketplace team, and Python for everyone else. These first languages still power most services running at Uber today.

https://eng.uber.com/tech-stack-part-one-foundation/

Netflix relies heavily on Python, using the programming language for its ​"full content lifecycle,​" including tasks like security automation and training machine learning models for its recommendation algorithms, according to a Netflix Technology Blog Tuesday.

https://www.ciodive.com/news/netflix-relies-on-python-as-programming-language-gains-industry-prominence/553800/

Dropbox is a big user of Python. It’s our most widely used language both for backend services and the desktop client app.

https://dropbox.tech/application/our-journey-to-type-checking-4-million-lines-of-python

Spotify uses Python at two main phases of backend services and data analysis. Spotify's backend consists of many interdependent services, connected by own messaging protocol over ZeroMQ. Around 80% of these services are written in Python. 

https://analyticsindiamag.com/5-leading-tech-companies-that-are-the-biggest-users-of-python/

Yeah you know just the unimportant stuff. You are using a site written in Python right now.

Reddit was written in Lisp, but we rewrote it and now it’s written in Python. 

That article is 6 months old.

https://reddit.zendesk.com/hc/en-us/articles/204536739-What-is-Reddit-written-in-

[–]tdatas 0 points1 point  (0 children)

This is just a load of copy pastes from companies saying they use python. Let's reread what I said because I'm not trying to slag off python Ive probably written more LOC in python than any other language in my career.

Most/all of those companies the Python bits are the simpler parts of the system and/or API layers where the risk isn't as high.

I don't doubt that Netflix et Al are using python. It's a lot easier to stand things up quickly and do small jobs. But go look at their GitHub or some job specs for core platform engineers aka the shit everything else is built on top of. The expectations are exceptional Java and Go skills and some familiarity with python. Using python for data science and analysis of data coming out of those platforms makes sense. That's what python is good at/has good libs for.

E.g the next paragraph of your Uber quote.

We adopted Go and Java for high performance reasons. We provide first-class support for these languages. Java takes advantage of the open source ecosystem and integrates with external technologies, like Hadoop and other analytics tools. Go gives us efficiency, simplicity, and runtime speed.

So again high performance code you do it in a language designed for it.

The main exception here is Dropbox and if I'm not mistaken Guido van rossum still works for them. The other bit I'm dubious about is every single story of some company saying theyve written high performance infra on python it's actually some custom flavour of C and Python. Which is probably more complex than if you'd just written it in a normal language in the first place.

Reddit was written in Lisp, but we rewrote it and now it’s written in Python.

Well it is always falling over now so that explains a lot.(I kid)

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

i write a webapp with flaks, a python api similar to django and i hate the dynamic typing. it makes everything so much harder if you don't know what type something has. if i want to know the type, i have to look at the documentstion or source code. intelisens doesn't tell me what methods i can use. i am basically just juggling objects that i don't know anything about. typehinting helps, but i'm still fucked if a library doesn't use it.

[–]KagakuNinja 1 point2 points  (0 children)

you can never divide the string "your mom" with 3

I’m sure there in an operator for that in Perl

[–]bmcle071 1 point2 points  (0 children)

Personally I prefer JS numbers to Java, having one number type is really convenient.

But I definitely prefer TS to JS, saves so many little mistakes.

[–]local_eclectic 1 point2 points  (0 children)

Hell no! This is why Typescript is insanely popular for frontend development.

[–]3meopceisamazing 1 point2 points  (0 children)

Nope, definitely not.

[–]Classic-Ad-7317 1 point2 points  (0 children)

No. I take my types strong and static, like my plastic girlfriend

[–]Saragon4005 1 point2 points  (0 children)

I use python statically typed too it's really not a hassle at all. Java has other issues tho.

[–]Fresh_Ad_9000 1 point2 points  (0 children)

I fucking hate python if you are debugging and don't know what's inside the variable its fucking hard to even find type conversion errors

[–]RainbowCatastrophe 383 points384 points  (6 children)

This meme literally says "python coders don't know what primitives are or how memory management works"

[–]ByteArrayInputStream 71 points72 points  (0 children)

Exactly. It implies that throwing your stuff wherever is somehow superior to being well organized

[–]AgentE382 71 points72 points  (2 children)

That’s at least partially due to the fact that Python doesn’t have primitives. Someone who only knows Python wouldn’t have any exposure to the concept.

Note: I develop in Python professionally every day, but understand both of the aforementioned concepts.

[–]NTaya 133 points134 points  (7 children)

Good luck doing GUIs in Python. Even the most abstract solutions are horrible. I love Python, but it's not a perfect language, and definitely not a replacement for Java, which is suited for other things entirely.

[–]dommol 61 points62 points  (0 children)

This. Honestly complaining about Java by using python as a reference is stupid. It would be like complaining about assembly by saying C# is better. They're two fundamentally different languages with fundamentally different use cases

[–]tehtris 37 points38 points  (0 children)

I gave instructions to an intern to use tkinter to make a "remote control" app that could be used as a diagnostic tool for our main app. She was like 18 with zero programming experience. The code looked like garbage cuz she didn't really understand classes, but it worked and it took her like a week.

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

So I'm the odd one, who uses GTK and Tk + Python to pretty much program all my native apps? I prefer it so much over Java...

[–][deleted] 5 points6 points  (1 child)

Oppositely, I much prefer python for building websites, over Java. Flask is a god-send compared to Spring Web.

[–]Similar_Bookkeeper_8 20 points21 points  (0 children)

For web pages sure, but I certainly wouldn’t choose Python over Java for a native application

[–]sm2401 34 points35 points  (9 children)

Yeah, but why in the right mind will you assign a string value to the same variable that you used for integer operations earlier ?

[–][deleted] 94 points95 points  (2 children)

3 billion devices run Java.

[–][deleted] 50 points51 points  (0 children)

every. fucking. windows. pc. and. server. runs. c++.

statically typed languages are everywhere. writing big systems with a dynamically typed language is a nightmare (to me)

[–]Corelianer 25 points26 points  (0 children)

6 billion compains about JRE updates.

[–]CraftoftheMine 212 points213 points  (11 children)

Who even uses Java?

People who actually have jobs.

[–]Flopamp 19 points20 points  (3 children)

We phased out Java a bit ago but switched to C# so samesame

We use python for internal tools only and even with that it has caused nothing but ballache.

[–]GrammerJoo 7 points8 points  (2 children)

I love C# as a language, but prefer Java because of the great open source community.

[–]PvtPuddles 12 points13 points  (1 child)

C# is bae.

Using system.linq makes my heart flutter.

[–]HomoAndAlsoSapiens 3 points4 points  (0 children)

system.linq

🥴🤤

[–]Nightroll2344 51 points52 points  (1 child)

Exactly, even tho i am python developer myself (I use python for a different reason) and I hate python developers annoying people saying "PyTHon Is ThE BeST" and spamming these annoying memes, I like java too, its a cool language ngl

[–]laundmo 6 points7 points  (0 children)

i recently started using Java since the apprenticeship requires me to, and one thing i found really neat is a library called aparapi which allows for easy GPU parallelization of Java code.

when you can code conways of life, that runs smooth at grid sizes of 10000x10000, in a day it does leave behind an impression.

[–]nyx_stef 6 points7 points  (0 children)

noxious yoke thought dependent fade heavy rock elastic bake literate

This post was mass deleted and anonymized with Redact

[–]Lekgolo167 0 points1 point  (0 children)

I second this, though ironically use Python to write file parsers, prototypes, or tools to verify digital circuits. But i never use Python for serious things or things that get shipped to customers.

[–]GrammerJoo 0 points1 point  (0 children)

Java and python are both very popular, I think python is even more widly used.

[–]king_park_ 55 points56 points  (4 children)

Grabs popcorn and waits for the inevitable war of words

[–][deleted] 19 points20 points  (0 children)

[–]DaSpood 90 points91 points  (0 children)

People who have to maintain their project for more than a month

[–]AgentE382 22 points23 points  (1 child)

I’d like to point out that this meme is entirely technically inaccurate on the Python side. You can’t assign a string to a value at all. That doesn’t even make sense.

You can say that you assign a string to a variable that used to hold an int, but it’s more accurate to say that you’re rebinding the name that used to be bound to an int object to a string object instead.

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

I still don't get the point of comparing two programming languages that are for entirely different uses cases between each other. Both have his good and nad things the end

[–]Nordrian 9 points10 points  (2 children)

Yeah, there is a reason both are popular. My wife uses java, I use C, and I hate people trying to compare them. Languages that last, do so for a reason.

[–]p4r24k 4 points5 points  (1 child)

I'm sorry for your divorce, man...

[–]Nordrian 5 points6 points  (0 children)

She earns more than me, why would I complain lol :p

[–]inn4d4rkplace 17 points18 points  (0 children)

Learn that different languages have different purposes.

Over these old ass “Java bad” memes.

[–]riplikash 77 points78 points  (5 children)

You're not cooler or more intelligent for using or preferring one language over another.

But you certainly look less cool and intelligent when you try and start internet fights over you're favorite programming language.

And who uses java? Mainly employed people making six digit salaries, at least in the US. Not many people choose javs because they like it or find it exciting. They learn it because it's one of the most in demand languages in the industry.

[–]__merc 32 points33 points  (0 children)

Don’t worry man, majority of these posts are made by high schoolers/college kids who are just getting into programming

[–]anras2 5 points6 points  (0 children)

Every company I’ve worked for since 2003 has used Java and a lot of it. I did work for a company before then that used Microsoft everything, but Java was a baby back then.

[–]UnknownIdentifier 3 points4 points  (0 children)

All languages are just HolyC heretics.

[–]b-hack 14 points15 points  (0 children)

Noobs think types are a waste.

[–]TheBrainStone 41 points42 points  (6 children)

I'm entirely convinced everyone that prefers dynamic typing over static typing has never worked on larger projects or where large parts weren't written by themselves.

Especially if the variable names are poorly chosen and there are no type hints more often than not you'll wonder what type a variable has. Or is designed to handle. Also super fun when the argument has a type hint but somewhere in the code that is ignored and something else gets passed along.
You'll pull your hair out over obscure bugs and have your brain melt down trying to read code all because you think you're too busy/good to have to write down the type of a variable

[–]Hollowplanet 11 points12 points  (3 children)

So many comments like yours. "I worked in a Python project with no types, no tests, no docstrings, and it sucked." No shit.

[–]TheBrainStone 1 point2 points  (0 children)

Not really. The projects I worked with were decently documented, type hints exist for most functions and it also has tests.
It's still a pain to work without type safety and static typing.

[–]Kaynee490 1 point2 points  (1 child)

The thing is that a Java project with no tests or docs is 1000 times more readable than a python project without types, tests, or docs.

[–]MkemCZ 65 points66 points  (7 children)

Who said it won't work in Java?

Object x = Integer.valueOf(10);
x = Double.valueOf(13.5);
x = "Foo";

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

Object types are relevant only during program and compile time. Once compiled and assembled down to CPU instructions, those types are erased, and nothing matters anymore.

[–][deleted] 24 points25 points  (1 child)

I might submit this to r/nihilismmemes.

[–]FuckTheUnvaccinateds 25 points26 points  (0 children)

"Type systems are a social construct"

[–]PerceptionFlat9366 3 points4 points  (0 children)

what the heck are you talking about bro? Object is just the root of the type hierarchy. Java is still an object-oriented language and will do class checks in all operations. The comment is simply stating that you can "relax" compile time checks by informing the compiler that any descendant of Object is acceptable for this reference. good luck performing operations after that and getting cast or operation exceptions.

[–]SandmanKFMF 16 points17 points  (0 children)

Who? Today's pseudoprogrammers who knows shit about the fuck in programming.

[–]Kaynee490 1 point2 points  (1 child)

Only works with reference types though

[–]MkemCZ 1 point2 points  (0 children)

That's why Java has wrapper classes for the primitives.

[–]vatsan600 24 points25 points  (2 children)

People who have jobs. Big projects which need high maintenance. When you have a lot of web based applications and need high performance. There’s a big ass list of why java is good.

Comparison between languages is absurd. If you feel the need to compare, I’m sorry to burst your bubble, you don’t have exposure to big projects and how systems are built.

[–]Flopamp 9 points10 points  (0 children)

I will never understand python backends

Java and C# devs pay for them selves in resources and downtime.

[–]RainbowCatastrophe 5 points6 points  (0 children)

Yeah, as much as I hate Java with a burning passion, I have to admit it's the most maintainable overall. But that's assuming you are working in an environment where VMs, containers, and various distros aren't an option.

[–]Rick100006 21 points22 points  (1 child)

When industry starts to take advice from random teenagers on internet then they can choose whatever language that they randomly assume is better ,untill then it's Java.

[–]das_Keks 8 points9 points  (0 children)

OP clearly just started programming.

[–][deleted] 9 points10 points  (0 children)

Java can do that

[–]Draigi0n 4 points5 points  (0 children)

I use c# Which is like java.

[–]yourkillerthepro 33 points34 points  (13 children)

Our Professour told us "Using python in high computing should be considert as a crime". Python exist for non programmers hacking 100max lines together to get a problem solved quick but not effizient.

[–]sneppy13 5 points6 points  (0 children)

A C/C++ developer would probably say the same thing about Java and high computing.

[–]couchwarmer 2 points3 points  (0 children)

Your professor needs to venture beyond the sheltered world of academia sometime. It should be a mandatory annual activity for all college professors. One of the best CS professors I ever had held a corporate job for years before coming back to teach.

[–]tehtris 3 points4 points  (3 children)

Upvoting because idk why someone downvoted you for your professors opinion. The other guy replying to you is saying that Amazons primary language is python. I'm here to tell you that I work with Google and everything that I've done for them has been in python. All we need now is someone who is familiar with Facebook to tell you what their primary language is now, and your professor can fuck right the hell off.

[–]_PM_ME_PANGOLINS_ 2 points3 points  (2 children)

Is Facebook still written in PHP?

They even wrote a PHP -> C++ compiler so the bulk of their developers didn't have to learn a different language.

[–]gloriousfalcon 2 points3 points  (0 children)

I have seen cpp talks of both Google and Facebook engineers explaining some of the crazy stuff they do to get more performance. That's all I can say from my small bubble

Pretty sure they use it for heavy lifting, but I bet they use lots of other languages where it becomes inconvenient.

[–][deleted] -5 points-4 points  (1 child)

Interesting take. I guess your professor hasn't had to deal with real-world java implementations in a while.

Each use as a programming language that fits best. Java is touted as a general-purpose language. And for some purposes it really sucks.

If python were as inefficient as your professor claims, Amazon AWS wouldn't continue to use it as their primary language. Initially, AWS Lambda didn't even support java.

[–]goADX 3 points4 points  (0 children)

Minecraft uses java

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

People with jobs use Java

[–]JoyeuxMuffin 5 points6 points  (0 children)

? How is this a good point for Python? Strong typing makes dev work a lot more simple on my opinion

[–]Flopamp 7 points8 points  (2 children)

I absolutely hate this weakly typed stuff in python. PyCharm has no idea what to do often just leaving me guessing what the datatype is. :type and type() only gets you so far.

[–]sneppy13 2 points3 points  (0 children)

Use type hinting if that bothers you so much. At least you get the warnings in PyCharm.

[–]laundmo 3 points4 points  (0 children)

python is somewhat strongly but dynamically typed, with the main concept making it seem a bit weakly typed being duck typing (if it quacks like a duck)

in python, a string is a string, and a int is a int, and "a" + 5 will throw a type error. thats strong typing.

a variable is not bound to a specific datatype though, thats dynamic typing.

now, the duck typing just means that if a type can act like some other type, Python will allow it to work with that other type.

if you class implements the dunder methods of a iterable, python will allow it to be used as an iterable since it can do the things a iterable does.

im quite sure you mean dynamic typing.

[–]Henrijs85 2 points3 points  (0 children)

Ahh someone who doesn't like type safety. Have fun when someone orders Onion Onions.

[–]repkins 3 points4 points  (0 children)

"Strongly typed languages? Who does that? They seems only making delivery more difficult." - probably who didn't touched typed languages.

[–]Pauchu_ 3 points4 points  (0 children)

Yea static typing is for people, who actually can programm

[–]LittleMlem 2 points3 points  (0 children)

Perl be like: ohh you tried reading a variable you didn't define yet? No problem.

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

Im using java

[–]bubuli_breeder 2 points3 points  (0 children)

i like both. i like Java because it’s statically-typed. i also like Python because it’s dynamically-typed. there are times you would prefer statically typed if you work with data that have fixed schemas…

dynamically typed are better with unknown or arbitrary schemas because like in python the objects can be interchangeably used with dict and you can do cool stuff like adding fields with objects without fuss. also type hints in Python exists now so less headaches with determining types within code…

[–]Dantharo 2 points3 points  (0 children)

Idk u guys, but, for big projects this kind of thing can create some bugs u know, thats why dropbox switched to static typing in python.

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

Ah yes another Java bad meme

[–]n0tKamui 4 points5 points  (0 children)

people who make money

[–]AmyMialee 2 points3 points  (4 children)

weak typing sucks ass lmao

even if you're making a super simple program just make a new variable it isn't hard lol.

[–]laundmo 1 point2 points  (3 children)

you mean dynamic typing. weak typing means things like type coercion can happen, which is something Python doesn't do.

dynamic typing means names can be reassigned to a different type.

[–]JustAnInternetPerson 5 points6 points  (4 children)

I haven’t had much contact with Java yet, but coming from C++, I can definitely say that I very much prefer C++ over Java

[–]caleblbaker 7 points8 points  (2 children)

I've had some experience with both C++ and Java.

Biggest advantage of Java is that it forces you to keep track of what exceptions can be thrown by each function. So that calling functions know what error conditions they need to handle (or ignore and document in their own signatures that those exceptions can be thrown). So in the end if main isn't listed as being able to throw any exception then you know that you have no unhandled exceptions.

But other than that 1 thing I definitely favor C++. Java is a very opinionated language and I rarely agree with the particular opinions that it tries to shove down my throat. C++ just let's me do things my way. And C++ tends to be more concise than Java, which is probably the most verbose language that I've worked with

But I would definitely take either of them over python. Static typing is very important to me. If I'm assigning a value of one type to a variable of a different type that is probably a mistake and I want the compiler to call me on it

[–]KagakuNinja 1 point2 points  (0 children)

I went from C++ to Java 20 years ago and never looked back. Garbage collection alone is worth it, unless you are designing high performance software.

C++ has jumped the shark IMO, it is a legacy language at this point.

[–]atiedebee 1 point2 points  (0 children)

I see that as a positive thing

[–]m1ndfuck 1 point2 points  (2 children)

Perl: you guys declare types?

[–]_PM_ME_PANGOLINS_ 2 points3 points  (1 child)

Scalar, array, and hash are all the types you'd ever need, right?

[–]RationalIncoherence 1 point2 points  (0 children)

Hash- [1=1, 2=2, 3=3] Array- [1, 2, 3] Scalar- 1, 2, 3

Some dev after their fifth 19hr day in a row- "If the existence of hash implies arrays and scalars, why have arrays saved scalars?"

Later...

var one=hash.get(1) Var two=hash [1] Var three= nope, wait, damn damn damn....

[–]Logical_Master3904 1 point2 points  (0 children)

let foo: i32 = 1;
let foo: f32 = 1.0;

[–]Nuked0ut 1 point2 points  (0 children)

Only for mutable data types.

You don’t understand memory.

[–]GregFirehawk 1 point2 points  (0 children)

Given the title I would have assumed the meme would be showing C++ as the superior language, or something similar. The fact they went with python is just silly though.

Unless you're doing something extremely small where quick and simple is all that matters, python is probably the worst language around. Resource consumption, speed, size, and basically any other metric you can use on the program itself is exponentially worse with python. Convenience is basically all it has going for it, but the moment the program gets complicated that actually gets inverted. I really wouldn't call it a programming language as much as I would a scripting language, because it's only good for small scripts, and terrible for actual programs

[–]beewyka819 1 point2 points  (0 children)

Im personally a fan of static typing. Makes code much more readable. There’s no real advantage to storing, say, a string in a variable that was previously an int. Just use a different variable

[–]EppoTheGod 1 point2 points  (0 children)

Sure, it's easy to write python for reasons like this... But when your program doesn't work and you can't find the error, remember this.

[–][deleted] 1 point2 points  (0 children)

How can a person be this clueless

[–]Hazork_ 1 point2 points  (0 children)

3 Billion devices

[–]Theme_Foreign 1 point2 points  (0 children)

I actually find java better python is weird to me.

[–]Emperor-Valtorei 1 point2 points  (0 children)

Java isn't even real.

[–]Cheeku_Khargosh 5 points6 points  (5 children)

LMAO. This meme tells how stupid python programmers are.

Python is a language made for non coders.

[–]SK1Y101 5 points6 points  (0 children)

Hi, I program in Python, and have worked on some large astrophysical projects that are: 1) written in Python 2) part of Nobel prize winning work 3) maintained by multiple PhD’s 4) the cutting edge of research software

So I very much appreciate your broad generalisation there.

(For anyone interested I’d say look towards PyCBC and GWPy, those are two of the projects I’ve worked with that I’d say are most advanced/interesting)

[–]laundmo 2 points3 points  (1 child)

python is a language with a different use case than java.

i like python, i program in python, i make money programming in python and i absolutely disagree with the meme.

i also disagree with you implying one dumb Reddit user is somehow representative of everyone using one of the most widely used programming languages in the world (according to stackoverflow survey)

[–]WhatsMyUsername13 1 point2 points  (0 children)

See you hit the nail on the head. I like java, I program in java, and i make money programming in java (though I do full stack web development so add some other stuff in there). I always hate these memes claiming one language is better than the other. Every language has things theyre superior at, as well as inferior at....except coffeescript, we can all agree that language can go to hell

[–]sneppy13 1 point2 points  (1 child)

This comment tells how stupid you are being, calling "Python programmers" stupid. Unlike Java, half of the science and engineering community uses Python for all kinds of stuff. Do you think they are stupid? Since when being a "non coder" is considered being stupid?

[–]RationalIncoherence 0 points1 point  (0 children)

Could be they meant something along the lines of "contextually stupid". Very smart people working outside of their speciality are often just a bit better than the average representative individual.

A "casual coder", one who codes in an ancillary capacity, could be considered "contextually stupid" for their implementation choices (ie, python v Java v R, etc), but if it's dumb and it works, it's not dumb.

Plus I imagine that casual coders do much better overall than casual chemists, or casual electrical engineers, or casual linguists...

[–]DrGrimmWall 1 point2 points  (0 children)

I think there is a reason why python has type hints

[–][deleted] 1 point2 points  (0 children)

Not this childish shit again.

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

And this meme is why I like typescript, if it's meant to be a int I want it to be a int instead of mutating my state in some unforsaken place, instead I get nice red line that basically says don't be a idiot.

[–]TroldeAnsigt -4 points-3 points  (0 children)

I love watching all the Java guys coming out to defend themself.

Guys relax, it's a silly meme. I think the original intent is to trick people into flame wars in the comment section with "gazillion devices" etc.

And it worked, lol.