476 karma · joined May 12, 2020 (6y ago) · 570 submissions
comment 3y ago · link · parent
Scripting language, dynamic typing, microservices and a message queue is shockingly effective.
There is no way to compete with that if you are using traditional development techniques.
It's why we watch videos online on Youtube and not Google videos. The Google developers got beaten up by the much smaller group of Youtube Python developers.
To be honest, I find it shocking that the average user on hacker news doesn't know that software development using dynamic typing is considerably faster than software development using static typing.
comment 3y ago · link · parent
People use scripting languages like Python due to faster development times. They certainly don't use them for resulting code performance :p
Youtube vs Google Videos: https://books.google.co.uk/books?id=eulODwAAQBAJ&lpg=PA136&d...
Youtube's 20 developers using Python were able to out compete Google's several hundred developers using a more traditional language.
Here's a study for you: https://games.greggman.com/game/dynamic-typing-static-typing...
comment 3y ago · link · parent
It takes 2.5x time to develop a program in Java rather than Python. It's been measured.
So you will reach market in 2.5 years instead of 1 year. Bit of a difference to say the least.
comment 3y ago · link · parent
Basically, you are saying you are a cargo cultist rather than a serious software developer.
You fail to understand that the software practices of large multi-national companies are rarely good.
Good luck flying your plane: https://www.abyssapexzine.com/2020/03/cargo-cult/
comment 3y ago · link · parent
Polyglot as in multiple programming languages.
I'm afraid it is true. Knowing the limitations of the tools you use is important. And you clearly do not.
Yes, I've done programing expensive networking hardware in C. I think you are missing that I know a lot more than you.
Tagged values aka dynamic typing is an excellent approach to doing a list from the developer's perspective.
If you think dynamic typing is like using void pointer in C you are very much mistaken.
comment 3y ago · link · parent
I'll go further and tell you the most common reason for using static typing is to allow the codebase to be a monolith like it's still the 90s. You shouldn't be trying to build a monolith in a scripting language it's a recipe for disaster.
I'm a polyglot, I'm exactly the sort of person who should be commenting.
Does it surprise you that static typing is often a poor choice?
Static typing is something to be used when the performance of your code is important. I've done 40 Gbits/sec network traffic processing, certainly static typing is used for that.
Your standard business CRUD app? Usually dynamic is the better choice.
comment 3y ago · link · parent
My wages disagree with that statement. But hey, we can't all be 10x.
Did it ever occur to you to think about why people use scripting languages or what advantages they have over regular programming languages?
Of course not, you are used to statically typed languages and are blinded to the idea that there are other ways to develop software.
I'm guessing you did a search for sources to backup what you are saying and found out pretty quickly that they don't exist.
Static typing in Python is a practice based entirely in common ignorance not reality.
comment 3y ago · link · parent
But sure continue to hammer in nails with a screwdriver, it's only your own time you are wasting.
And I've noticed you failed to provide any sources whatsoever for your nonsense.
comment 3y ago · link · parent
As does integration testing, user acceptance testing and whole system testing (QA engineers, frontend testing, etc.)
Nothing has been forgotten. Python isn't Java, nor should you develop your Python code as if it were Java. Python has it's own software development practices that take advantage of the language's strengths including dynamic typing.
It you don't know how to work with a dynamically typed language properly, that's on you. And I guarantee you will get poor results pretending it's a statically typed language.
comment 3y ago · link · parent
There are plenty of academic sources that will tell you that the number of bugs in a program is directly proportional to the number of lines in the program and static typing has no effect on this.
https://stackoverflow.com/questions/2898571/basis-for-claim-...
Additionally, statically typed code involves large amounts of boilerplate code in the form of abstract base classes, interfaces, generics, templating, etc. It's a very verbose code style.
It's your turn, find an academic source to backup your claim that static typing reduces the number of bugs. Cause it just isn't true.
Microsoft, google and Facebook have a lot of programmers coming from languages with static typing and want to make Python more familiar.
It's a far distance away from anything resembling good practice.
Actual Python houses typically don't use static typing.
comment 3y ago · link · parent
Infact, you could just try it out for yourself.
But here is your internet source for this blatantly obvious fact: https://games.greggman.com/game/dynamic-typing-static-typing...
comment 3y ago · link · parent
Dynamically typed code is 1/3rd the size of statically typed code, that means that one developer who is using dynamic typing is equivalent to 3 developers using statically typed code via MyPy.
Since the code is 1/3rd of the size it contains 1/3rd of the bugs.
This is confirmed by all the studies that have been done on the topic.
If you use a static type checking with Python, you have increased your development time by 3 and your bug count by 3.
Static typing's advantage is that the code runs a lot faster but that's only true if the language itself is statically typed. So with Python you have just screwed up.
comment 3y ago · link · parent
You want data analytics, financial reports, the ability to query your data in new ways you didn't think of when you first built the product? NoSQL comes at a great cost.
When you hit a million users, the entirely of your codebase will be on-fire with scalability issues anyway so it won't make any difference?
comment 4y ago · link · parent
Actually, that makes it really easy to deny the value of static typing. If the total number of bugs in dynamic and static code is the same. But some bugs in dynamic code would be caught by static typing checking.
We most conclude that adding static typing results in a large number of non-typing related bugs being added to the code base. It's simple maths.
"Have you written any assembly?" Yes, I'm an emulator author, thank you very much.
The registers and opcodes are typed with things such as u8, u16, u32, u64, i32, i64 and only work with data of the right type.
"arithmetically add parts of strings, divide pointers" You mean standard C stuff, you know the statically typed language.
"You can use void pointers as return types and arguments for all functions in c code" Dynamic types is not the same thing as type eraser. That void pointer doesn't carry the information that it points to a picture of a cat for example.
The fact you don't understand the difference between a void pointer and dynamic typing doesn't exactly surprize me. It's more like a giant vtable.
comment 4y ago · link · parent
The key points are as follows:
* Development in Dynamically Typed Languages is faster
* Dynamically typed languages use less lines of code than statically typed languages by a significant margin
* The level of bugs is the same between Dynamically typed and Statically typed code.
"You can write almost completely typeless, highly performant, c and assembly code,"
Yes, I'm sure the LOAD instructions take pictures of cats as operands via their typeless instruction sets... What in earth are you on???
"completely typeless, highly performant, c"
well once someone does that let me know. The only thing near is Javascript and that is only faster for microbenchmarks not real programs.
comment 4y ago · link · parent
https://games.greggman.com/game/dynamic-typing-static-typing...
Because all the studies say that dynamic typing reduces development time without increasing the number of bugs.
comment 4y ago · link · parent
comment 4y ago · link · parent
"That's just laughably false. There is zero empirical evidence supporting this claim."
There is a reason all the startups are using Python. Just ask Eve Online or Discord. Dynamic typing is great for getting products to market fast.
Neither of them have problems with too many bugs. What you are saying doesn't even make sense, since you would just increase your QA budget if it increased the rate of bugs. So how in earth could the end user see more bugs?
Dynamic typing has an issue but that issue is code performance. Eve Online gets slow downs during massive battles and Discord rewrote parts of their interface in Rust to save on server costs.
comment 4y ago · link · parent
On Monday morning, I wrote the dynamic typed version of the program. Then until Thursday afternoon wrote the statically typed version of the program. Then the rest of the week was writing tests that compare the output of both versions of the program.
After 2 years of doing it, I think I would know. If that sounds weird to you, it's called Prototyping, shocking that someone might prototype something in a scripting language designed for prototyping, I know.
The two classic examples are Eve Online with their "Python is our secret weapon". They used Python to out develop their competition. The other example is Discord who used Python to get to market quickly. Then they used Rust to reduce their operating costs by increasing the code's performance.
Python adding type annotations is an unfortunate problem associated with too many people coming in from statically typed languages. The problem with success and all that.
Statically typed Python codebases tend to be awful because the developers don't realise that they need to break the codebase down into smaller programs.
JavaScript is not a very good language due to the way it was designed and built and pretty much anything is an improvement to it.
comment 4y ago · link · parent
Dynamically typed languages tend to be simpler and easier to use. This means on the whole they have less bugs than their static typed counter parts.
The real issue with dynamically typed languages is that their performance sucks. (That and according to this thread people not having a clue on how they are properly used. You can't just use the same development techniques as you use in a statically typed language. It's different.)
comment 4y ago · link · parent
It's not the type hints that are responsible. It's the supporting code for allowing the usage of static type checking. Abstract base classes, interface, generics, that stuff which just doesn't exist in the dynamically typed world.