5 ms·
"A whole lot of developers adopt static type checking for mostly subjective reasons or band wagon emotions. Some sell out completely to Typescript and the Micr
by poof131 9y ago
"A whole lot of developers adopt static type checking for mostly subjective reasons or band wagon emotions. Some sell out completely to Typescript and the Microsoft way of doing things while others take on a slower approach with Flow. One thing is for sure, most developers don't need types, they are simply complicating already complex problems and solutions. Like most things, most of this trend is subjective dogma not objective value."
Wow, biased much. I love JavaScript and ES6. But anything that I work with a team on or expect to live beyond a month or so, I love types for. Making a large refactor without types is the wild west. Types help provide structure/understanding about the data flowing through your system. And if you need to eject you can with Any. I used to prefer pure JS (or Python), certainly quicker to prototype, but also more difficult to grow and maintain. Tradeoffs in both directions. Such an amateur statement makes me question the rest of the document.
- hn0 9y agoHmm, complicated? I think JS’ type rules are much more weird and complex than the average static type checking solution.
- FLUX-YOU 9y agoLooking back and forth between code and docs just to remember the shape of returned objects is annoying and probably the worst for productivity. I imagine most people using vanilla JS have significant amounts of objects memorized.
- speg 9y agoIF there any docs!
- zdragnar 9y agoIDEs like webstorm can ostensibly be quite helpful if you use jsdoc style annotations. However, in my experience, once a code base is big enough, you can open almost any file and find documentation that's out of date, incorrectly copy-pasted, or some other major issue. TS, on the other hand, at least forces you to stay correct, which is ultimately what convinced me to switch.
- nothrabannosir 9y ago> jsdoc style annotations Which are a form of type annotations. Case in point: the typescript compiler can actually parse those, in .js files, and yield appropriate warnings on errors. See the //@ts-check annotation.
- zdragnar 9y agoIt'd be a lot less effort to just use TS imho.
- zdragnar 9y agoEdit: I meant jsdoc-style, not "style annotations".
- Blackstone4 9y ago> "Some sell out completely to Typescript and the Microsoft way of doing things" > "this trend is subjective dogma not objective value" Ironically, the author own phrasing is not objective and somewhat hypocritical. S/He described the use of Typescript as "selling out and the Microsoft way of doing things". S/He's trying to leverage anti-Microsoft sentiment to boost her/his argument. Feels more like a smear campaign then an objective opinion.
- swebs 9y agoTo be fair, the anti-Microsoft sentiment didn't just pop up out of nowhere. I've been burned by Microsoft's bullshit so many times that I will go out of my way to deny them any semblance of power, lest they try to leverage it for some new anti-consumer vendor lock-in scheme. How's that old saying go? Fool me once, shame on you. Fool me 47 times, shame on me.
- dhimes 9y agowon't get fooled again :)
- smoyer 9y agoCompletely OT: Unfortunately I can't hear that song anymore without picturing the opening scenes of CSI Miami.
- renw0rp 9y agoapple is the new Microsoft, and people keep throwing money at them... also, even though the MS anti-sentiment didn't pop up out of nowhere, it's not relevant in the static-vs-dynamic typing discussion...
- brandall10 9y agoAnti-MS sentiment is related to its business practices and perhaps dev community itself, not tooling. I've never seen a person who actually is familiar with Typescript say anything negative about it, and it has huge uptake in the open source community.
- jpd- 9y agoContext means everything. Is the author working on a startup with weekly sprints and a small dev team, or an enterprise app with 400 devs and a legacy codebase in a waterfall environment? The author strikes me as someone who has a very narrow breadth of experience.
- fulafel 9y agoTypes are not the only game in town, schema style solutions (like Clojure(Script)'s spec) have many things over static type systems.
- zdragnar 9y agoYou can use both, ala tcomb or io-ts
- baron816 9y ago> Making a large refactor without types is the wild west. Types help provide structure/understanding about the data flowing through your system. If you’re working on a large, unstructured project that you’re trying to refactor, you’re problem probably isn’t with the types. It’s that the people working on it used types as a crutch so that they thought it was okay to write classes that were thousands of lines long with giant methods that are impossible to make sense of. The interview question I’ve been asking lately is about object design. I tell them not to put things into one big method—that it needs to be readable for junior devs. They always ignore me. The ones who struggle the most are the ones who try to do it in a staticly types language (which I’m sure you agree is crazy to use in an interview for a tiny problem). Their mental model forces them to think about types first, and they then can’t think about anything other than that and just making the thing work. If you aim to keep your objects and you methods small enough that anyone can read them and make sense of them, then you don’t need static types and refactoring becomes easy. There are plenty of developers of mediocre talent who never use types and are able to build huge features and projects quickly and with high maintainability and flexibility because they write code that sticks to good object oriented design principles. A class I work on regularly has become so big that everyone, especially the more senior, more talented engineers at my company are too afraid to touch, let alone try to refactor. It’s stayically typed.
- nxc18 9y agoSounds like you're permanently stuck living in amateur hour... I have never seen anyone past high school level CS try to pull the shit you describe. Those aren't problems of static typing, they're problems of poor dev talent.
- deleted 9y ago[deleted]
- swirepe 9y agoI don't know why you're conflating using a type system with writing large classes.
- baron816 9y ago
- nxc18 9y agoThere were so many overtly biased and misleading statements in just the first page that the whole work lost credibility.
- pault 9y agoI had an epiphany recently when I realized that I had spent about 40-50% of my time on a recent project writing type checking conditionals and unit tests that would have been obviated by using a type system. I am considering typescript for my next project.
- PaulStatezny 9y agoAgreed. There are trade-offs between choosing typed and non-typed languages. It’s not wrong to prefer one or the other. But to accuse the other side of selling out or not having objective reasons for the choice is naïve. Don’t assume that everyone who disagrees with you is stupid. It only demonstrates that you lack an important skill of critical thinking: the ability to consider others’ perspectives and understand them.