5 ms·
Next week - "Haskell is C" - because you can write program that compiles and doesn't do what you want. Nobody ever claimed that flow/typescript magically makes
by mirekrusin 7y ago
Next week - "Haskell is C" - because you can write program that compiles and doesn't do what you want.
Nobody ever claimed that flow/typescript magically makes your code bug free.
It will help with stupid mistakes. It will help with invariants at the type level, but it won't guarantee anything because there are ways to supress it. It will not help with value/runtime invariants because it doesn't have any dependat-type constructs (you can use things like flow-runtime to get some extra help if needed during runtime, but it will be likely slow if you use it everywhere, maybe cherry picked places is good compromise, depends on what you're trying to solve).
Things like immutable collections and/or better architecture should help.
- ylyn 7y agoThe author isn't claiming that someone claimed that either. S/he's just saying that s/he likes Rust/Elm because they check more invariants than C/TypeScript. In other words, "no one said it does" isn't really a useful response to "I don't like X as much as Y because X doesn't do A but Y does."
- yoz-y 7y agoThey might not claim that but the article’s title and gist still is “JavaScript is C because of this one reason”. This kind of comparison is just not useful.
- bovermyer 7y agoI disagree. It changed how I think about JavaScript a little. As such, it was useful for me. Be mindful that you do not mistake what we think for how we think.
- yoz-y 7y agoI think the point the article makes is good, I just don't like how the comparison was made. I don't think the article would be of less value if the author dropped the "JavaScript is C" peppered all around it.
- chriskrycho 7y agoIt's a fair point. That's the trick with a blog post where you're basically "thinking out loud." This is just the way that the little switch flipped in my head as I was thinking through things that day: The experience felt very similar.
- CathedralBorrow 7y agoIs there a difference between "I don't like this" and "This is not useful"?
- yoz-y 7y agoThere is. But in this particular case I stand by my point, a cursory glance will show that JavaScript is nothing like C. Starting an article with such a premise and re-stating it repeatedly smells like clickbait to me. Also it devaluates the point made by the article which is actually good.
- joppy 7y agoWhy not just write “they”, rather than he/she? Gender labels can be a difficult issue for some.
- manthedudeguy 7y agoOr just pick he or she. Not a big deal.
- slacka 7y agoOr actually read the article before commenting. The author's name:"Chris Krycho" is not only in HUGE bold text on the 1st line, it's also part of the URL.
- GordonS 7y agoChris could be a male or female name, so not terribly helpful in this case.
- Koshkin 7y agoThere's also the issue of gender identity.
- toastal 7y agoChris is a fairly gender neutral name. Just say 'they'; it's in the dictionary now for gender neutrality so no reason not to.
- astura 7y agoChris is commonly both a male and female name (is a diminutive of Christopher, Christine, Christina, Christian, and probably others).
- slacka 7y agoThen use "they" or if you're really that concerned with making a mistake, spend 2 seconds to google them, and you will see that this Chris is a "He" from the first hit on a google of "Chris Krycho". https://twitter.com/chriskrycho?lang=en https://twitter.com/chriskrycho?lang=en
- fwip 7y agoYou can just use "they."
- chriskrycho 7y agoThe difference is in what a developer can express. As has often been noted: you can write FORTRAN in any language. But that doesn't mean I will opt for Fortran (except perhaps for some specific numeric computing cases! Then I might!) when other tools allow me to capture more invariants in my program. The fact that the compiler doesn't make me is orthogonal to the point I was getting at in this article. It allows me to capture constraints and invariants that matter to me, and it enforces certain constraints and invariants on all developers. That combo can be—and in my experience working a lot in C and JS as well as in richly typed modern languages like TS, Rust, Elm, etc.—very, very powerful and rewarding. (Also: TS gets surprisingly far on dynamic runtime inspection. While I'd love to see the ideas in Idris become far more mainstream, in the meantime, the stuff TS is doing with type narrowing, mapped types, conditional types, and so on is nothing short of astounding. You can do some pretty wild stuff that isn't quite dependent types but gets awfully close. But caveat emptor: compile times may get you.)
- collyw 7y agoI have seen it claimed with Rust that "if it complies it will run". I managed to get it to compile and crash in my brief encounter with it.