Clean Code

I was reading this book ” Prentice Hall Clean Code A Handbook of Agile Software Craftsmanship ” and its really very useful. I recommend you to read it.

Some sentences and phrases that I liked. 🙂

Writing clean code is what you must do in order to call yourself a professional.

There is no reasonable excuse for doing anything less than your best.

“Honesty in small things is not a small thing.”

In our profession, we desperately need all the help we can get. If a clean shop floor reduces accidents, and well-organized shop tools increase productivity, then I’m all for them.

There are two parts to learning craftsmanship: knowledge and work. You must gain the knowledge of principles, patterns, practices, and heuristics that a craftsman knows, and you must also grind that knowledge into your fingers, eyes, and gut by working hard and practicing.

Learning to write clean code is hard work. It requires more than just the knowledge of principles and patterns. You must sweatover it.

You must practice it yourself, and watch yourself fail. You must watch others practice it and fail. You must see them stumble and retrace their steps. You must see them agonize over decisions and see the price they pay for making those decisions the wrong way.

You are reading this book for two reasons. First, you are a programmer. Second, you want to be a better programmer. Good. We need better programmers.

It was the bad code that brought the company down.

Later equals never.

Why does this happen to code? Why does good code rot so quickly into bad code? We have lots of explanations for it.

  • We complain that the requirements changed in ways that thwart the original design.
  • We bemoan يندب يتحسر the schedules that were too tight to do things right.
  • We blather about stupid managers and intolerant customers.

But the fault, dear Dilbert, is not in our stars, but in ourselves.

We are unprofessional.

 

“But wait!” you say. “If I dont do what my manager says, Ill be fired.” Probably not.

Most managers want the truth, even when they don’t act like it. Most managers want good code, even when they are obsessing about the schedule.

They may defend the schedule and requirements with passion; but thats their job. Its your job to defend the code with equal passion.

 

The onlyway to make the deadline—the only way to go fast—is to keep the code as clean as possible at all times.

 

The bad news is that writing clean code is a lot like painting a picture. Most of us know when a picture is painted well or badly. But being able to recognize good art from bad does not mean that we know how to paint. So too being able to recognize clean code from dirty code does not mean that we know how to write clean code!

 

We are Authors, The next time you write a line of code, remember you are an author, writing for readers who will judge your effort.

 

The ratio of time spent reading vs. writing is well over 10:1.

We are constantly reading old code as part of the effort to write new code.

 

Making it easy to read actually makes it easier to write.

 

Leave the campground cleaner than you found it.

 

Thank you and Keep It Simple & Straightforward 🙂

~:H}{H:~