The Pragmatic Programmer: Your Journey to Mastery, 20th Anniversary Edition
Rate it:
Open Preview
3%
Flag icon
Programming is a craft. At its simplest, it comes down to getting a computer to do what you want it to do (or what your user wants it to do). As a programmer, you are part listener, part advisor, part interpreter, and part dictator. You try to capture elusive requirements and find a way of expressing them so that a mere machine can do them justice. You try to document your work so that others can understand it, and you try to engineer your work so that others can build on it. What’s more, you try to do all this against the relentless ticking of the project clock. You work small miracles every ...more
3%
Flag icon
Pragmatic Programmers get the job done, and do it well.
4%
Flag icon
We who cut mere stones must always be envisioning cathedrals.
4%
Flag icon
What distinguishes Pragmatic Programmers? We feel it’s an attitude, a style, a philosophy of approaching problems and their solutions. They think beyond the immediate problem, placing it in its larger context and seeking out the bigger picture.
5%
Flag icon
When you find yourself saying, “I don’t know,” be sure to follow it up with “—but I’ll find out.” It’s a great way to admit what you don’t know, but then take responsibility like a pro.
5%
Flag icon
the laws of thermodynamics guarantee that the entropy in the universe tends toward a maximum. When disorder increases in software, we call it “software rot.” Some folks might call it by the more optimistic term, “technical debt,” with the implied notion that they’ll pay it back someday. They probably won’t.
5%
Flag icon
Don’t leave “broken windows’’ (bad designs, wrong decisions, or poor code) unrepaired.
6%
Flag icon
One broken window is one too many.
6%
Flag icon
Keep an eye on the big picture. Constantly review what’s happening around you, not just what you personally are doing.
7%
Flag icon
The scope and quality of the system you produce should be discussed as part of that system’s requirements.
9%
Flag icon
“The meaning of your communication is the response you get.”
9%
Flag icon
There’s one technique that you must use if you want people to listen to you: listen to them.
10%
Flag icon
Good Design Is Easier to Change Than Bad Design
10%
Flag icon
Why is decoupling good? Because by isolating concerns we make each easier to change.
11%
Flag icon
given that you’re not sure what form change will take, you can always fall back on the ultimate “easy to change” path: try to make what you write replaceable. That way, whatever happens in the future, this chunk of code won’t be a roadblock.
11%
Flag icon
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
14%
Flag icon
Ask yourself what the comment adds to the code. From our point of view, it simply compensates for some bad naming and layout.
15%
Flag icon
All services offered by a module should be available through a uniform notation, which does not betray whether they are implemented through storage or through computation.
15%
Flag icon
Make It Easy to Reuse
16%
Flag icon
Don’t rely on the properties of things you can’t control.
20%
Flag icon
Prototyping is a learning experience. Its value lies not in the code produced, but in the lessons learned. That’s really the point of prototyping.
25%
Flag icon
Tools amplify your talent. The better your tools, and the better you know how to use them, the more productive you can be.
27%
Flag icon
You need to be able to manipulate text as effortlessly as possible, because text is the basic raw material of programming.
29%
Flag icon
modern computer systems are still limited to doing what you tell them to do, not necessarily what you want them to do.
36%
Flag icon
“Defensive programming is a waste of time. Let it crash!”
36%
Flag icon
A dead program normally does a lot less damage than a crippled one.
40%
Flag icon
Much of the time, tomorrow looks a lot like today. But don’t count on it.
41%
Flag icon
Coupling is the enemy of change, because it links together things that must change in parallel.
41%
Flag icon
Decoupled Code Is Easier to Change
41%
Flag icon
Meetings where everyone has to attend because no one is sure who will be affected by a change.
42%
Flag icon
Tell, Don’t Ask This principle says that you shouldn’t make decisions based on the internal state of an object and then update that object. Doing so totally destroys the benefits of encapsulation and, in doing so, spreads the knowledge of the implementation throughout the code.
43%
Flag icon
Each piece of global data acts as if every method in your application suddenly gained an additional parameter: after all, that global data is available inside every method.
43%
Flag icon
Our experience has been that reuse should probably not be a primary concern when creating code, but the thinking that goes into making code reusable should be part of your coding routine. When you make code reusable, you give it clean interfaces, decoupling it from the rest of your code. This allows you to extract a method or module without dragging everything else along with it.
43%
Flag icon
You’ll see this problem when you’re writing unit tests for code that uses global data. You’ll find yourself writing a bunch of setup code to create a global environment just to allow your test to run.
43%
Flag icon
If It’s Important Enough to Be Global, Wrap It in an API
43%
Flag icon
Coupled code is hard to change: alterations in one place can have secondary effects elsewhere in the code, and often in hard-to-find places that only come to light a month later in production.
48%
Flag icon
Programming Is About Code, But Programs Are About Data
55%
Flag icon
Inheritance encourages developers to create classes whose objects have large numbers of methods. If a parent class has 20 methods, and the subclass wants to make use of just two of them, its objects will still have the other 18 just lying around and callable. The class has lost control of its interface.
58%
Flag icon
Concurrency is when the execution of two or more pieces of code act as if they run at the same time. Parallelism is when they do run at the same time.
62%
Flag icon
Random Failures Are Often Concurrency Issues
62%
Flag icon
You could also argue that functional languages, with their tendency to make all data immutable, make concurrency simpler. However, they still face the same challenges, because at some point they are forced to step into the real, mutable world.
66%
Flag icon
Testing is not about finding bugs, it’s about getting feedback on your code: aspects of design, the API, coupling, and so on.
67%
Flag icon
When you spot things done in a way that seems strange, jot it down. Continue doing this, and look for patterns. If you can see what drove them to write code that way, you may find that the job of understanding it becomes a lot easier. You’ll be able consciously to apply the patterns that they applied tacitly.
68%
Flag icon
Finding an answer that happens to fit is not the same as the right answer.
72%
Flag icon
67 A Test Is the First User of Your Code
73%
Flag icon
Build End-to-End, Not Top-Down or Bottom Up We strongly believe that the only way to build software is incrementally. Build small pieces of end-to-end functionality, learning about the problem as you go. Apply this learning as you continue to flesh out the code, involve the customer at each step, and have them guide the process.
81%
Flag icon
The beginning of wisdom is to call things by their proper name.
81%
Flag icon
When naming things, you’re constantly looking for ways of clarifying what you mean, and that act of clarification will lead you to a better understanding of your code as you write it.
83%
Flag icon
Programmers Help People Understand What They Want
85%
Flag icon
The secret to solving the puzzle is to identify the real (not imagined) constraints, and find a solution therein.
« Prev 1