HackerNews Readings
40,000 HackerNews book recommendations identified using NLP and deep learning

Scroll down for comments...

The Pragmatic Programmer: 20th Anniversary Edition, 2nd Edition: Your Journey to Mastery

David Thomas, Andrew Hunt, et al.

4.8 on Amazon

396 HN comments

Masters of Doom: How Two Guys Created an Empire and Transformed Pop Culture

David Kushner, Wil Wheaton, et al.

4.8 on Amazon

262 HN comments

Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems

Martin Kleppmann

4.8 on Amazon

241 HN comments

Clean Code: A Handbook of Agile Software Craftsmanship

Robert C. Martin

4.7 on Amazon

232 HN comments

Code: The Hidden Language of Computer Hardware and Software

Charles Petzold

4.6 on Amazon

186 HN comments

Cracking the Coding Interview: 189 Programming Questions and Solutions

Gayle Laakmann McDowell

4.7 on Amazon

180 HN comments

The Soul of A New Machine

Tracy Kidder

4.6 on Amazon

177 HN comments

Refactoring: Improving the Design of Existing Code (2nd Edition) (Addison-Wesley Signature Series (Fowler))

Martin Fowler

4.7 on Amazon

116 HN comments

Thinking in Systems: A Primer

Donella H. Meadows and Diana Wright

4.6 on Amazon

104 HN comments

Superintelligence: Paths, Dangers, Strategies

Nick Bostrom, Napoleon Ryan, et al.

4.4 on Amazon

90 HN comments

The Idea Factory: Bell Labs and the Great Age of American Innovation

Jon Gertner

4.6 on Amazon

85 HN comments

Effective Java

Joshua Bloch

4.8 on Amazon

84 HN comments

Domain-Driven Design: Tackling Complexity in the Heart of Software

Eric Evans

4.6 on Amazon

83 HN comments

Weapons of Math Destruction: How Big Data Increases Inequality and Threatens Democracy

Cathy O'Neil

4.5 on Amazon

75 HN comments

A Philosophy of Software Design

John Ousterhout

4.4 on Amazon

74 HN comments

Prev Page 1/16 Next
Sorted by relevance

pdimitaronNov 13, 2016

Indeed! Even though I originally got that lesson from Martin Fowler (his absolutely legendary book "Refactoring"), I do see Paul Graham's article as an amazing source of this same wisdom as well.

planxtyonAug 22, 2018

Yes, so good. Martin Fowler's Refactoring is an excellent companion to Feathers' book.

tejinderssonApr 4, 2018

Refactoring by Martin Fowler. Working Effectively with legacy code by Michael Feathers

disgruntledphd2onOct 31, 2020

Refactoring is an amazing book, but I think most people would be better served by starting with working effectively with legacy code, as it shows you how to get to a place where you can refactor confidently.

The examples are kinda dated but the approach is pretty timeless.

chonglionNov 26, 2013

From the original article:

Refactoring to Functional–Why Class?

This is a multi-part series on Refactoring to Functional Programming

hinkleyonAug 7, 2015

Read Refactoring by Fowler. You'll learn far more why and how from his prescriptions than the GoF's descriptions.

enterxonMay 18, 2014

Suggestion : Invert the order. :)

Read Refactoring first than read Design Patterns(GoF).

disgruntledphd2onFeb 10, 2021

Fowler and Beck in particular have been massively useful to me recently. Refactoring and TDD by example are wonderful books, and completely changed my approach to software.

I also love Feathers and Working Effectively with Legacy Code, but that might be more of a niche taste ;)

smurpyonNov 18, 2020

Two thumbs up for Refactoring by Fowler. Exactly. Even if you already know know the 300 odd refactorings he documents... The fact that his names let you talk about them with your team or more easily treat them as abstractions is a powerful win. That book is one of the best investments you can make.

kissgyorgyonDec 10, 2019

Read Clean Code (they are in video form) or Code Complete 2 and Refactoring books and LEARN what makes a design better than another. Talk with your colleagues about design choices in person and ask why they think one design is better than another. I truly think it's learnable.

zo1onDec 9, 2020

I would highly recommend Refactoring by Martin Fowler. Out of all the books I've read and been exposed to, that one stuck with me the most over the years.

dionianonJuly 22, 2020

I remember coming across Refactoring after having already adopted it for some years. I wish I had come across it sooner. But with my initial experience under my belt I was able to realize what a gold mine it is. Anyone working in a higher level OOP language especially should give it a read

rolaeonApr 5, 2020

Refactoring Ruby

I am a UX person, but often dabbled in Ruby on Rails. Currently for the the first time working on a more serious app and now reading the book refactoring ruby, is very illuminating, going through my code again and rereading makes me see many mistakes and possible improvements.

dotdionApr 9, 2015

Last week I finished re-reading LOTR. It was awesome.

Besides that, I am currently reading Scala in Depth (Suereth) and re-reading Refactoring (Fowler).

gnaritasonJuly 24, 2017

Smalltalk Best Practice Patterns by Kent Beck.
Refactoring by Martin Fowler. Design Patterns by the Gang of Four. Domain Driven Design by Eric Evans.

derangedHorseonDec 18, 2019

Code Complete seemed to be a book with a lot of dense, redundant content. Reading what was written had me feeling like I was reading information that could have been written by myself. Clean Code on the other hand (along with Refactoring by Martin Fowler) changed the way I write code for the better.

thestepafteronDec 7, 2018

I would recommend checking out Refactoring UI, there is a YouTube channel, blog posts, and a book coming out next Tuesday. Their tips and samples from the book have already made a huge impact on my designs.

peterthehackeronAug 16, 2021

That chart with “Weak Foundation” vs “Solid Foundation” reminds me of Martin Fowler’s chart in his Refactoring book that compares “good design” vs “no design”[0].

[0] https://martinfowler.com/bliki/DesignStaminaHypothesis.html

isuraedonMay 16, 2014

Refactoring by Martin Fowler. Extremely practical if you work with old and large code bases.

maxtilfordonNov 24, 2019

What you quoted doesn't mention an IDE at all. "extract interface" is just the name of series of steps that you can accomplish with or without an IDE.

Martin Fowler's book 'Refactoring' gives names a whole bunch of these. That might be where the op is coming from.

dbeckeronDec 27, 2012

I've been considering reading Fowler's Refactoring book, but I haven't written Java in 10 years. Is the book accessible to someone with minimal Java knowledge?

ninjakeyboardonJune 5, 2017

Domain Driven Design by Evans
PoEAA by Fowler (read his blog posts for the sequel that never came into existence such as event sourcing and cqrs as well)
Refactoring by Fowler
Event Storming by Brandolini

ebiesteronJuly 7, 2014

His book Clean Code would be a good start to what he has to say. The SOLID principles are important.

Then I'd move on to Domain Driven Design and probably Refactoring and Growing Object Oriented Software, Guided By Tests.

Those four will give a good start to what enterprise/OO people are expecting in design.

blubonOct 30, 2018

The greatest thing about this book is that it develops an antidote to the work of the gang of three (Martin, Fowler, Beck), which would have everybody write only 3 line functions TDD style if they could.

This can be seen for example in the intro chapter to Fowler's 2nd edition of Refactoring, where he pulverizes some code into submission.

tswicegoodonDec 1, 2009

Please do tell? Patterns of Enterprise Application Architecture (PEAA), Refactoring, Refactoring to Patterns, and the various Pragmatic books.

traceroute66onJuly 3, 2021

With a lot of things fighting for my time, could someone give me a TL;DR ? Specifically, is this blog post just another a re-hash of the modern web colour stuff already covered in Refactoring UI[1] ?

[1] https://www.refactoringui.com/book

re_toddonMay 31, 2014

Software Developer
1. Code Complete by Steve McConnell
2. Refactoring by Martin Fowler
3. The Pragmatic Programmer by Andrew Hunt and Dave Thomas

frosted-flakesonApr 8, 2019

In my experience, automated color palette generation tools look cool, but don't work that well. Most applications or websites need far more colours than people think, even if those colours are used sparingly. This example chapter from the Refactoring UI book called "Building Your Color Palette"[0] was quite helpful, even though I didn't buy the book.

[0] https://refactoringui.com/previews/building-your-color-palet...

TeeDubonDec 22, 2012

InclinedPlane mentioned "Working Effectively with Legacy Code," and I'd just like to add that's one of the greatest software engineering books out there.

Feathers (the author) methodologically chose to copy / inspire some of his examples from code he's worked with as a mentor / developer (some of it from his time @ Thought Works w/ Beck, et al.)

The book is similar to Fowler's Refactoring in that it provides some core thought processes / ideology and then a long list of heuristics and techniques for revising/updating legacy code. (I find his definition of "legacy code" as any software without automated testing to be challenging and insightful, especially since it indicts most code written ever. ;)

If you get the chance, you could also consider reading "Clean Code", it doesn't have /as much/ "real world" source but is still excellent.

danny_sf45onJune 8, 2021

Personal opinion: The book "Refactoring" by Fowler is one of the worst (tech) books I have ever read. I would rather refer OP to the bible of OOP: Object-Oriented Software Construction by Bertrand Meyer.

tjstankusonDec 11, 2016

There are hard copies. This site is a direct rip-off of Martin Fowler's Refactoring book, among others.

yen223onJune 4, 2021

+1 for the book. I can also recommend TailwindCSS, which is a CSS framework by the same guys behind Refactoring UI.

andrei_says_onOct 21, 2019

I’ve found Martin Fowler’s Refactoring very practical

jlaoonDec 6, 2011

I've seen so many lists like this and they always list the same books... Code Complete, Prag Prog, SICP, Design Patterns, Refactoring, etc...

gnaritasonFeb 19, 2020

They're not all writers, some just invented things like the Wiki. The original wiki, the portland pattern repository, was a hotbed of discussion among those programmers about the practices that eventually became known as agile. It was an amazing place to hang out and debate patterns, languages, and architecture with other passionate developers. There's been nothing like it since.

But from the writers:

    * Refactoring
* Patterns of Enterprise Application Architecture
* Smalltalk Best Practice Patterns
* Agile Software Development, Principles, Patterns, and Practices
* Domain-Driven Design
* Structure and Interpretation of Computer Programs
* The Pragmatic Programmer
* Design Patterns
* Analysis Patterns
* Implementation Patterns

Fowler is the most prolific writer of the bunch, but he was largely documenting and naming what he saw all of them doing.

drivers99onApr 26, 2019

Cryptonomicon as well. Coming up on its 20 year anniversary (May 1999.)

Refactoring (Martin Fowler).

Speaking of the Matrix, eXistenZ (very strange), and the Thirteenth Floor (didn't watch it), and probably some others with a similar theme like that also came out that year.

masklinnonSep 22, 2012

> First read the Fowler's 'Refactoring' book; it was written just for you.

"Refactoring" is not the tool for the job, although it's a nice sidearm.

What OP needs is the big gun, Feathers's "working effectively with legacy code": http://www.amazon.com/Working-Effectively-Legacy-Michael-Fea...

As the title hints, it was written specifically and expressly for the "I just got a huge amount of complete shit of a codebase shoved unto me, how do I survive". Just check the TOC of part 2 (the meat of the book): http://my.safaribooksonline.com/book/software-engineering-an...

> And of course, make sure your client acknowledges that it's a giant clusterf...

That's hugely important. No promises of delivery, and that the client understands it's not a cakewalk.

mtrimpeonSep 22, 2012

First read the Fowler's 'Refactoring' book; it was written just for you. Then:

1. Identify a small and easily separable piece of code (what you woud call a component in a normal system.)

2. Write tests covering every (important?) edge-case of the piece of code you want to rewrite.

3. Mercilessly refactor until it's nice and squeeky clean.

4. Lather, rinse and repeat.

And of course, make sure your client acknowledges that it's a giant clusterf... and is on board with you pulling the system out of the stone age.

Also, if you want to make life a bit more interesting for yourself, get the PHP code's AST and programmatically rewrite existing code to shared conventions for kicks.

techdmnonAug 20, 2012

This would be a much stronger argument if you didn't start by saying you hadn't read many books. Both Code Complete and Refactoring changed the way I wrote (and thought) about code in a lasting way.

douglaswlanceonDec 16, 2019

My top priority books:

    Software Requirements - Karl Wiegers

Programming TypeScript - Boris Cherny

Associate Cloud Engineer Study - Dan Sullivan

Design Patterns - Gang of Four

Refactoring - Kent Beck, Martin Fowler

Programming Pearls - Jon Bentley

Patterns of Enterprise Application Architecture - Martin Fowler

The Pragmatic Programmer - David Thomas, Andrew Hunt

CSS: The Definitive Guide - Eric A. Meyer, Estelle Weyl

Working Effectively with Legacy Code - Michael Feathers

Head First Design Patterns - Eric Freeman, Bert Bates

Code Complete - Steve McConnell

Peopleware - Tim Lister, Tom DeMarco

Clean Code - Robert C. Martin

The Clean Coder - Robert C. Martin

Clean Architecture - Robert C. Martin

Don't Make Me Think - Steve Krug

Functional Design Patterns for Express.js - Jonathan Lee Martin

The Surrender Experiment - Michael A. Singer


The best books I've ever read:

    Principles - Ray Dalio

The Power of Now - Eckhart Tolle

The Effective Executive - Peter F. Drucker

Think and Grow Rich - Napoleon Hill

Extreme Ownership - Jocko Willink, Leif Babin

Influence - Robert B. Cialdini

The Startup Way - Eric Ries

The Lean Startup - Eric Ries

12 Rules for Life - Jordan B. Peterson

Measure What Matters - John Doerr, Larry Page

The Fish That Ate the Whale - Rich Cohen

The E-Myth Revisited - Michael E. Gerber

The Score Takes Care of Itself - Bill Walsh, Steve Jamison, Craig Walsh

Management - Peter F. Drucker

Thinking in Systems - Donella H. Meadows

Blue Ocean Strategy - W. Chan Kim, Renee Mauborgne

dusklightonOct 22, 2013

Since you bring up Fowler, in his book Refactoring he gives specific examples to show why you should AVOID comments. In most situations you should try to write code that is so clear no comments are needed. That's what the above code is really about.

dusklightonFeb 28, 2019

Reading Refactoring by Martin Fowler helped me a lot. The examples are in Java but many of the concepts apply across all languages. However I would say the examples makes the most sense for statically typed languages. I wonder if anyone knows of a book that covers the concepts in Refactoring but with examples in a dynamically typed language like javascript?

pdimitaronMay 25, 2017

As a full-stack dev this is my exact experience as well. As Martin Fowler says in his book Refactoring -- don't go ahead of yourself, code your way out of the business problems, stay on top of your code, refactor periodically (even if it's only to remind yourself what does a module do!) and the best patterns for your project will emerge by themselves.

chris_jonJuly 26, 2021

The Charisma Myth by Olivia Fox Cabane. The premise of this book is that you can change your psychology to become more of a people person, by cultivating confidence, warmth and the ability to focus. It was recommended by someone on Hacker News six or seven years ago and I wish I remembered who it was so I could thank them. This book changed my life more than any other.

Apprenticeship Patterns by Adewale Oshineye and Dave Hoover: A set of "design patterns" for your career as a software engineer. I read this relatively late on, when my career was in a bit of a rut, and I credit it for giving me the motivation and the tools to get out of that rut. I wish I'd found it earlier.

Other brilliant non-technical books: The Manager's Path by Camille Fournier, Radical Candor by Kim Scott, Mastering Communication At Work by Jon Wortmann and Ethan Becker, Mindset by Carol Dweck, Drive by Daniel Pink, The Power of Habit by Charles Duhigg.

Some brilliant books focussing a bit more on tech and code craft: Growing Object Oriented Software, Guided by Tests ("The GOOS Book") by Nat Pryce and Steve Freeman, Refactoring by Martin Fowler, Clean Code and Clean Architecture by Bob Martin.

whitepoplaronDec 13, 2018

I get what you're saying, but I still stand by my answer. I've read many of the books discussed in this post, from Don Norman to Jef Raskin to Edward Tufte, and I think Steve and Adam's work is far more practical and actionable than most of the other stuff. If you want to chew on UI/UX philosophy (it really is interesting), then sure, read Tufte, but if you want to improve the design of real UIs without all the intellectual posturing, Refactoring UI is better.

awwxonSep 3, 2011

what you think I should do to improve on that

Rewrite.

Write some code, make sure it works, and then look at places where it's ugly and figure out how to rewrite it so that it's better.

You won't write good code the first time, unless you're writing something that's trivial for you (too easy).

While the examples are too Java specific, the book Refactoring by Martin Fowler is a terrific introduction to the skill of improving code.

griersononMar 2, 2020

The same way you refactor any other mid size project?
Refactoring 2nd ed by Martin Fowler mainly uses Javascript and Refactoring (Ruby edition) by Jay Fields are both dynamic.
Tests cover you when refactoring not types.

bethlyonOct 9, 2018

When TDDing the tests are going to change a lot, just like the code you are saying you write anyway. I recommend the book Refactoring for the tools so you can make the changes without breaking the test, then clean up the now-unimportant tests, and then clean up the unused code. That way the tests stay green even when making major, breaking changes.

Being able to slice projects that way, in terms of functional behavior, is absolutely a skill that requires practice. You are already thinking about what your code needs to do: the practice is to get good at expressing that in terms the computer understand. Once you are in the habit, the tests make it easier to evolve the code rather than harder.

It is possible to be a good developer without that skill, but learning and practicing the skill will make you better.

vbezhenaronAug 24, 2019

I know one guy who thinks that Fowler is wrong in very large number of points. He works as an architect in big company now (FAANG) and he did some great projects before, so I certainly trust him. For example he thinks that anemic model is the right way to do and putting methods into data objects is wrong. Unfortunately he does not want to write a book yet, so I can't reveal anything, but I just want to underline that a good engineer should not blindly trust anything, even if it seems to be written by a well received author. I, myself, read his Refactoring book and it was great.

Unfortunately I'm not qualified enough to judge those things myself, I just learned that I must doubt about anything, even if it seems to come from big names.

atulatulonDec 28, 2018

Overall liked the original post. But also liked what you said.

But here are a couple of Martin Fowler quotes (from his Refactoring book) I tend to follow:

“A heuristic we follow is that whenever we feel the need to comment something, we write a method instead.”

“Whenever I have to think to understand what the code is doing, I ask myself if I can refactor the code to make that understanding more immediately apparent.”

https://www.goodreads.com/author/quotes/25215.Martin_Fowler

JachonOct 31, 2018

"Refactoring" has a definitive origin, which is Martin Fowler's Refactoring book from 1999.

Fowler wanted to write the book using Smalltalk, but because the techniques he wanted to write about were fairly language agnostic, he did it in Java, as that was more popular. Unfortunately I think a lot of programmers missed the point, and now think refactoring is only something that can be done well in languages like Java (static typing) and with IDE support.

He's announced a second edition[0] in which he'll use JavaScript, to again prove the point that the techniques matter less than the language (other than sometimes techniques that work for class-based designs aren't as relevant as for function-based designs) and because JS is so popular. I'm not optimistic it will help anyone see the underlying point, but at the very least it might kill the idea that refactoring has to be hard in non-static-typed languages.

[0] https://martinfowler.com/articles/201803-refactoring-2nd-ed....

steegoonOct 6, 2017

I wanted to echo this. Fowler should not be lumped in with the other guys for his Refactoring book alone. Not only is it a really good guide that helps programmers understand how to rigorously make incremental, non-breaking changes. It almost reads like a specification for a refactoring tool.

Really good software engineers write more than code. They know how to clearly outline ideas than can be handed to other developers.

vikingcaffieneonAug 24, 2019

I gotta say I am surprised and a little disheartened by all the negativity around this post and Fowler in general. Fowler's writing has been a huge inspiration to me in my career. I'm about to gift a copy of his book "Refactoring" to one of the junior engineers I work with for instance.

I think the idea of an architecture as a social construct is very fitting. Software is hard when multiple people are working on it with differing backgrounds and experience. Having a rough outline (emphasis on rough here) of "what lives where" and "what is allowed to talk to what" is absolutely critical IMO. It's how your team can effectively reason about a system and add new features to it. It should also be a living thing in that it's something that is continually refined, discussed, and changed as the needs of the business change. Done right, its an organic process that really helps deliver more robust software that everyone involved has a high level understanding of.

Contrast that with an Architecture (capital A) done in Enterprise which delivers a static artifact that does not allow for any creativity and micromanages every aspect of it. It's split off into chunks and no one without an expert level of knowledge can easily understand it. That kind of design will almost certainly fall over the first time there needs to be a change to it. It's important to point out the difference because that is NOT what Fowler is recommending in his writings.

syncopatienceonOct 16, 2016

Could anyone weigh in on his assessment of Martin Fowler's Refactoring book? I'm considering picking it up - some seem to be of the opinion that its ideas are old news in 2016 and there's not much to learn from it, others say there's still lots of useful information.

JtsummersonMay 25, 2021

The Pragmatic Programmer, Refactoring (I'm rereading it after many years with the 2018 edition, opinion not totally formed on this one), Working Effectively With Legacy Code, A Philosophy of Software Design. It's been a long time since I've read Clean Code, I don't quite get the hate from the other thread here today so I'm rereading it now. I figure it'll take me a couple days and worst case I'll agree with the criticism and stop recommending it.

InclinedPlaneonDec 22, 2012

Well, this brings up another problem. And that is that software development is not applied computer science. There are plenty of books which will teach you skills on dealing with real-world code (Refactoring and Working Effectively With Legacy Code being two of the biggies) and there are books that will teach you about other important aspects of development processes (such as Code Complete, Rapid Development, Design Patterns, The Pragmatic Programmer, etc. although those books are showing their age a bit these days) but none of those would be considered computer science textbooks.

FrancescoRizzionAug 29, 2012

I, for one, recommend "Clean Code". It did not "change my life" because I was already on the path the book describes. Nonetheless it was a good validation, it certainly coalesced in a good form many topics that were simply fluctuating in my mind, and is a good reference to have around for refreshing once in a while.

To put this in context: I keep it next to "Agile Software Development" (by the same Uncle Bob), "Working Effectively with Legacy Code" (by M. Feathers), and "Refactoring" (by M. Fowler).

HTH (no, I have no direct or indirect benefit from 'advertising' these books and their authors)

NeverYouMindonJan 26, 2018

I found myself in a similar situation recently. This may give you something to think about...

http://thecodelesscode.com/case/33

You might want to do some reading of books about how to promote institutional change from within. If you can read, and then get your manager to read, "Creating a Software Engineering Culture" by Karl Wiegers, that might help. Also, "Refactoring" by Martin Fowler is highly advised.

Regardless, maintaining good relationships with your coworkers, and specifically your manager is key. One key insight I have gathered over the years is that whenever possible, there are benefits to avoiding telling someone "this is a problem/bad/whatever and needs to be fixed" if it is instead possible to say "That's great, and it would be even better if..." The criticism in the first form invokes a immediate defensive reaction once someone hears "this is a problem" which may cause them to not hear whatever you say next, and can create a teacher vs. student dynamic (see Pavlov's work on negative conditioning) in which they may actively start to resist your suggestions, while the second form is more likely to cause them to feel good at having been praised and want to seek further approval (positive conditioning, which tends to be much more effective and produce more long-lasting behavior changes in most circumstances). Some research on self-serving bias suggests that people are much more likely to believe what you are telling them if you can phrase it in a way such that it sounds like praise.

Good luck!

steveklabnikonNov 27, 2010

I might as well get all of the big names out of the way.

* Design Patterns: Elements of Reusable Object-Oriented Software

* Refactoring: Improving the Design of Existing Code

* Clean Code: A Handbook of Agile Software Craftsmanship

* Code Complete: A Practical Handbook of Software Construction

And some others:

* Working Effectively with Legacy Code

* Domain-Driven Design: Tackling Complexity in the Heart of Software

lukesanonNov 6, 2014

I would start with Refactoring by Martin Fowler. For me this is the quintessential book when it comes to basic software design principles. It introduces code smells and tells you step by step how and why to improve your code design

alasdair_onDec 2, 2018

I am a huge fan of this book. The Pragmatic Programmer and this book are the two that I recommend most.

When I first read Refactoring, IntelliJ wasn't released yet and refactorings still needed to be done by hand. Automated refactorings are so incredibly useful when it comes to improving code quality over time that I don't know what it was we did without them.

gruseomonDec 3, 2010

In my opinion, Eric Evans' Domain Driven Design is just about the only book that gets OO right. Martin Fowler's Refactoring is pretty good on the technical side of things. I would avoid design patterns like the plague (edit: other than the Kent Beck Smalltalk book, which lots of smart people like - this is the one recommended by duck in this thread), but others disagree.

Don't take this as advice against learning what you want to learn, but I'd caution against the idea that "object-oriented programming" and "good programming" are the same thing (or even that they are correlated). OO in its various incarnations comes with a tremendous amount of baggage. It took me years to figure out I didn't need it, and that insight made me a much better programmer.

troelsonJuly 25, 2017

"Patterns of Enterprise Application Architecture" by Martin Fowler made a big difference for me at the time. Also, "Domain Driven Design" by Eric Evans. Both have a focus on high level architecture.

Of books that are more on the craft of programming, "Refactoring" (Also Fowler) is good. And I enjoyed "Practical Common Lisp" by Peter Seibel too.

In general, I suspect that the value of a book has more to do with where the reader is, than where the book is.

lcallonSep 4, 2018

Upvoted, and I would also say the Book of Mormon, with the Bible. The BoM reinforces the Bible's teachings powerfully, and as I age and read again, sometimes in other languages, and some scholarly things about it, they both just keep getting better and better. Including in their effect on me. You can get a copy of either one for free.

Edit:
Additionally, some which have been mentioned or not:

- a couple of biographies of Lincoln (one is free on gutenberg.org, the other more recent by Doris Kearns Goodwin), and one of Washington whose name I forget now, but there are good ones out there.

- the 7 Habits book (Covey), and How to Win Friends and Influence People by Carnegie.

- Refactoring ..., by Martin Fowler.

- some thick Scheme programming book from college (sorry, it's downstairs). And "The Little Schemer", also about Scheme (one of the authors, Friedman, was also our instructor).

- Since Cumorah, by Hugh Nibley (maybe dated now, but there is a lot of related work). Really got me interested in related topics.

hinkleyonAug 3, 2019

There’s a lot of power in refactoring, but I’ll allow that some of it is counterintuitive. Anything counterintuitive requires state of mind and experience to line up and that’s quite hit or miss.

When that awful Design Patterns book was off the hype train but the new devs had heard about it and asked if they should read it, I would tell them No, read Refactoring twice instead, because it tells you why and when to use this stuff, which is much more valuable. Like feature work, if you know why you are doing something you can often reason out the gaps in the “what” on your own.

We sort of take a bunch of XP processes as a given and forget that this was Agile for most people at the time of the manifesto. Scrum pretends it’s separate but is essentially useless without half of XP.

cableshaftonOct 23, 2015

You Google "Martin Fowler" and the snippet of text that accompanies his personal website is "Object-oriented programming expert and consultant, one of the leaders in refactoring, author of the book 'Refactoring: Improving the Design of Existing Code'"

He's a self-proclaimed "expert" and a "leader". Yes, he's basically saying right there that he is an authority on writing code.

That being said, I've read some of his Refactoring book awhile ago, and it's mostly good advice from what I remember.

blktigeronMar 27, 2018

Keep in mind that the original was written back in 2000. So most of the ideas in the book are pretty much mainstream these days. The second edition should be pretty interesting because of the move away from being class-centric.

When I was in college, I read "Refactoring to Patterns" which pretty much sums up Refactoring in a short chapter. The ideas aren't really that complicated, but seeing some practical examples is pretty useful.

[1] https://www.martinfowler.com/books/r2p.html

famousactressonDec 6, 2011

Man, still Code Complete? I dunno. Wasn't that big a fan, honestly. I think I got more out of the first three chapters than the sum of the rest of the book.

If we're talking about technical books, Refactoring is easily the most beneficial read I can remember having. I was pleased to see it (barely) trump Design Patterns... a book that I think (through no real fault of it's own) has spoiled more developer-years than it's benefitted.

JtsummersonJune 25, 2021

Eric Evans' Domain-Driven Design. I've heard enough about DDD over the years that I figured I'd just go to the source. Liking it so far, I have some good takeaways but we'll see how effectively I'm able to use the ideas over the next couple years.

Martin Kleppmann's Designing Data-Intensive Applications. Based on the frequent praise it receives here, haven't gotten far yet. I have some project ideas (for personal and professional projects) that could benefit from reading through it.

Martin Fowler's 2018 update to Refactoring. I read the original one a long time ago. In context, we have a work lunch & learn series and I'm interested in doing some presentations on the topic of refactoring (why, how, and when in particular) so it seemed appropriate to refresh my memory on some specific terminology from the book as well as to see if it's an appropriate book to recommend to colleagues. My recollection of the first edition is that I'd recommend it to colleagues, but it's been so long I'd rather read it once more before actually recommending it.

I reread Robert C. Martin's Clean Code based on some recent discussion here where it was rather strongly dismissed by a fair number of people. I didn't recall it being bad, my reread confirmed it is not, in fact, bad. Java-heavy, which is now an unpopular style of OOP, but otherwise a very good book. I'd still recommend it to junior colleagues paired with some caveats about avoiding seeing the world in black & white. There is no singular Way of Programming, but learn various ways and find what works for you and your team.

There are some more, but it's almost 5am and I haven't been able to sleep so I don't recall everything that's in the book stack or ebook queue. These are the ones I'm most interested in at present.

joebadmoonDec 11, 2012

I find it interesting that the two examples he gives of "proper professions" are highly regulated guild-like professions whose values are artificially inflated, at least to some degree.

I'm only a very new programmer, but I'm reading Martin Fowler's Refactoring and, even from my limited experience I'm finding that one of the differences between software and other products is that software must be maintainable. So the end user isn't the only end user. Software has to be read and worked on by other programmers in future, and most of the craft involved is not in making a program simply work as it's supposed to, but making the code easy to read, easy to maintain, and easy to modify.

So the aesthetic quality of the code and the craftsmanship involved is very important, for pragmatic and eventually end-user-facing reasons.

But hey, what do I know? I haven't gone to programmer's school or gotten a programmer's license or anything.

un_montagnardonOct 21, 2019

Refactoring by Martin Fowler and Kent Beck.

Patterns of Enterprise Application Architecture by Martin Fowler.

Domain Driven Design by Eric Evans.

Growing Object-Oriented Software, guided by tests by Steve Freeman and Nat Pryce.

wpietrionJan 4, 2021

I don't think I'm missing that point.

Once the technical debt is so deep that bankruptcy seems like a good option, digging out is also not a great option. It's certainly possible now if it wasn't then; people like Michael Feathers have done great work charting paths out of an accumulation of garbage code. But at the time of JWZ's resignation letter, Martin Fowler's book Refactoring had been out for all of 3 months.

In particular, Netscape was faced with a choice: they could either do a total rewrite quickly, or take much longer to do a slow rewrite while still pushing forward, but at a much reduced development speed. That's fine if you're some large enterprise in a stable field with a solid revenue stream. But a startup competing in the then-fast-evolving world of the Internet? Competing against the monopolistic giant of Microsoft, who was desperate to dominate the space?

There's little reason to think a slow cleanup would have been any better than a fast rewrite for Netscape. Especially if their solution involved open-sourcing things, which a) requires a non-awful code base, and b) reduces the pace of refactoring and cleanup. So I think it's fair to say that either way Netscape was killed by technical debt.

copperxonSep 20, 2019

I haven't read it, but I've heard a lot of praise for Refactoring by Fowler for being immediately useful during maintenance.

bszupnickonFeb 12, 2020

Refactoring by Martin Fowler.

He takes you through a piece of code and refactors it all into smaller and more usable parts explaining what he's doing along the way. He does this with two difference pieces of code, if I recall correctly, then the third part is an index of all possible refactors.

I read it cover to cover in less than a week and has totally changed the way I program.

pvarangotonDec 16, 2018

This is not as unpopular as what reading about productivity and process from blogs or books by people who sell canned methodologies will make you think. Thinking retrospectively I think more than half of the projects I've worked in practiced agile in a way more akin to your views than to what you are complaining about "everyone does".

It's also not too different to what old books like Fowler's refactoring or the Working With Legacy Code book say, or what modern books like Philosophy of Software Design say.

InclinedPlaneonMay 17, 2014

Seems like you fell into the typical CS trap. The problem is that Computer Science is not software engineering, and the dev skills you need aren't going to magically fall out from between the pages of CS books. What you need is more dev oriented knowledge and experience/practice.

A couple books that are worthwhile: "Refactoring" and "Rapid Development". That will teach you a lot of basic skills in terms of development process and how to improve the design of real systems (warts and all). Also, take a look at the Architecture of Open Source Systems, it'll acquaint you with how applications fit together.

Also, take on some projects. Pick something interesting and work on it. Pick some small stuff then move up from there. I'd suggest in your case eventually building a compiler. If you're interested in AI, build some simple games and work on building AI for them. There is nothing more important than actually writing code.

hinkleyonNov 15, 2019

And then I will repeat

> We may have diluted the meaning of refactor

And I will quote the summary for Refactoring by Martin Fowler:

> Refactoring is a controlled technique for improving the design of an existing code base. Its essence is applying a series of small behavior-preserving transformations, each of which "too small to be worth doing"...

If words don't mean anything it's really hard to have conversations and it's insanity to try to create strategy around them.

zo1onMar 6, 2015

For me, I think the biggest one was Refactoring by Martin Fowler, which you can find here: http://refactoring.com/

This post almost seems to be turning out to be an AskHN, with everyone chiming in on their 'career-changing' programming books.

alex-lawrenceonDec 20, 2020

In fact, the book was called "Implementing DDD, CQRS and Event Sourcing in Node.js" up until the release of its complete version. I thought about this for a longer time and decided to remove the "in Node.js" part from the title. Instead, I made it clear in the book description. In my opinion, the book can be valuable for anyone who is interested in the concepts, regardless of technology choices.

I think that it is fair to say that my book is partially also about Node.js, but not primarily. I wouldn't say though it is about JS. In fact, many of the code examples would look similar in other languages. Furthermore, the use of Node.js helps to provide concise code examples and executable code without much ceremony.

When reading "Implementing Domain-Driven Design" by Vaughn Vernon, all the code examples are in Java. The book "Enterprise Integration Patterns" has a lot of code examples and all of them are also in Java. The most recent edition of "Refactoring" by Martin Fowler uses JavaScript. Still, I wouldn't say that these books are about a particular programming language.

q845712onMar 7, 2021

That's interesting - thanks!

I think "catalogers" as I'm thinking of them are by nature not quite pioneers, since the fundamental move of cataloging is to describe and categorize what already exists, but might often be settlers, in the sense that a good career move for a cataloger is to be the first to apply a new process to gain insight into new distinctions or categories. In that sense I would see GoF themselves acting as "settlers" in their Design Patterns book, which I tend to view as a catalog project.

However books like "Refactoring", and "Working effectively With Legacy Code" also turn into partial cataloging projects, but those might overlap more with "town planner" in that they're really leveraging some mature technologies and looking for system-level economic savings of readability/changeability/maintainability.

So I guess I'd continue to argue that it's a "mindset" as much as "a type of person"; "Working Effectively With Legacy Code" isn't _only_ a catalog, but there's parts of it that come from a catalog mindset.

Regardless, I hadn't seen the above mapping you linked and I appreciate it!

nostrademonsonAug 20, 2014

I disagree with this. I read every software engineering book I could get my hands on when I was in school - GoF, Refactoring, SICP, Pragmatic Programmer, XP Explained, Implementation of Functional Programming Languages, TAPL, Basic Category Theory, On Lisp, Art of the Metaobject Protocol, numerous textbooks I wasn't assigned. As a result, my code ended up overcomplicated, with a bunch of cool algorithms, a lot of OO design, a nice smattering of patterns...but relatively few useful solutions for people. It was only when I was like "Alright, I've already read every book anyone I've met has ever mentioned...I need to push through and actually finish a project now" that my skills started shooting up.

Write code first. Write code until your programs collapse under their own weight. Then go out and read what the masters have written. You'll understand it much better when you have personally faced the problems that they were facing.

mimixcoonDec 4, 2020

Refactoring by Martin Fowler

wpannellonApr 28, 2018

Interesting innovation. Coincides with 2nd Edition of Martin Fowler's "Refactoring," for which he chose to code in javascript. Interested in feedback from the mocking pioneers — Steve Freeman, Nat Pryce, Keiþ Braiþvvaite — and, of course, the father of TDD — Kent Beck.

Is there sample code illustrating the pattern language?

JachonFeb 28, 2019

There's a term for this, Chesterton's Fence: https://en.wikipedia.org/wiki/Wikipedia:Chesterton%27s_fence

> let us say, for the sake of simplicity, a fence or gate erected across a road. The more modern type of reformer goes gaily up to it and says, "I don't see the use of this; let us clear it away." To which the more intelligent type of reformer will do well to answer: "If you don't see the use of it, I certainly won't let you clear it away. Go away and think. Then, when you can come back and tell me that you do see the use of it, I may allow you to destroy it."

That said, if you know how to refactor safely even without tests, you can make improvements. Since the questioner is working in JavaScript, Martin Fowler came out with a second edition of Refactoring with JS code that might be useful.

I've never read the first edition (in Java) but Michael Feathers' Working Effectively With Legacy Code is a frequent recommendation of mine. Its main goal is to get your mess under test, ideally tests that help you understand the system as well as improve its quality. It's organized as a set of questions one finds oneself asking in these kinds of code bases and some ways to resolve them: https://www.oreilly.com/library/view/working-effectively-wit...

animeshonJan 11, 2020

Refactoring by Martin Fowler.

RapzidonDec 26, 2018

I have my own rule of three that I also try to apply to use cases for adding functionality in a way that's not overly specific. Never heard of it before.

But now that you mention it, I haven't actually read Refactoring :| The knowledge actually required for programming is tiny compared to what's available; people's exposure is all over the map.

ngcazzonFeb 2, 2020

Her book with Katrina Owen “99 Bottles of OOP” lays out an even better case for this I think. Particularly useful is the introduced language to help measure the state of a codebase (“shamelessly green” vs “incomprehensibly concise” etc).

Also quite like Fowler’s observation in Refactoring that (to paraphrase) abstractions are earned, not enforced.

eldavidoonMar 26, 2016

+1. Really can't recommend Feathers enough. Along with "Refactoring" by Fowler, these books have influenced my development style a ton even on non-legacy code, by providing structured approaches to improving code quality, and a shared language for talking about it.

Without looking at the book, a few things from Feathers I think about often:

- The concept of "sensing" is useful when thinking about test design. I alternate between state-based TDD vs. a more behaviorist/mockist style depending on whether the code's job is fundamentally about managing state, or routing requests to other components (a surprisingly useful distinction)

- Converting methods to "virtual" can be pretty useful when it's too hard to introduce an interface, but you want to mock/stub out a component

- "Sprouting" is a nice way to think about how a class can "Grow" out of existing code, same for methods and parameter clumps (from Fowler)

- It's also a darned humorous and funny book. "The case of the irritating parameter", "Help, this code just calls a bunch of other code", "This class is impossible to get under test", etc. I love the writing style and how he stops just short of hyperbole while still making me grin.

derstanderonMay 22, 2018

I was wondering the same thing myself. I know it's unscientific / biased, but I usually take a quick peak at the Amazon reviews. Here's the summary, in case it helps anyone else:

- Programming Voice Interfaces = no reviews

- Mobile App Development with Ionic = 3.5 stars (3 reviews)

- JSON at Work = no reviews

- Refactoring JavaScript = 5 stars (2 reviews)

- CSS Refactoring = 4 stars (4 reviews)

- Interactive Data Visualization for the Web = 5 stars (16 reviews)

- Learning React Native = 5 stars (2 reviews)

- Learning HTTP/2 = 4.5 stars (7 reviews)

- SVG Animations = 4.5 stars (8 reviews)

- Working with Static Sites = no reviews

- React Native Cookbook = no reviews

- CSS: The Definitive Guide = 5 stars (13 reviews)

- Using SVG with CSS3 and HTML5 = 5 stars (1 review)

- Learning React = 4 stars (22 reviews)

- High Performance Images = 5 stars (1 review)

The sample size of reviews for most of the books is a little limited, but I'm planning on picking up the bundle at the $15 level anyway -- CSS: The Definitive Guide is well-reviewed (and expensive by itself).

nthjonApr 23, 2013

Note I said -refactor-, not -rewrite-. I am not a fan of rewriting apps: developers always underestimate the complexity involved, and then business rules change along the way, and it's just a mess.

Refactoring is when you rework a specific section of code, usually that you're about to work on, or just worked on, to be cleaner. It's a long-term approach, and it's how large applications stay maintainable over the long term. For your specific example, you'd leave your app alone. You wouldn't rewrite it, or touch it, until you find a bug, or need to add a new feature, and then you'd rework anything you need to to add the feature cleanly.

On a related note, Refactoring by Martin Fowler is a great book, and I'd recommend everybody pick up a copy. It's a beautiful hardcover and looks great on a shelf, too.

http://www.amazon.com/Refactoring-Improving-Design-Existing-...

beatonAug 1, 2018

I don't agree there. Classics should be kept - stuff like the Dragon book (compiler theory), Refactoring, Knuth's Art of Computer Programming series, etc. But frankly, most books about our industry are trash - throwaway material that will be as obsolete as buggy whips, in a lot less time. But the good books never become obsolete.

I recently picked up a copy of The Mythical Man-Month, from 1975. There's hardly a line in it that doesn't still apply today.

famousactressonSep 4, 2013

The article and Fowler's Refactoring book had a similar effect on me as well. Your point about statically typed programming languages is one that I've been feeling the brunt of, though I'm not convinced yet.

I've been 100% python for the last few years, after a career mostly in Java and I definitely miss the sweeping refactoring abilities and hard-breaks during those kinds of refactorings. It does lend courage for sure. I'm just SO MUCH MORE productive in python for most of what I do that I'm not willing to throw out the baby with the bathwater yet. Instead I've been trying to focus on leveling up test coverage, and experimenting with Rope for refactorings ( http://rope.sourceforge.net/ ). I'm also slowly learning patterns for coding to make refactorings easier moving forward.. choosing code and data structures that are more easily affect-able later, or even things as simple as naming things for grep-ability.

technofireonJuly 20, 2017

I agree with several other users on this thread about maintaining existing code. If you aren't already working in a position in which you have to modify code written by others, try to start fixing bugs or writing features for an open source project. In either case you should immediately see how frustrating it is to try to figure out why things in the code base are the way they are, and I think the best solution is not documentation but clear, clean code that self-documents, not with comments but with small focused recipe-like functions. Bob Martin's book Clean Code[1] is a quick read that makes clear how this can be done effectively. Martin Fowler's book[2] is another obviously good illustration.

The second thing that has really influenced my coding style for the better (making it clearer and easier to understand) is writing a medium-sized program using a strictly functional language like Erlang. This will force you to use global state less, to write functions in such a manner that the function itself includes all the information required to understand it, simply because global state cannot be used and everything on which the function operates must be passed into it explicitly via its parameters.

[1] Clean Code (Robert Martin)
http://amzn.to/2uewcpB

[2] Refactoring (Martin Fowler)
http://amzn.to/2vnD7vx

SomeCallMeTimonJuly 20, 2016

>code with Java Syndrome

You might find that most of the Design Patterns and even some of the Refactoring book are focused on working around limitations in Java/C++-style languages.

>Although, I should probably get around to reading Refactoring, and Design Patterns

I'd been programming for 20 years before reading either.

Both were...entirely unsurprising. Design Patterns at least defined a useful vocabulary for talking about different patterns, so I found it useful in that respect, and at least some of the patterns are useful outside of a Java/C++ language. Refactoring had some good wisdom on OO design, but it was pretty much all stuff I'd picked up elsewhere or come up with on my own.

Wouldn't hurt to read through both at least once to see if there are any surprises for you. Might be safe to just check them out of the library, though. I kept Design Patterns around but gave away my Refactoring copy.

Cthulhu_onFeb 12, 2020

Yeah, this is a known design pattern known as the Parameter Object (from Fowler's Refactoring book) (see https://wiki.c2.com/?ParameterObject). I am of two minds on it though, since it does add boilerplate to your codebase - especially if you start adding things like the builder pattern, or if you want to make arguments mandatory (e.g. via asserts).

I use intellij which can offer inline parameter name hints, I think that's a good middle ground but it doesn't make things more readable outside of that editor.

kidmenotonJuly 24, 2017

Not the user you replied to but, according to my experience, Code Complete is useful in that, as many other well-written books, it gives advice that comes from common sense and gives it a name. Much like Martin Fowler did with Refactoring, after all: breaking down long methods into smaller, well-named ones is common sense, but calling it Extract Method gives everybody a handle to use for further research.

Saying that whoever recommends Code Complete made some wrong life choices is a bit rude and uncalled for. Books are just tools, the benefits they bring depend on whether the reader goes through them in a smart way or not.

Then again, but this is a matter of taste, I would suggest The Pragmatic Programmer as a first read. It's shorter, well-written and with laser-like focus on the topic at hand.

Lastly, since designing and writing software is as much of an art as it is science, what's really important is to avoid reading passively and blindly applying anything the knowledge one finds in a book, and instead strive to understand why, and going against the grain and see why certain practices are called "best".

dave_sidonJuly 5, 2020

You are correct that the problem lies at point 6. However a problem only exists if programmer B decides that it is acceptable to keep adding conditional logic to the method. Wrong. This is just a case of programmer B not knowing how to refactor properly. There really is nothing else to it. Yes remove duplication. Then if later on, that duplication then requires conditional logic then refactor to replace the conditional logic with polymorphism. Both these steps are clearly defined on Martin Fowler’s Refactoring book and just need to be applied when the time comes.

I think the article has the premise that once you remove duplication you have committed to using that abstraction and need to shoehorn all future changes into that function. That’s a ridiculous notion. You can simply refactor it again if the abstraction no longer makes sense.

waheooonOct 31, 2020

Yup! And then sometimes it's actually advantageous to specialise systems into a corner, it has benefits, but these decisions need to be considered and made with care, and then it needs to be an understood limitation going forward that it can't be rolled back at a later time without a high cost.

Thinking about the above further I notice the things I've learned over the years also require the ability to link problem to cause, or in my case it came in reverse, cause linked to problem.

I ran into problems for years, learned how to fix them, and then during code reviews (even in self review), discovered the cause behind these problems.

Sometimes these were causes that would only become problems at a later date because of knock on effects.

I don't know how you teach that. Possibly antipatterns / code smells which usually hint at underlying problems that may be elsewhere / at a different level.

Refactoring by Fowler and TDD by Beck cover a lot of these in good detail.

acesubidoonAug 30, 2019

For personalities try Jason Friedman. Martin Fowler's Refactoring is a nice read too.

But personally, I'd like to ask what business goal are we looking to solve? Because regardless of how murky a codebase can be, if that codebase keeps hitting a business goal, then we really can't drive a change in practices.

So, we first present business goals. Here's a few examples:

If the business goal is to give better estimates for fulfilling custom features faster, then testing would be the first in the list. Not even the release process. Tests lessens cognitive load for developers when they're asked "how long can we make this feature?". They'll have an idea that it'll probably break a bunch of services, etc. a.) If you're in leadership, ask for tests when people make a PR. b.) If you're not in leadership, look for the smallest part of the monolith. Write 1 integration test, add a CI integration, put it in a PR. Co-workers would probably like that.

If the business goal is to give better SLA's (turn around time for addressing breaking bugs, scaling better), then the release process would come first.

Regarding technical debt: One way to address technical debt is to slowly address it by folding in the effort of cleaning and refactoring inside a feature request. ex: making a new form about 2FA takes 3 days, but you can say 7 and explain that we'll setup a CI test build, then hit and address some debt regarding User Authentication along the way.

It'll introduce as a "Clean As You Go" culture in the legacy engineering team, which will pay off in the long-run instead of having a huge amount of time just dedicated to addressing technical debt.

The danger of separating "address technical debt" as a separate effort is it sometimes results into some unnecessary abstractions and over-refactoring: i.e. trying to make certain things too generic, bordering on building a framework.

But then again, if the business goal was to make a framework for a business goal (maybe something the bizdev can sell), then it can definitely be made as a separate effort. Otherwise, it'll be seen in the bizdev as someone just "playing" around with tech.

JachonMar 30, 2019

Clojure has a type system... but I know what you mean. Perhaps you could expense a copy of Martin Fowler's new 2nd edition of Refactoring? It uses JavaScript, so applying the lessons to Clojure will be even easier. Refactoring in dynamic languages just isn't an obstacle for some of us, I don't know why, but that book is the only thing I can think of that might help someone having trouble bridge the gap.

hinkleyonNov 13, 2018

Testing is hard. Something I repeat often to frustrated testers. At least once a quarter I wonder if maybe something this hard should be accomplished another way. Like maybe Bertrand Meyer was right 30 years ago about contracts and pre/post conditions.

For years I felt like a terrible tester on a team of even worse testers. I still catch myself using antipattetms I tell other people not to use.

Honestly the two biggest things I know are try to write pure functions, and separate deciding from doing (these are not mutally exclusive), something Meyer also talked about. That will open up a lot of your code to simple tests with few mocks.

Book advice is going to sound like a non sequitur. I find bad habits in many of the testing books I’ve read, like the author hasn’t root caused common problems that pop up on real teams. You can’t blame human frailty for your testing problems. Testing is a monument to human fallability. Own it.

You can fix a lot of classes of problems with Refactoring by Fowler. There’s a second edition due out in a few months. I hope it maintaina the value judgements and thought processes if the original.

hxa7241onJan 2, 2012

It is because it is unstructured -- in the Dijkstra 'structured programming' sense. The flow is no longer nested, so you cannot skim over -- mentally fold -- parts. It also means the effects of transformations are less 'limited'.

With structured code, if you put a statement after a block it will be executed (notwithstanding exceptions, but that is a slightly different matter...), no matter what is changed. But if you have returns, breaks, etc. that structural condition is lost.

If you have a function with a statement, or block, at the very end, to clear something up or something, but then someone puts an early return in, the clear-up will be missed. There is a certain error-proneness there.

The best use of the early-return pattern ('replace nested conditional with guard clauses' in the Refactoring book) is where that is the only thing going on in the function. So you are effectively reading/understanding the whole thing as an 'early-return function'.

(And software is very different from natural languages. When you look at software what you see is not language, but a machine. And it has a particular hierarchical structure.)

SideburnsOfDoomonJune 14, 2012

demand more money now, concentrate on learning to work with people, but do not give up on code quality.

Not entirely, anyway. You can't turn the whole app into a good one in any reasonable time, but when you fix a bug, take time to apply the boy scout rule ( http://www.informit.com/articles/article.aspx?p=1235624&... ) Don't put that down as a separate task that your management can approve or deny, it's part of doing the job of coding properly. That way, at least the buggy parts of the app get better.

You should not be focused only on your career when making coding and tech decisions, but look at it this way: in a year's time, you're in an interview for a job you really want. What are you going to say "I can read and maintain shitty code" or "I can make shitty code better"?

Also consider: documenting your app's architecture (or lack of it) and conventions (or lack of them).

Also consider: reading up on architecture, testing, refactoring and code quality. If nothing else, these will help you get your next, better job. Off the top of my head, try "Domain Driven Design" by Eric Evans, "Growing object-oriented software guided by tests", "Refactoring" By Martin Fowler, and on the last topic "Clean code" by Robert Martin and "Code Complete" by Steve McConnell

Big ball of mud apps (http://www.laputan.org/mud/ ) may be common, but it doesn't have to be that way - you can learn some pitfalls to avoid

joe_the_useronNov 13, 2010

I like the book Refactoring too.

But I don't think the book, in itself, can cited as evidence that he's built large, real-world systems.

There's a big step between "no experience" and "major experience with large scale, distributed systems".

When I had six months of programming experience, I could do a fine rendition of the standard OO doctrines. With far more experience now, I can mostly describe how they fail to operate in the real world.

EdwardCoffinonMar 10, 2012

I suggest starting with a simple, straightforward representation for the data model, and start programming the functionality you want. As you implement this functionality, you will encounter pain-points which make you wish you'd used a different representation. After a number of these, you may have some ideas for a different, more appropriate representation you wish you'd used. If the two representations are close enough, you may be able to just refactor what you have into this new form, then continue. If they are different enough, declare what you have done so far a learning experience, abandon it, and start over, using your new idea(s) for a new representation.

I can think of two different major projects I've done in the past five years in which I started again from scratch, after major revelations made it clear to me that it was the right thing to do. In one I settled on the third object model, and the other I know I did at least two. These were quick iterations though: I settled on the third and final object model within a month of starting, and the project completed in seven months, so it's not like I was throwing out that much work.

Avoid premature optimization with all your might.

Fowler's book Refactoring might be helpful with ideas of how to morph data models.

A couple of quotations from More Programming Pearls by Jon Bentley:

"Plan to throw one away, you will anyhow." [Fred Brooks's law of prototypes]
"It is faster to make a four-inch mirror then a six-inch mirror than to make a six-inch mirror." [Thompson's rule for first-time telescope makers]

cliffbeanonJune 1, 2012

When I discovered the phrase "Speculative Generality" in Fowler's Refactoring book I suddenly realized there was a name for a problem I already knew I had. This is one specific kind of over-engineering which we can identify -- when creating an abstraction, are you doing so in anticipation of an actual need, or merely of an imagined need?

Another kind of over-engineering is speculative optimization (often called "Premature Optimization", but I like to emphasize the speculative nature of it, because that's the heart of the issue). Am I working to make the system faster in response to actual evidence of a performance problem, or am I just guessing about performance?

Over-engineering isn't always bad. It's all about predicting the future and weighing risks, with everything that entails. It's hard, but it's a fundamental part of design, and of life.

Whenever I'm unsure about whether a particular speculative generality or optimization is justified, I try to step back and find implicit assumptions. I try to turn "This might help some day" into "I'll need this if XYZ happens". If I can't do that, it's a bad sign.

And I agree with the original author's point: making mistakes in places where you can afford to fail, or where you can afford to recover, is a great way to learn.

edwinnathanielonDec 26, 2012

I'd say software is becoming more 'specialized'.

My alma-mater (UBC.ca), the CS Dept touches a few subjects:

- Design Patterns (still using GoF, which is probably not the right fit for 3rd year students)

- Refactoring (we do refer to Martin Fowler's book albeit we don't dig that deep)

- Barbara Liskov book (touches a few thing regarding type-systems and its relation with OOP, IN-OUT contract/verification, a bit more academic/formal but most of us saw her work in C# contracts, the L in SOLID principles, some of the OOP best practices probably).

stcredzeroonApr 27, 2010

Of these, I have read, at least a significant portion of:

    - C Programming Language (2nd Edition)
- Refactoring: Improving the Design of Existing Code
- The Mythical Man-Month
- Programming Pearls

The last two were due to one undergraduate CS professor assigning them.

If you feel you've almost gotten OO, but not quite, then Refactoring is a great book. That one lit up the "ah ha" lightbulb for me.

hinkleyonMar 5, 2018

Whenever anyone asks me if they should read Design Patterns by Gamma et al, I tell them to go read Refactoring. If they say they've already read it I tell them to read it again.

The patterns are loosely what to do, but that's not the thing that lasts across the years and languages. Refactoring is why and how.

csnewbonDec 27, 2018

Sci-fi

- Ready Player One

- Pattern Recognition

- Burning Chrome

- Do Androids Dream of Electric Sheep?

- Hyperion

- A Fire Upon The Deep

Technical (backend development + security)

- HTTP: The Definitive Guide

- RESTful Web Services

- Designing Data Intensive Applications

- Web Scalability for Startup Engineers

- The Art of Software Security Assessment

- The Web Application Hacker's Handbook

- A Philosophy of Software Design

- Clean Architecture

- The Go Programming Language

- Refactoring (new 2nd edition)

- Algorithm Design Manual

- Cracking The Coding Interview

I'll definitely be able to get through all the sci-fi novels, but not the technical stuff. At minimum I need to go through the technical interview prep books, refactoring, and designing scalable applications.

vizerothonOct 15, 2016

Most of the books on the first list represent those I would only read once, and never again (or never at all, like "Head First [Anything]"). The C Programming Language and Refactoring are the exceptions. K&R was one of the textbooks in my first CS class, and the first CS book I read which was still useful to me 10 years later.

The books on the second list which I have read (at least partially) are books I have had reason to go back to at some point in my career, and any of them which I no longer have, I will likely purchase again.

SandB0xonNov 11, 2009

For spaghetti code problems the classic book is Refactoring. He has a whole chapter on "Code Smells" and most of the book is basically an extensive catalogue of techniques you can use to eliminate these.

More modern languages like Ruby will allow even cleaner ways of doing things than described in Refactoring (Java), but you can get a good sense for smells common to all languages.

Some other thoughts:

What science are you studying? There's often scope to do something computational for your thesis/project/dissertation - modelling some physical or biological process.

Other ideas:
Try and get an internship at a software company. Often a science degree is sufficient and you'll be able to learn about working in teams, using source control, and observe the kinds of things you like and dislike in a workplace.

You could also do a CS conversion course once you've finished this degree.

c00p3ronFeb 17, 2009

OK. I will try to explain.

There are big problems with software development - complexity and requirement of the special state of the mind. This is why there are still no programming factories. There are already data-indexing and query processing factories, but you still should think and write.

All those methods, form Booch's RUP, Beck's XP, Fowler's Refactoring are an attempts to adapt scientific methods, psychological and human behavior models, and even religious concepts to the process of the writing software.

The point is that these common ideas can be also adapted to a business processes.

For example, RUP is about planning and circles of iterations - scientific approach. XP is about reuse human behavior - little steps, being sure you hadn't broke anything, look (run tests) at your beloved code 10 times a day. Refactoring is about continuous improvements, little changes, that makes your code easier to understand, which means easier to modify and support. This is, probably, from dictionary and guide-books writing. You're writing the code is for humans, not for compilers.

Of course, not one of these methods fits all, but you can make a mix by yourself. Some from there, some from there. It is like cooking. All sources and ingredients available - just try, learn on failures and try again.

michaelvkpdxonApr 1, 2015

All professional programmers should continually read Martin Fowler's "Refactoring", in the same way English professors read Shakespeare.

"Refactoring" does not mean "previous programmer was an idiot". Often, the understanding of the problem and the way the code is used change over time. Refactoring is a way of bringing the out-of-control weeds back into healthy symbiosis with the larger garden of code.

I stopped telling clients a long time ago that I'm "refactoring" and instead I just add some extra time to all tasks to account for refactoring on legacy code.

euroclydononNov 3, 2010

I'm reading the following:

#Recommend on HN:

--Infinite Jest - DFW

--A Supposedly Fun Thing I'll Never Do Again - DFW

--The Web Application Hackers Handbook - Marcus Pinto

#Recommended Elsewhere:

--On Intelligence - Jeff Hawkins

--Refactoring - Martin Fowler

--The Brothers Karamazov - Fyodor Dostoyevsky (re-reading/skimming)

Built withby tracyhenry

.

Follow me on