Clean Coder, The: A Code of Conduct for Professional Programmers (Robert C. Martin Series)
Rate it:
Open Preview
7%
Flag icon
How does a professional behave? • How does a professional deal with conflict, tight schedules, and unreasonable managers?
7%
Flag icon
When, and how, should a professional say “no”? • How does a professional deal with pressure?
7%
Flag icon
As an engineer, you have a depth of knowledge about your systems and projects that no managers can possibly have. With that knowledge comes the responsibility to act.
12%
Flag icon
What would happen if you allowed a bug to slip through a module, and it cost your company $10,000? The nonprofessional would shrug his shoulders, say “stuff happens,” and start writing the next module. The professional would write the company a check for $10,000!1
13%
Flag icon
Yeah, it feels a little different when it’s your own money, doesn’t it? But that feeling is the feeling a professional has all the time. Indeed, that feeling is the essence of professionalism. Because, you see, professionalism is all about taking responsibility.
14%
Flag icon
Do No Harm to Function
14%
Flag icon
We harm the function of our software when we create bugs. Therefore, in order to be professional, we must not create bugs.
14%
Flag icon
The fact that the task to write perfect software is virtually impossible does not mean you aren’t responsible for the imperfection.
14%
Flag icon
Indeed, some companies reward QA based on the number of bugs they find. The more bugs, the greater the reward.
14%
Flag icon
Releasing code to QA that you don’t know works is unprofessional. It violates the “do no harm” rule.
15%
Flag icon
The solution to that is to design your code to be easy to test. And the best way to do that is to write your tests first, before you write the code that passes them.
15%
Flag icon
You must be able to make changes without exorbitant costs.
16%
Flag icon
merciless refactoring.
16%
Flag icon
Why do most developers fear to make continuous changes to their code? They are afraid they’ll break it! Why are they afraid they’ll break it? Because they don’t have tests.
16%
Flag icon
Your career is your responsibility. It is not your employer’s responsibility to make sure you are marketable. It is not your employer’s responsibility to train you, or to send you to conferences, or to buy you books. These things are your responsibility.
16%
Flag icon
If you use your lunch hour to read, listen to podcasts on your commute, and spend 90 minutes per day learning a new language, you’ll have it all covered.
16%
Flag icon
Do the math. In a week there are 168 hours. Give your employer 40, and your career another 20. That leaves 108. Another 56 for sleep leaves 52 for everything else.
17%
Flag icon
Here is a minimal list of the things that every software professional should be conversant with:
20%
Flag icon
Professionals speak truth to power. Professionals have the courage to say no to their managers. How do you say no to your boss? After all, it’s your boss! Aren’t you supposed to do what your boss says? No. Not if you are a professional. Slaves are not allowed to say no. Laborers may be hesitant to say no. But professionals are expected to say no. Indeed, good managers crave someone who has the guts to say no. It’s the only way you can really get anything done.
20%
Flag icon
The best possible outcome is the goal that you and your manager share. The trick is to find that goal, and that usually takes negotiation.
29%
Flag icon
What we all have to realize is that saying yes to dropping our professional disciplines is not the way to solve problems. Dropping those disciplines is the way you create problems.
30%
Flag icon
There are three parts to making a commitment. You say you’ll do it. You mean it. You actually do it.
31%
Flag icon
The secret ingredient to recognizing real commitment is to look for sentences that sound like this: I will . . . by . . . (example: I will finish this by Tuesday.)
32%
Flag icon
If it can’t be done, you can still commit to actions that will bring you closer to the target.
32%
Flag icon
If you committed to solving a bug you thought was solvable and you realize at some point the bug is much more hideous than previously thought, you can raise the flag.
32%
Flag icon
If you don’t tell anyone about the potential problem as soon as possible, you’re not giving anyone a chance to help you follow through on your commitment.
34%
Flag icon
It’s easy to say you’ll get a lot done on the weekends, it’s a lot harder to actually muster enough energy to do high-quality work. Professionals know their limits. They know how much overtime they can effectively apply, and they know what the cost will be.
36%
Flag icon
We never had time to rewrite this wad
36%
Flag icon
The moral of this story is: Don’t write code when you are tired.
36%
Flag icon
Make sure that your sleep, health, and lifestyle are tuned so that you can put in eight good hours per day.
36%
Flag icon
Professional developers allocate their personal time in order to ensure that the time spent at the office is as productive as possible.
39%
Flag icon
debugging time is just as expensive to the business as coding time is, and therefore anything we can do to avoid or diminish it is good.
40%
Flag icon
There is something about disengagement that allows your mind to hunt for solutions in a different and more creative way.
40%
Flag icon
The trick to managing lateness is early detection and transparency.
40%
Flag icon
Be as honest as you can about all three dates. Do not incorporate hope into your estimates! Present all three numbers to your team and stakeholders. Update these numbers daily.
41%
Flag icon
Woe to the poor developer who buckles under pressure and agrees to try to make the deadline. That developer will start taking shortcuts and working extra hours in the vain hope of working a miracle.
41%
Flag icon
you should not agree to work overtime unless (1) you can personally afford it, (2) it is short term, two weeks or less, and (3) your boss has a fall-back plan in case the overtime effort fails.
41%
Flag icon
If your boss cannot articulate to you what he’s going to do if the overtime effort fails, then you should not agree to work overtime.
42%
Flag icon
It is a violation of professional ethics to sequester yourself in a cubicle or office and refuse the queries of others. Your work is not so important that you cannot lend some of your time to help others.
42%
Flag icon
a fresh perspective can be a profound catalyst for solving problems.
42%
Flag icon
it is a matter of professional ethics for senior programmers to spend time taking younger programmers under their wing and mentoring them. By the same token, those younger programmers have a professional duty to seek out such mentoring from their seniors.
43%
Flag icon
How can you consider yourself to be a professional if you do not know that all your code works? How can you know all your code works if you don’t test it every time you make a change? How can you test it every time you make a change if you don’t have automated unit tests with very high coverage? How can you get automated unit tests with very high coverage without practicing TDD?
43%
Flag icon
The Three Laws of TDD You are not allowed to write any production code until you have first written a failing unit test. You are not allowed to write more of a unit test than is sufficient to fail—and not compiling is failing. You are not allowed to write more production code that is sufficient to pass the currently failing unit test.
45%
Flag icon
If you don’t write your tests first, there is no force preventing you from coupling the functions together into an untestable mass.
45%
Flag icon
Following the three laws does not guarantee any of these benefits. You can still write bad code even if you write your tests first. Indeed, you can write bad tests.
48%
Flag icon
Programmers can practice in a similar fashion using a game known as ping-pong.8 The two partners choose a kata, or a simple problem. One programmer writes a unit test, and then the other must make it pass. Then they reverse roles.
51%
Flag icon
In the end, the more precise you make your requirements, the less relevant they become as the system is implemented.
51%
Flag icon
Professional developers understand that estimates can, and should, be made based on low precision requirements, and recognize that those estimates are estimates.
51%
Flag icon
“An ambiguity in a requirements document represents an argument amongst the stakeholders.”
52%
Flag icon
Professional developers have a single definition of done: Done means done. Done means all code written, all tests pass, QA and the stakeholders have accepted. Done.
« Prev 1