4 ms·
The Refactoring book in Javascript looks like an early April, 1st joke :-) What I really miss is the integration with the automatic refactoring tools in our ID
by neves 9y ago
The Refactoring book in Javascript looks like an early April, 1st joke :-)
What I really miss is the integration with the automatic refactoring tools in our IDEs. How would I make a heavy refactoring if I already have a "extract method" in my interface? Would it be the same? Some of the refactorings are easier to automate so are more common in the IDEs. Would are better paths considering what is automated?
- Karunamon 9y agoI'm asking this from a position of massive ignorance (I'm mostly a backend dev who does the occasional website), but is there any type hinting tooling in the Javascript ecosystem? Python has PEP484 where you annotate types in either comments or docstrings, Ruby has YARD tags used similarly, and smart IDEs can pick up on these and offer decent refactoring tools. But does anything similar exist in JS land?
- dgreensp 9y agoTypeScript is fast becoming the go-to language for JavaScript with types.
- jmsaucier 9y agoI will second this. I've seen some people choose FB's Flow as their type checker, but for me, I'm loving Typescript. It has minor problems when it has to use DefinitelyTyped and integrate with other frameworks, but those are minor in comparison to not having it.
- edem 9y agoThey still didn't manage to put together a usable language. Just try to import your `Foo` class into `Bar` and your `Bar` class into `Foo`. BOOM! It will explode into your face. And this is just a basic thing which should work in a real language.
- avarun 9y agoFlow does this very well. https://flow.org/ https://flow.org/
- SlySherZ 9y agoYes, there is JSDoc[1] which allows you to add type annotations in comments, that can then be used by some tool. The VSCode editor is able to leverage the TypeScript engine even with vanilla JS to automatically infer types and also supports JSDoc. Basically you write vanilla JS, add JSDoc comments here and there when the inference doesn't work as you want and it gives you most benefits of a typed language, without tying yourself to a specific ecosystem (your teammates could be using something else entirely). It works pretty well. [1] http://usejsdoc.org/ http://usejsdoc.org/
- Karunamon 9y agoThis is more what I was looking for; the others appear to be supersets of JS.
- vonseel 9y agoSeems like JavaScript would make sense since there are so many young, inexperienced js developers that stand to potentially benefit from such a book.
- neves 9y agoProbably it makes sense because it is the most used lang in the world. Everybody has a interpreter on their computers. Also there are more people to buy the book.
- edem 9y agoI honestly hoped that this was an April fool's joke.