Quote:
Originally Posted by ChrisV
Yeah. In a statically typed language, you shouldn't need a linter to catch typing errors. Catching problems like that is the point of having static typing. I think all later C-style languages (Java and C# for sure, anyway) broke from C/C++ by disallowing implicit conversion of primitives. Call me a grumpy old man brought up on static languages, but I don't think "truthy" and "falsey" are good ideas even in dynamic languages. It must have cost way more time in nasty bugs than it's saved in being able to write if(foo) rather than if(foo !== 0) or whatever.
Yep. But in a dynamically typed language you don't have to spend 4 hours wrestling with how to write a mock class to test a class which takes generics as part of its class signature (or whatever you call that MyClass<InputsT, OutputsT> thing).
Tradeoffs on both sides. Personally having been a Java and JS dev for 10 years+ each - I'll take dynamically typed with linters and stuff to keep me out of trouble. With frameworks like react or a node app - 99% of your run-time errors not caught by a linter are still caught when the app tries to boot or load in the browser. Autocomplete, which is awesome, is the only thing I really miss from statically typed world.
I have a "fun" theory of development. The more fun, the more productive. The less a dev has to worry about stuff like plumbing, or mapping out a complicated class hierarchy with interfaces and stuff before they can start building functionality - the more *fun* they have coding. The more time they can spend on the intent of the thing they're trying to create - the more fun they have. With a dynamically typed language you're pretty much off and running immediately.
When a new feature gets floated and devs immediately start brainstorming about how to make it work, with a positive demeanor, that's a good sign that your architecture is set up well. When devs immediately start expressing pain from all the stuff they'll have to refactor, or tedious config and things they'll have to change - that's no fun - a bad sign imo.
And yes I get that figuring out class hierarchies can be fun. But realizing your beautiful Animal->Human/Dog and Human->Robot class structure is shattered by a request for a Robot Dog - is not fun. Class hierarchies assume perfect understanding of the logical domain - and a logical domain which never evolves - which is basically never the case.
I'm buzzed so not really stating this well. But anyway that's the concept.
Last edited by suzzer99; 11-03-2018 at 02:07 AM.