4 ms·
Anyone with experience of writing both dynamic typed and statically typed can tell you that. Infact, you could just try it out for yourself. But here is your
by ReflectedImage 4y ago
Anyone with experience of writing both dynamic typed and statically typed can tell you that.
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/ https://games.greggman.com/game/dynamic-typing-static-typing...
- bombolo 4y agoI do have such experience and I really can't tell that. Which is why I wondered if anyone else was in fact saying that. > But here is your internet source for this blatantly obvious fact: https://games.greggman.com/game/dynamic-typing-static-typing https://games.greggman.com/game/dynamic-typing-static-typing... Ah no I meant a proper peer reviewed source. The claim that untyped code has fewer bugs is completely bonkers, so I was quite sure that no such source existed. Why do you think microsoft, google and facebook are all in the business of typechecking python? If typechecking would actually introduce bugs, it'd be better not doing it right? Using github for statistics is flawed. There are millions of 10 line js libraries. Yes it's easy to not make type mistakes in 10 lines. I suppose that type errors increase more than linearly with size.
- ReflectedImage 4y ago"The claim that untyped code has fewer bugs is completely bonkers" 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-that-the-number-of-bugs-per-line-of-code-is-constant-regardless 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.
- bombolo 4y agoPlease don't reply multiple times to the same thing. > Actual Python houses typically don't use static typing. If you had ever developed python professionally, you'd know this to be untrue. Also your "paper" points to a 404 page.
- ReflectedImage 4y agoI have developed in a lot of Python houses. Given that type hints are a new language feature in Python, please explain to me how these Python houses used static typing when type hints didn't exist? I'm all ears.
- bombolo 4y ago> Given that type hints are a new language feature in Python, please explain to me how these Python houses used static typing when type hints didn't exist? They've existed since 2015… please explain me how 2015 is "new"?
- ReflectedImage 4y agoPython has been around since 1991. I'm little bit more experienced than you.
- bombolo 4y agoYou seem to have no experience with type hints… You could have acquired this experience but didn't. No shame, but you are not the most qualified person to comment on typing. Also python3 is from 2008, and it's effectively a different programming language.
- ReflectedImage 4y agoI have experience in working on statically typed Python codebases, it's just obviously inferior. 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.
- ReflectedImage 4y ago"If typechecking would actually introduce bugs, it'd be better not doing it right?" Correct if you misapply a tool to the wrong situation you get poor or negative results. The right tools are unit testing, integration testing, uat and automated whole system testing.
- bombolo 4y agoThat seems to completely forget the fact that libraries exist, that A LOT of bugs can happen calling libraries, and that you're not really supposed to unit test libraries, they are supposed to have their own tests.
- ReflectedImage 4y agoUnit tests test the parts of the library that are in use implicitly. 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.
- bombolo 4y ago> 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. Insulting me won't make you a better developer nor a better person :) Getting started with type hints is not easy, but it can be done incrementally and it is worth it. If you haven't used them, please learn before insulting people who are more experienced than you.
- ReflectedImage 4y agoUsing static typing in a dynamically typed language will always make you a poor software engineer who doesn't understand the tools they use nor the engineering trade-offs involved. 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.
- hbrn 4y ago> The claim that untyped code has fewer bugs is completely bonkers Not really. It is, however, quite expensive to measure, because dynamic typing really shines at the evolution of software, that is being able to respond fast to changing requirements. Legos vs play-doh: https://weblog.jamisbuck.org/2008/11/9/legos-play-doh-and-programming https://weblog.jamisbuck.org/2008/11/9/legos-play-doh-and-pr... > Why do you think microsoft, google and facebook are all in the business of typechecking A billion flies can't be wrong? Companies with unlimited amount of money are not the right place to search for good practices. Both Facebook and Google became flush with cash way before modern type obsession. Sure, once you are a multi-billion dollar company slowing down can be a good thing. But you need to get there first. > If typechecking would actually introduce bugs, it'd be better not doing it right? If sugar caused us to die sooner, we'd be better to eating too much if it, right? And yet, here we are.