Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
mhudson12938yEmbrace the hate. Come to the dark side.
Small things like that are precisely why I do a bunch of algo prototyping in python. -
Python is free of these constraints. You know. Like a snake. Maybe python. Because the language is called....ok I drop it.
-
Huuugo25058yYeah leaving out all the unnecessary boilerplate you write while repeating yourself at least four times (field, constructor, getter, setter) is probably a bad idea. You are paid for lines of code in the end, not for features, right?
-
@Huuugo I think OP is more talking about the fact that one can do
foo = 3
Rather than have to do
int foo = 3; -
Huuugo25058y@AngryDev my point stands. If the computer can tell you what is missing, it's boilerplate code. It doesn't add anything on the program logic, but complicates things because you have to care about the low level representation of data. Damn, if you have a number with a point in it it's obviously a float/double. Why repeat yourself all over the place and state the obvious? I am a Java developer and I honestly hate the strict typing. It's only good for ide autocompletion
-
kkalem2868y@Huuugo I'm gonna have to disagree here. I'm also a Java user turned Python and damn do I miss my types. Because typing extends over objects as well. Not knowing what a function will return exactly until runtime can get REALLY frustrating. A repl helps, but can not replace static typing's comfiness. Looking at docs for every function call gets old quick.
-
@Huuugo so is it a float or is it a double? The amount of time I had to run code, wait for 5 minutes for it to run, to then get an exception at the end because it couldn't work with some data type when I thought I actually had another, is enough for me to really hate Python. But I don't. Even if Python is very bad, compared to other languages, at type conversion, while at the same time being type agnostic, which makes for a horrible combination, I do appreciate the small footprint of the code when I really need to cook up something fast.
-
Huuugo25058y@apisarenco I seriously don't give a damn what precision the computer is using. If I was concerned because I need to keep my bitcoin balance in it, I would say so explicitly. Same goes for integers. If it gets too big, the next bigger type should be used. The overhead of that usually doesn't matter at all.
-
@Huuugo Often times it's not about the low level representation. The advantage of strongly typed languages is that if I declare
human bob = new human();
I know that bob will always be a human and I can be assured that he will have all of the things I expect with a human. (Important with huge programs)
Aside from that, if I change the type of a function (say I go from int banana() to bool banana()) then this breaks it at compiler level, and I know exactly where I need to update my code to match this (again if code is several thousands of lines you begin to appreciate these things) -
@Huuugo there is an overhead in memory however. Actually, the overhead is 2x, if your code is well optimized otherwise. And precision is important in long algorithms, because a small loss in a lot of places piles up to quite a lot.
So, I've been programming a number of years, mainly .net, I've been looking at python recently and it just seems wrong to use variables without declaring them. It just seems dirty
undefined