Earlier quoted context omitted.
I read it 15 years ago. No other book has influenced my programming as much as this one. The main value I got from it is that it teaches you what "clean" code looks like. Highly recommended.
You might also enjoy "Beautiful Code" then. While not everyone will agree that every example in that book is "beautiful", usually there's something in there for everyone. It's currently my favorite generalized programming book.
Announcing the Second Edition of “Refactoring”
51–60 of 61 posts
Re: Announcing the Second Edition of “Refactoring”
#52Earlier quoted context omitted.
I'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?
Yes, 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 ty…
Re: Announcing the Second Edition of “Refactoring”
#53I realise this is an unpopular opinion, but I really didn't like the previous book. Don't get me wrong, I definitely think refactoring is a good thing (in moderation!). But Fowler presented a list of possible refactoring operations, including step by step instructions... for very trivial things. In the introduction he drew comparisons with GoF design patterns book, saying he wrote it hoping people would refer back to…
I never read more than a fraction of the first edition, but I found it valuable. The key idea was that refactoring was a methodical, careful process that consists of steadily taking the code from one working state to another. At the time, refactoring was a dirty word at my company, and people didn’t distinguish it from rewriting code in any arbitrary fashion.
Re: Announcing the Second Edition of “Refactoring”
#54Earlier quoted context omitted.
I found it very interesting for being one of the very few books that deals with code as a formal system. You don't need to understand the code; you don't need to step through the code. You follow the steps for "extract method" and you go from a working state to another working state with no worries. The individual refactorings are more-or-less interesting, but as others have said, they're somewhat commonplace now. Tw…
Would you recommend "Software Tools in Pascal" vs the original?
Re: Announcing the Second Edition of “Refactoring”
#55Earlier quoted context omitted.
I never read more than a fraction of the first edition, but I found it valuable. The key idea was that refactoring was a methodical, careful process that consists of steadily taking the code from one working state to another. At the time, refactoring was a dirty word at my company, and people didn’t distinguish it from rewriting code in any arbitrary fashion.
This sounds mostly like the first chapter, which was the bit I enjoyed the most. That was about automated testing, and a whole book about that might've been quite useful.
In addition to the principles about refactoring, reading a few of the examples helped to drive in how methodical it was.
Re: Announcing the Second Edition of “Refactoring”
#56He could have chosen Python which is also one of the top languages and it does not have the quirks of javascript.
I can't help but feel that he only chose this language because this is the language which will net him the most ROI.
And we'll take the collateral damage which is an influx of people who will wave his book and say "Let's use this language! Even Mr. Fowler uses it! This must mean that this is the best language there is!"
Imagine the damage this will do to us grunt programmers in the field. Now it will be even harder to push real languages through management now that a celebrity in our little scene is using javascript.
I bet that Mr. Fowler doesn't have to program in that crappy, quirky, horrible 9nth circle of hell language.
Sorry for the rant but this had to come out.
Re: Announcing the Second Edition of “Refactoring”
#57The 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?
Re: Announcing the Second Edition of “Refactoring”
#58Earlier quoted context omitted.
I'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?
TypeScript is fast becoming the go-to language for JavaScript with types.
Re: Announcing the Second Edition of “Refactoring”
#59Am I the only one who thinks that using javascript is a terrible, horrible, no-go decision? He could have chosen Python which is also one of the top languages and it does not have the quirks of javascript. I can't help but feel that he only chose this language because this is the language which will net him the most ROI. And we'll take the collateral damage which is an influx of people who will wave his book and say…
Thanks.
Re: Announcing the Second Edition of “Refactoring”
#60Am I the only one who thinks that using javascript is a terrible, horrible, no-go decision? He could have chosen Python which is also one of the top languages and it does not have the quirks of javascript. I can't help but feel that he only chose this language because this is the language which will net him the most ROI. And we'll take the collateral damage which is an influx of people who will wave his book and say…
I'm curious as to what you believe are the "quirks of javascript" and if you think there are any more reasons as to why it's a "crappy, quirky, horrible 9nth circle of hell language"? Thanks.