10 ms·
Why such a large, important project would want to drop static types is beyond me. > TypeScript isn’t proving itself helpful to organize Deno code. On the contr
by echelon 6y ago
Why such a large, important project would want to drop static types is beyond me.
> TypeScript isn’t proving itself helpful to organize Deno code. On the contrary, the Deno team is experiencing the opposite effect. One of the issues mentioned is that they ended up with duplicate independent Body classes in two locations
This feels like process immaturity or unfamiliarity. Thousands of other projects manage to do just fine.
These folks are free to do what they want with their project, but this is not a good look, especially to those that are skeptical of the javascript ecosystem.
- mimixco 6y agoLisp is large, important, and also not statically typed. It's worked out ok for Lisp programmers. JS itself isn't strongly typed and is the most successful and important language in the world (probably in the history of programming), so that's two game-changers that don't require static typing.
- efficax 6y agothere's plenty of huge software projects in dynamically typed languages. There are also huge classes of bugs that exist in these projects that a statically typed language completely eliminates! If they're running into trouble from having to have types, it's almost certainly design and architecture issue and does not make me think that deno is going to be a solid project.
- mimixco 6y agoI didn't read that types were causing problems. My understanding was TS, itself, was causing problems. Specifically waiting around for it to compile. Strong typing is from OOPS, itself an optional programming methodology. There are many JS programs that simply access other (JSON) objects directly without going through an interface. In these instances, typing is counterproductive. One of the beautiful things about JS (and Lisp) is that variables and functions are interchangeable and, the case of JS, both can be accessed directly without worrying about an interface.
- jackjeff 6y agoJust use Typescript static types where it is useful. If you access a bunch of JSON objects and you don’t need the typing, you can always declare as ‘any’ and move on. At the end of the day those type exist in JavaScript. If you access ‘first_name’ instead of ‘firstname’ it will not work. The difference is that typescript would let you know before running the code instead of getting an obscure runtime error.
- austincheney 6y agoDeno is having problems with TypeScript, but TypeScript is not the cause of that problem. The problem is a self inflicted issue of a name collision of their choosing.
- jorams 6y agoSlow compile times are very much a problem caused by TypeScript.
- eitland 6y agoMy 3 year old laptop has no problems with TypeScript (neither Angular nor React), and I am a rather impatient guy when it comes to computers. I'm honestly wondering: What are people doing to end up in a position where TypeScript compile times are a problem?
- austincheney 6y agoIt is something to do with a class in their code named something similar to header conflicting with a same named definition in their index.d.ts file that is closely related to that class instance. If they dropped use of classes, or differentiated the names of the two things in collision the problem would appear to be solved. To turn that around and blame TypeScript as the point of failure is an extremely bad omen suggesting their code style opinions are more important than product delivery. I could live with that nonsense if this were a framework or some minor dependency, which this application is not.
- snarfy 6y agoFor dynamically typed languages, the idea is you make up for that class of bugs by incorporating TDD and having lots and lots of unit tests. So, instead of waiting a minute for the typescript compiler, you wait for the engineer to write tests.
- waheoo 6y agoIf youre doing tdd or writing tests like this you have bigger problems. Type safety is easy in a dynamic language. Stop mutating variables and stop mixing types. Suddenly that whole class of errors evaporates. No need to test things that are impossible. And for those times you want some magic in your life, nothing is stopping you, no need for generics, just proceed with caution and test accordingly.
- gameswithgo 6y agoand you wait a minute for the tests to run every time you commit a change
- dboreham 6y agoYou could arrange to have a program write those tests for you based on your description of the project's data model. Oh wait...
- kybernetikos 6y agoYou know what, that would already be better than most type systems. Firstly, they'd be written in the same language that you are coding in, not a weird, half baked type language, that adds visual noise to your code. Secondly, they'd have much more power to define meaningful and useful behaviour rather than being restricted to talk about correct behaviour via types. Thirdly, they'd run when you wanted the tests to run, and you could tier different tests to run at different times, so they aren't all slowing you down while you're doing fast iteration. I used to like types, but then I realised that what matters is how quickly you see the bug. Seeing it in your code editor is brilliant, but if it's slower in time than hitting control S and seeing the actual app in the other pane auto reload, and fail or not, then it's worse. These days I look on the idea that you know the exact types of all data your program will interact with at the time you write your code as the same sort of mistake that we made when we thought we understood the deep inheritance hierarchies of the real world.
- foepys 6y agoJavaScript is the most popular language solely because it's the only one that runs in webbrowsers natively. The language itself is not good, it's rather bad from a language designer's point of view.
- meowzero 6y agoThat's appeal to popularity. At least lisp is strongly typed. JS happened to be created first, and the world was stuck with it as Web grew and no other alternatives came out.
- BiteCode_dev 6y agoLisp is not popular. Remove the browser practical monopoly, and JS popularity would vanish.
- pfraze 6y agoBrowser monopoly led lots of devs to learn JS, then NodeJS showed that lots of devs want to keep using JS. It's actually possible for people to like it. Also, languages are always a function of their ecosystems. You could argue, remove Apple products and Swift/ObjC would vanish.
- NicoJuicy 6y agoNodejs showed that a lot of developers are lazy and want 1 language to learn
- vorpalhex 6y agoCertainly you didn't go through the entire pro con list of Node over other languages and go "it must be developer laziness!" Easy to reason about, great performance for most cases, simple to debug and write code for, a plethora of libraries, easy to ship, no need to have different teams for backend/frontend, and minimal tooling needed.
- kbenson 6y agoThe only really unique thing JS is bringing to the table is that it also has a privileged position in the front end. Your list of benefits it provides boils down to stuff multiple large languages all have, and the one thing that means you can learn just JS. GP comment was presented somewhat snarkily, but I'm not sure they're all that wrong.
- vorpalhex 6y agoSure other languages have some pieces of the puzzle - python has tons of libraries and is easy to understand, golang has great performance and is easy to write, etc. But I have yet to find a language that has the same set of features except JS. If you want to offer up an alternative, please do so.
- deleted 6y ago[deleted]
- gameswithgo 6y agojavascripts success is an accident of history and we have paid a heavy price for it
- shirshak55 6y agonull is considered billion dollar mistake but in JS there is 2 null so the statement is not incorrect :P
- damnyou 6y agoLisp is important for its intellectual contributions, not for its use in large production systems.
- mimixco 6y agoIt's used for every airline reservation you've ever made. Also, it's used here on HN. And in Grammarly.
- jlg23 6y ago> Lisp is large, important, and also not statically typed. It's worked out ok for Lisp programmers. Lisp programmers use check-type[1] a lot, they proclaim[2] types for performance optimizations and they often deftype[3] if not only for code clarity. And then we have CLOS and its dispatching on types/classes... [1] http://www.lispworks.com/documentation/HyperSpec/Body/m_check_.htm http://www.lispworks.com/documentation/HyperSpec/Body/m_chec... [2] http://www.lispworks.com/documentation/HyperSpec/Body/f_procla.htm#proclaim http://www.lispworks.com/documentation/HyperSpec/Body/f_proc... [3] http://www.lispworks.com/documentation/HyperSpec/Body/m_deftp.htm http://www.lispworks.com/documentation/HyperSpec/Body/m_deft...
- carapace 6y ago> JS ... is the most successful and important language in the world (probably in the history of programming), I object, C is that.
- vimslayer 6y agoMost of the project is and will still be written in Rust, a statically typed language, so saying that the "project" will drop static types is an overstatement. Based on the design document where the devs talk about this, the TS code in question is about 10k lines of glue code between Rust & userland JS/TS.
- jsf01 6y agoIf it’s only 10k lines of glue code how are they running into minutes long compiles?
- pfraze 6y agoPresumably that's what the Deno team is wondering
- deleted 6y ago[deleted]
- cjhopman 6y agoHaven't looked at their build, but it's almost certainly the case that they are generating some sort of rust binding from the typescript code and the compilation times are actually from needing to recompile rust.
- stefan_ 6y agoWhy is anyone in the world manually writing 10k lines of glue code? You don't need TS or JS, you need.. a computer.
- austincheney 6y agoThis is enough reason for me to completely forget Deno. They clearly cannot write code or organize it without using classes, which is the core of their current error. The fact that they would choose that stupidity over the organizational benefits of interfaces and static types is not something I can reconcile.
- shirshak55 6y agoremember deno is written by same person who wrote node js so please don't judge immediately.
- HideousKojima 6y agoThat's even more reason to disregard it then
- austincheney 6y agoThe technical problem is a class name in their code conflicting with a same named definition in their index.d.ts file closely related to that class. If they stopped using classes or changed those names to not be in collision this problem would be cured, which indicates it’s an edge case in their code they could easily fix but choose not to. Knowing that and that they blame the TS compiler for their code problem is cause enough to be judgemental. Knowing they are aware they could easily fix this issue themselves but are instead dumping TS is cause for hesitation to invest in the project.
- deleted 6y ago[deleted]
- kevsim 6y agoYeah, I tend to agree. After 18 months with TypeScript, I can't really imagine going away from it. After every single refactoring I do, I'm extremely grateful for proper typing. Not to mention sugar like null coalescing, etc.
- IBCNU 6y agonull coalescing is good, but I personally found that Typescript doesn't offer many advantages on a large team. I know it's not cool these days! But it just slows me down and if you're reasoning about functions I never run into that many production level issues with types, but maybe that's just my brain I dunno!
- kevsim 6y agoWhat is it about a large team that causes it to stop offering an advantage? If anything I’d expect it to be more useful as a code base grows in complexity
- hellisothers 6y agoAgreed, as the team gets larger and an given individual doesn’t necessarily know how everything works from memory the need to rely on the compiler and type safety should grow.
- IBCNU 6y agoI guess it tends to be superseded by other forms of rot, people writing a bunch of tests that aren't against the critical path, money going down the drain... I agree, it _seems_ like what you say is true. I'm not a computer scientist, I'm just saying I've tried TS at a couple of shops, and as they team grows TS slows us down. Maybe it's just stochastic or random, but at the end of the day there's no academic "proof" types improve developer productivity. The only thing that sort of gets me is how everyone sort of assumes TS is 'best practice' but there's really no evidence besides gut feeling. My gut feeling is now telling me TS is not beneficial... I'd love to play devils advocate against my own position so feel free to tear me apart...
- deleted 6y ago[deleted]
- recursive 6y agoFurther, even if they drop typescript, this particular problem won't go away. The solution to this problem is the same regardless of whether typescript is in play. It's odd to count it as a problem with typescript.
- jondubois 6y ago>> This feels like process immaturity or unfamiliarity. On the contrary, I think it shows great maturity in the decision making process. Many highly experienced developers have stayed away from TypeScript for reasons like those mentioned in the article (mostly to do with the build environment, source mapping, versioning complexity, etc...) These are very significant problems and not worth the small benefits which static typing brings.
- MiroF 6y ago> not worth the small benefits which static typing brings. pshh
- Aeolun 6y agoI just cannot consider this a reasonable stance. There are places where no-typescript would be appropriate, but they’re vanishingly small. The idea that the benefits static typing brings are small is just laughable. The reason this is such a hard choice is because static typing brings great benefits, so choosing to forgo that is not easy.