Clean Coding

I would like to share my knowledge about clean coding practices in the software development.

Everyone can do the coding but we are not sure whether it’s a quality code or professional code, it become a habit of writing a clean code, programming is not only solving the problem but its telling what is the way we are choosing to solving the problem, is that aspects clean coding is playing one of the major role in the software development.

abstrusegoose_otherpeoplescode1

In my point of view clean code should bring the following points.

  • Other developers can understand what we have written.
  • Extendibility.
  • Avoid duplication.
  • ……
  • …..

Simple example

BadCode

The above is doing the addition operation, it should work but it’s not professional coding practices, I have to ask few questions like what is a, b and Do? and so on.

GoodCode

What about this code? Everyone can easily understand what it is doing and so on, so this is one of the ways of writing the clean code.

Always we have to keep in mind the following things while writing the coding.

  • Proper naming (class, methods, members, properties and so on).
  • Documentation.
  • SOLID principles.
  • Think about future.
  • Write unit tests.
  • Refactor if it’s not readable.
  • Put the classes in the proper namespace.
  • Consistency
  • Culture independent.
  • Machine independent.
  • Easy to configure the system.
  • Memory leaking issues.
  • Think about performance issues.
  • Error handling

Those points are very important and it’s not enough to write the professional code, we need to learn more about best practices and defining rules within the team and develop a code.

Conclusion

Initially it will be hard to follow all the points, but once love this and practice it, it will come naturally and you will become great professional developers.

ALL THE BEST

Essential Lean: Waste at office

wasteful

Introduction :

I wish to share this which I read through an image shared on Pinterest by http://www.100pceffective.com/  . Some of the minute things which we never considered and realized that it would affect our Productivity at our work place. And being played by us as a team lead , not only in our project but also on wasting of office time and things. Apparently we did not know that our colleagues and fellow members would watch us and indirectly adopt the same and follow us as their role models.

Here is some important stuff which we are unknowingly doing it and pave way for the fellow members and indirectly affects us being waste at office rather being productivity.

  1. Waiting:

According to current work environment most of us doesn’t like waiting as we need instant results and solutions for any problems never thinking that we are making others (may be any individual/ crew) to wait for a long time. Alright! I throw you few incidents that are very familiar which we have faced and we have done it.

Waiting for any official meeting to start, waiting for any discussion to start up as because of the participants were not on the right time seems to be Stealing other`s time . As per agenda we would not start and obviously we cannot end up, if the flow of the meeting was as per the agenda framed. In another instant the time delay for a computer to start up for the customer information we need.

  1. Transport:

Walking to meetings or travelling around the building or travelling around the building to collect or to meet any one. It doesn`t mean that we shouldn`t move anywhere leaving our seat, because some relaxation for mind and body is required.  I have seen people carrying file on hand and meet other departments and spend  half the day , But actually that much time is not needed for their discussion and meeting when you probe them.

We have to check whether the move that we make affects the work or not.

  1. Over processing:

we have a feeling and understanding  that when we say the word “documents” it needs to be neatly printed ,filed and shelved, which we cannot locate it at the right time when required and what`s the use of it doing so? Printing out documents which are unnecessary or printing of documents that we could read on screen.

Of course an office has to have some records and files, but we have to check for their priority, category and the usage of the same (how often we use that) if that same info is available at our desk.

  1. Inventory:

Holding of too much of stocks such as stationary or any other equipment that are purchased without knowing its frequency on usage. Things Like ball point pens, batteries, or the outdated products or documents or any other similar belongings of office.

Instead we can make a purchase list every month or a week (that depends upon the organization size and structure) and buy things accordingly based on the requirement

  1. Motion:

Getting up with a task to be done and end with the other one leaving assigned task, shift on the work which begins with shift over the thought during work which is again waste of time and affects our productivity.eg: Getting up to take the printed papers from the printer but look for files and heading to other work or another area to complete that.

Instead we can prioritize the daily work and go as per the schedule to avoid the shift and save time.

  1. Over Production:

Producing of too many products beyond the requirement and storing it is again a waste of man power and that affects the quality of the product when the actual demand is there. Working on the same type of document with multiple versions.

We can have a post production discussion to limit the production by setting a level/amount with respect to the product and its actual requirement with the respective management team.

  1. Defects/Rework:

Most of the defect and rework at work places falls on the following criteria, like misunderstanding on the actual requirement, lack of interest on listening others and entries of multiple inputs manipulating the systems developed or adopted. Either ruins the work and requires starting up again or ends with any defect that affects the quality.

Instead we can clarify ourselves where there is a misunderstanding on the requirements of the client or any work assigned  to us and then proceed. Confirm first the project or work requirements, get confirmed with the respective personnel and  then proceed.

  1. Employee Talent:

Besides all the above mentioned wastes at office this waste is considered to the predominant one according to my perspective. I believe that all other waste causing inabilities can be removed if a right talent is hired.  On the other hand training them by spending more time on a low level task which can be outsourced or done with other means. Also engaging employees on inappropriate task or the talent and skill of the employee hired is left unused or not used properly, remains a waste again.

Even though we all are aware of the things discussed, let us again refresh ourselves and analyze ourselves on the stuffs. As these are the Essential Lean six sigma concepts shared by the training bodies itself as mentioned on my introduction.

We can recycle all wastes of office into useful and productive features only when we accept and change our mind and adopt ourselves to be a person of 100% productivity.

Lessons learned from clean coding

Clean Code Book by Robert Cecil Martin
Clean Code
Book by Robert Cecil Martin

I am going to share my experience of reading the book “Clean Code “From Robert Cecil Martin and the books influence on our Team, as a vigorous reader, I cultivated the habit of reading to my team. The habit of reading also extended to share the knowledge with the Team.

Our Teams Group Discussion
Our Teams Group Discussion

We started to share in small groups locally. After some discussion we brought that idea in the International distributed team and every week one of the Team member picks a chapter and reads. He or she chooses a time slot and gives a summary about the chapter he was reading.

The rest of the team members are also demanded to read and participate in the discussion. The TEAM started to discuss about the content of the chapter and its current relevance to the Team.

Learning together as a TEAM
Learning together as a TEAM

 

In a span of 3 months the overall awareness of code quality has improved and we started to give proper naming to our classes, methods, variable and all kinds of names we use in the project. Most of our functions become self-explaining. We started defining the abstraction in the right level. The code readability has improved week by week.

More over when we combine that with TDD (Test Driven Development) the overall Application architecture become more loosely coupled and we were able to develop a highly maintainable and extendable code base for our Stake holders.

We realized a complex application software, when written in clean way, It looks like a master piece art. The elegance of the design and clean coding gives a proud feeling. It’s the same feeling when an artist gets when he completes a painting or any creative person giving his master piece work to the world.

Continuous Learning
Continuous Learning

During this journey I discovered knowing and learning something is not good enough but to achieve mastery we need to practice deliberately.  Writing clean code every day is a worthy habit every software developer should cultivate. I started to respect fellow developers who has an eye for quality and elegance; and who practice clean coding every day.

The journey of learning is a continuous process and it is also contagious. I hope the readers can get inspired and start learning and start practicing to get better at what they do.

Deliberate Practice
Deliberate Practice

Learning is of no use when it’s not practiced, so to be an expert, one needs to practice every day until he become a real expert and gains mastery

Don’t stop when you learn; Start practicing every day to reach the mastery.

Welcome Message

Ramarson

 

Dear Ramarson Experts,

I welcome you all for this new beginning. I request all the team members to contribute for the blog and share your valuable thoughts, ideas and experience to the world. Lets encourage intellectual discussion and use this platform to share knowledge.

You can write about Agile software development, our clean coding practices, SCRUM, Domain Driven Design, Mob Programming, DevOps, Continuous Delivery, Talk about the recent technology you have used or

interesting know-hows you would like to share with the world.

Lets keep the sprint of learning together and sharing the knowledge with the world for the betterment of all.