The Clean Coder (Part II)

How to behave

1.      Say no.

This chapter may be the most controversial section of the book. Based on your expertise, you should firmly say no to your supervisor,

 your manager and customer, when they have an unreasonable and harsh request. Rushing to complete is always the source of bugs

 and crashes. As a professional, it’s your accountability to guarantee your software are free of insidious and devastating bugs, passes

 all tests, have complete functionality and works.

There is much more to say about this strategy. If you have interest, I strongly suggest you read “Chapter2: Saying No” of this book.


2.     Say yes.

The strategy of saying yes prevents you frombreaking your promises. You should understand the true meaning of “try” and“yes”.

When you are saying “yes”, you are making acommitment. There are three things you should inspect.

1.       You say you’ll do it.

2.       You really mean it.

3.       You actually do it.

But, most of the time, people are just saying, “Ineed to lose some weight”, “I should get up early tomorrow morning”, “I reallyneed to get rid of my bad habit”. The truth is, they will never get it down.Our action must be consistent with our words.

Keep in mind, it’swhat we do rather than what we say shapes who we are.

 

3.  Coding

In my view, code is a work of art. Just as sculptorscarve an unglamorous stone into a gorgeous and spectacular sculpture, as writers combine every ordinary word together to form a beautiful and exquisiteprose, we should strive to make our code readable, maintainable as well as graceful.

Since I'm obessed with writing, in terms of programming, my motto is "The art of programming is , and has always been, the art of language design.  

Coding is an intellectually challenging and exhaustingactivity. It requires a level of concentration and focus. When you can’t notconcentrate and focus sufficiently, the code you write will probably be wrong.It will have bugs. It will have the wrong structure.”

So, focus all your attention while you are coding.If you are tired and distracted, do not code. Just take some time off. You canmeditate to relax your mind. Take a walk and inhale some fresh air to keep yourefreshed. Listen to soothing music or even chat (or gossip) with yourcolleagues.


 

4.  Test

Uncle Bob used three chapters to talk about tests.Frankly speaking, I don’t quite get the point of this part. I always heard thatthe importance of tests can never be overstated. But due to the lack ofexperience, I can’t truly understand why it’s so important. I know my ignorancefrom arguments with others. I couldn’t find grounded ideas and examples tosupport my view.

Here, I want to share two lessons I learned yesterday.

Yesterday afternoon, when we are in a lecture, thelecturer asked us, “What is automated test”. At first, I felt excited. “Finally,my reading pays off. It’s show time.” (They are just in my mind) Then, I triedvery hard to recall the sentences I saw in the book. Regrettably, my attemptfailed. I just had a very vague concept of automated test. And I can’t evendescribe it to others. (The best way tolearn is to teach.)

Lesson One: Always read informationthat is unfamiliar but useful to you as many times as you can until you cantell others your insights about it.

After supper, on the way to the dorm, I asked myclassmate, who has one-year working experience, what automated test was.Without effort, he talked as if it was something like common sense.

Lesson Two: Experience cannotbe replaced by knowledge.

        

In general, Uncle Bog didn’t give us many details abouthow to do tests during software development. His intention is to remind us theimportance of tests. If you want to know how to test, learn from your work.

 

5.    Time Management

         Time is always short, as for work, as for life.

Effectively managing your time is also part of beingprofessional.

Meetings

Speaking of meeting, there are two things you shouldknow.

1.       Meetings are necessary.

2.       Meting are huge time wasters.

My strategy to copy with unnecessary meetings is verysimple. If there is a meeting I have to attend, which doesn’t have significantbenefit, I just treat it as a time to relax------get out of the heavy work andlet my mind wander.

Recharging

Our willpower and focus ability and patience and anythinglike them are limited. You use them for one thing, the total amount isreduced-----not enough for you to do another thing which entails them. Thesolution is recharging them. (See the book “Willpower” for some detailedexperiments)

“Focus-manna can be partially recharged by de-focusing. Agood long walk, a conversion with friends, a time of just looking out thewindow can all help to pump the focus-manna back up.”

6.    Pressure

Modest pressure turns out to be good for us. Whileoverwhelming pressure is always impeding us. When you are under the latterpressure, you are busy all the time; you can’t spare some time to your family;you are more likely to lose temper----yelling at others, punching the wall andcurse. You become the kind of person who is hard to get along with. Who is toblame for you painful and miserable life?

Stop the high-stress lifestyle.

To avoid falling into this trap, first, you should thinktwice when making commitments. (More details in Chapter 2 and Chapter 3)Second, stay clean. This involves habit. If you have the habit of making amess, try to overcome it. When small messes accumulated to a big mess, it’salmost impossible to clean it up. Third, choose disciplines that you feelcomfortable following in a crisis and follow them all the time. Don’t changeyour behavior just in order to get through the crisis. Stay tuned with yourregular behaviors.

What if pressure has already come?

Don’t panic. While staying calm, try your best to plot a course toguide your following movements. Your problem must be solved very carefully andpatiently.

Communicate. Let your superiors and team members know your trouble.Maybe they will give you some helpful advices.

Collaborate with others.They will find your blind spots and defects.

Exercise regularly. From Harvard "Positive Psychology" course, "Three timesphysical exercise a week , 30 minutes each time, has the same effective as our most powerful psychiatric drugs." Other than keep you in shape, regular exercise has the power to adjust your emotion. After a long running, you are more likely to get out your blue and feel relieved. Then, take a hot shower. It's one of the most fantastic experiences I ever have.

 

This book gave me quite a lot enlightenment. This article is just a quick walk-through of the book appended with some of my ownunderstanding and insights of it. It doesn’t cover every aspect of professionalismreferred to by Uncle Bob. Some parts of this book are informative and useful.Some may be controversial. Some may don’t work for you. Anyway, all of us canget some benefits from reading it.

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值