4 ms·
Tbh, the strongly typed and dynamically typed combination seems like the worst option. You get zero help and punished hard for failing.
by dminik 1y ago
Tbh, the strongly typed and dynamically typed combination seems like the worst option.
You get zero help and punished hard for failing.
- throwawaymaths 1y agonah you just get log lines. crash is not as bad as you think it is.
- dminik 1y agoI mean, it is a kind of a bug that is easy to prevent with a static type checking, but also one that will always (or almost always) get triggered. Log lines are whatever, but a system that goes into a crash loop or fails on most requests isn't great.
- em-bee 1y agohow so? most dynamically typed languages are also strongly typed. that includes python, ruby, common lisp, smalltalk... if it was the worst option, this would not be the case.
- dminik 1y agoA casual look at the history of basically anything will tell you that the best option isn't necessarily always the one that succeeds.
- em-bee 1y agosure, but when the majority of popular languages use that paradigm then it surely can't be the worst option either. what is it that makes it a bad combination?
- dminik 1y agoPlease, smalltalk and common lisp don't qualify as popular languages. I don't want to look at TIOBE, so let's look at the stack overflow survey from 2024. https://survey.stackoverflow.co/2024/technology#admired-and-desired https://survey.stackoverflow.co/2024/technology#admired-and-... Strong + Static: TypeScript, Java, C#, C++, Go, Rust, Kotlin, Dart, Swift, Visual Basic, Scala Weak + Static: C Strong + Dynamic: Python, Lua, Ruby, R, GDScript(*) Weak + Dynamic: JavaScript, PHP, Matlab, Perl At this point I'm reaching into the low percentages. I think it's pretty clear that Strongly + Statically typed languages are massively over-represented on the list. Both Strongly and Weakly Dynamically typed languages are similarly represented. Note: I'm open to editing the comment to move languages from and to various categories. I haven't used many of them, so correct me if I'm wrong.
- em-bee 1y agosmalltalk and common lisp don't qualify as popular languages not anymore. they were very popular in the industry at one point. very few other languages have so many independent implementations as smalltalk and lisp. a testament to their wide spread use in the past. Strong + Static: TypeScript; Weak + Dynamic: JavaScript that doesn't make sense. typescript is javascript with types, it can't be both strong and weak at the same time. but i believe we have a different definition of weak. just because javascript, php and perl have some implicit type conversions doesn't make them weakly typed. i believe it takes more than that. (in particular that you can't tell the type by looking at a value, and that you can use a value as one or another type without any conversion at all) C is weakly typed, it was always a major criticism, C++ too i think (less sure about that). once you correct for that you will notice that all languages in the strong and static category are less than 30 years old and many are much younger. (java being the oldest. but there are older ones like pike which is also strong and static and goes back to 1991) the strong and dynamic category goes back at least a decade more. (if you include smalltalk and lisp) what this does show is that static typing has experienced a renaissance in the last two decades, and also the worst is really using any form of weak typing. i still don't get what makes strong and dynamic a bad combination, other than it's bad because it is not static.
- dminik 1y ago
- crabmusket 1y agoNope, getting a TypeError on "1"+2 is not being "punished". That's way better than getting malformed data that you weren't expecting which keeps the system "working" until an error happens somewhere else, later, where it's more confusing.
- hinkley 1y agoOpenTelemetry.js did this. Being written in typescript they wrongly believed they didn’t need to check the data type for user-supplied numbers. Yeah so my production data started having dropouts because somewhere we incremented by “2” instead of 2, and then OTLP choked on 100% of the data from that process because one stat out of thousands was not to its liking and had a three thousand digit ‘number’ in it. I never did track down the last spot where we screwed that up. This was a system we shifted from statsd, so the offending callers were either working by accident or only killing some data points for one stat and nobody noticed. So then OpenTelemetry.js had to start sanitizing its inputs and not assuming the compiler should catch it. I still think it odd that something called “.js” was actually “.ts” under the hood.
- dminik 1y agoNot getting an error on "1" + 2 is very bad if that's not what you wanted to do. Agreed. Getting an error on "Value: " + 2 is very annoying if that's what you wanted to do. The solution here is Static typing, not Strong/Weak typing.
- LionelLassiter 1y ago[dead]