Baixe o app Kindle gratuito e comece a ler livros do Kindle instantaneamente em seu smartphone, tablet ou computador - sem a necessidade de um dispositivo Kindle.
Leia instantaneamente em seu navegador com o Kindle para internet.
Usando a câmera do seu celular, digitalize o código abaixo e baixe o app Kindle.
Imagem não disponível
Cor:
-
-
-
- Para ver este vídeo faça o download Flash Player
Seguir o autor
OK
Refactoring: Improving the Design of Existing Code Capa dura – Ilustrado, 19 novembro 2018
Opções de compra e produtos complementares
Martin Fowler's guide to reworking bad code into well-structured code
Refactoring improves the design of existing code and enhances software maintainability, as well as making existing code easier to understand. Original Agile Manifesto signer and software development thought leader, Martin Fowler, provides a catalog of refactorings that explains why you should refactor; how to recognize code that needs refactoring; and how to actually do it successfully, no matter what language you use.
- Refactoring principles: understand the process and general principles of refactoring
- Code smells: recognize "bad smells" in code that signal opportunities to refactor
- Application improvement: quickly apply useful refactorings to make a program easier to comprehend and change
- Building tests: writing good tests increases a programmer's effectiveness
- Moving features: an important part of refactoring is moving elements between contexts
- Data structures: a collection of refactorings to organize data, an important role in programs
- Conditional Logic: use refactorings to make conditional sections easier to understand
- APIs: modules and their functions are the building blocks of our software, and APIs are the joints that we use to plug them together
- Inheritance: it is both very useful and easy to misuse, and it's often hard to see the misuse until it's in the rear-view mirror---refactorings can fix the misuse
Examples are written in JavaScript, but you shouldn't find it difficult to adapt the refactorings to whatever language you are currently using as they look mostly the same in different languages.
"Whenever you read [Refactoring], it's time to read it again. And if you haven't read it yet, please do before writing another line of code." -David Heinemeier Hansson, Creator of Ruby on Rails, Founder & CTO at Basecamp
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." -M. Fowler (1999)
- Tamanho
448
Páginas
- Idioma
EN
Inglês
- EditoraAddison-Wesley Professional
- Data da publicação
2018
novembro 19
- Dimensões
2.0 x 18.8 x 23.4
cm
- ISBN-100134757599
- ISBN-13978-0134757599
Frequentemente comprados juntos

Clientes que compraram este item também compraram
Descrição do produto
Sobre o Autor
Detalhes do produto
- Editora : Addison-Wesley Professional; 2nd ed. edição (19 novembro 2018)
- Idioma : Inglês
- Capa dura : 448 páginas
- ISBN-10 : 0134757599
- ISBN-13 : 978-0134757599
- Dimensões : 2.03 x 18.8 x 23.37 cm
- Ranking dos mais vendidos: Nº 88,361 em Livros (Conheça o Top 100 na categoria Livros)
- Avaliações dos clientes:
Sobre o autor

Descubra mais livros do autor, veja autores semelhantes, leia blogs de autores e muito mais
Avaliações de clientes
As avaliações de clientes, incluindo as avaliações do produto por estrelas, ajudam os clientes a saberem mais sobre o produto e a decidirem se é o produto certo para eles.
Para calcular a classificação geral por estrelas e o detalhamento percentual por estrelas, não usamos uma média simples. Em vez disso, nosso sistema considera coisas como o quão recente é uma avaliação e se o avaliador comprou o produto na Amazon. As avaliações também são analisadas para verificar a confiabilidade.
Saiba mais sobre como as avaliações de clientes funcionam na Amazon-
Melhores avaliações
Principais avaliações do Brasil
Ocorreu um problema para filtrar as avaliações agora. Tente novamente mais tarde.
Principais avaliações de outros países
One of the most popular CS papers ever ("Hints for Computer System Design", 1983) suggests 3-step process about writing code - first, make it work; second, make it right; finally, make it fast". This book, a succinct second edition of a very popular first, is an excellent "show and tell" for the second part.
It has a catalog of "code smells" and an inventory of "refactoring tricks" mapped to each. The first edition had working Java examples. The present one shows JavaScript ones. The examples are real-life but simple enough to not distract from the core - how to simplify the "first version" of code. Apart from the content, the insights that pops out can only be gleaned from years of deep experience. One example, say, most developers encode a "phone number" attribute as string in the first attempt of modeling. Soon enough, one needs to add "spam rules", "blocking number", "area code" etc. That necessitates phone number to be 'refactored' from string (i.e., a primitive type) to its own object model (say, a class called PhoneNumber). The author cheekily refers to the former type of behavior as "stringly typed" variables. Word play is a hallmark of many good engineers I'd worked with, but it is also a phenomenal way to remember things. Humor shortens the retrieval curve.
What I liked most about the book is a broad adoption of "Paracelsus' Maxim" - the difference between a poison and something benign is the dose. Most of the refactoring pattens come in pairs. You can "extract function" from a big one, or "inline function code" if it is short, obvious and singularly used, say. You can "replace parameter with query" or "replace query with a parameter". The only unpaired pattern shows up with large/complex conditionals (say, a switch, or a multiway nested conditional with 'guard clause) - most/all of them are pain to read and should ideally be refactored, say, with "replace conditional with polymorphism". Live book site has 4 more patterns beyond the book.
I found the refactoring patterns could be of three principal dimensions - one, structure -- variable, method, class, conditional; two, usage and locality -- depending on how much they're used and if they are used within/outside the module (class); three, data and mutation -- there is a clear separation between refactoring a data (or, value) object/data passed as value- or reference; separating data (query) from command etc. On top of that, some of the refactoring could be thought of as "helping the original developer" (say, to modularize or DRY better) vs. "helping others who may read the code later".
When I read the first edition years ago, IDEs were not as robust nor opinionated enough about refactoring. These days, majority if not all the refactoring is done by default - one just needs to click to accept, say, extracting a method. It has been a huge time saving and long-term benefit for collaborative work and fits very well within the philosophy of "continuous integration"/Kaizen etc. One could argue that lowers the importance of such book. While the IDE may do the grunt work, key decisioning remains with humans, for now. Especially since most refactoring could appear in polar opposites it is therefore even more important to understand the context - the "why" - which this book brilliantly lays out.
Avaliado nos Estados Unidos em 27 de outubro de 2023
One of the most popular CS papers ever ("Hints for Computer System Design", 1983) suggests 3-step process about writing code - first, make it work; second, make it right; finally, make it fast". This book, a succinct second edition of a very popular first, is an excellent "show and tell" for the second part.
It has a catalog of "code smells" and an inventory of "refactoring tricks" mapped to each. The first edition had working Java examples. The present one shows JavaScript ones. The examples are real-life but simple enough to not distract from the core - how to simplify the "first version" of code. Apart from the content, the insights that pops out can only be gleaned from years of deep experience. One example, say, most developers encode a "phone number" attribute as string in the first attempt of modeling. Soon enough, one needs to add "spam rules", "blocking number", "area code" etc. That necessitates phone number to be 'refactored' from string (i.e., a primitive type) to its own object model (say, a class called PhoneNumber). The author cheekily refers to the former type of behavior as "stringly typed" variables. Word play is a hallmark of many good engineers I'd worked with, but it is also a phenomenal way to remember things. Humor shortens the retrieval curve.
What I liked most about the book is a broad adoption of "Paracelsus' Maxim" - the difference between a poison and something benign is the dose. Most of the refactoring pattens come in pairs. You can "extract function" from a big one, or "inline function code" if it is short, obvious and singularly used, say. You can "replace parameter with query" or "replace query with a parameter". The only unpaired pattern shows up with large/complex conditionals (say, a switch, or a multiway nested conditional with 'guard clause) - most/all of them are pain to read and should ideally be refactored, say, with "replace conditional with polymorphism". Live book site has 4 more patterns beyond the book.
I found the refactoring patterns could be of three principal dimensions - one, structure -- variable, method, class, conditional; two, usage and locality -- depending on how much they're used and if they are used within/outside the module (class); three, data and mutation -- there is a clear separation between refactoring a data (or, value) object/data passed as value- or reference; separating data (query) from command etc. On top of that, some of the refactoring could be thought of as "helping the original developer" (say, to modularize or DRY better) vs. "helping others who may read the code later".
When I read the first edition years ago, IDEs were not as robust nor opinionated enough about refactoring. These days, majority if not all the refactoring is done by default - one just needs to click to accept, say, extracting a method. It has been a huge time saving and long-term benefit for collaborative work and fits very well within the philosophy of "continuous integration"/Kaizen etc. One could argue that lowers the importance of such book. While the IDE may do the grunt work, key decisioning remains with humans, for now. Especially since most refactoring could appear in polar opposites it is therefore even more important to understand the context - the "why" - which this book brilliantly lays out.
I do have three gripes with this edition: (1) the poor quality paper, it's as thin as tracing paper and creases so easily (2) javascript - why oh why, Martin? and (3) a personal gripe, using underscores to prefix private fields is a doozie, the author even uses the this keyword to fully quality each field as well, so you get this._surname, whereas this.surname is just so much more readable. Perhaps there is a 4th gripe in that some of the refactorings only really apply to javascript - there is no such thing as an inner function in C# or Pascal.
Anyway, I have both editions just for the fun of it.
It is great to be able to use this book as reference!
Thank you so much to Martin Fowler.







