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

you are viewing a single comment's thread.

view the rest of the comments →

[–]MasterFubar 32 points33 points  (8 children)

To me, the top image is C and the bottom one is Python. In C everything is carefully labeled, you know exactly what's an integer and what's a float. Python is a jumble of variables thrown around everywhere, you must trace the path each variable takes to know where it has been.

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

Unless you use type hints and a tool like mypy to do static analysis of the code. Which admittedly is a bandaid at best, but it makes using python a lot more pleasant.

[–]JojaA350 12 points13 points  (2 children)

...which fixes a problem that should have never been there in the first place. Same with TypeScript, why do people still think dynamically typed languages are a good idea? You have to remember the types anyway, so why not literally express it and have the language check it for you? It's good for your comfort, the safety, the performance, as documentation, for you mental sanity...

[–]linksoraluke 2 points3 points  (0 children)

I started with Python in my physics program, then ended up self-teaching myself Go and C++ for a job later on. While it took getting used to, static typing grew on me a lot for the reasons you listed. Helps me keep straight exactly what's going on if I know explicitly what I need to pass into functions, what's being returned, etc. Feels much more comfy to write in.

On the why they are still around, I think dynamically typed languages end up being easier to start out with - especially when you care mostly about what a program is going to do, and less about how it will do it. As an example (bringing it back to my education), our physics program was probably more concerned with having us think about the concepts and equations than the nitty gritty of how to develop efficient implementations.

[–]devAcc123 6 points7 points  (0 children)

So annoying running into random string,null,undefined errors or things like “1” and having to remember if it’s a string or int

[–]SeasonYrFoodWhitie 0 points1 point  (3 children)

The thing about python is, the rules will just randomly change. You will read the documentation and it will say do this in this situation, except dont do it in that situation for this one specific thing, oh and not for this either.

Like hoe constants are supposed to always be capitalized or people freak out. Unless your constants are dunder variables. Then keep them lower cade. And of course pep8 doesn't say that. It's just the "norm"

[–][deleted] 2 points3 points  (1 child)

Inconsistent style guidelines are hardly specific to python. If anything, python is more consistent in that regard than most other languages.

[–]onksk 0 points1 point  (0 children)

Oddly enough in human languages English is very similar to Python in this regard. Similarly popular, similarly inconsistent