You must buy this book to understand all the below principles in detail. Get it here on Amazon.

This article is a continuation of my previous article — Summary of — Clean Code by Robert C Martin — Part 2: Meaningful Names

Below I will be explaining how you must write functions as suggested by Robert C. Martin to maintain clean code.

Small!

The first rule of functions is that they should be small. The second rule of functions is that they should be smaller than that. Smaller functions are mostly robust, easy to read and maintain.

Blocks and Indenting

Try not to have…


This article is in continuation of my previous article Summary of — Clean Code by Robert C Martin — Part 1: Overview. Please buy the book from Amazon if you want to know more in detail about how to write meaningful names.

Importance of naming

Names are everywhere in software. We name our variables, functions, classes, and packages. Naming is one of the most crucial parts of clean code. To write code in an existing codebase, we always read the code and then change it. As per a survey, the reading vs writing time ratio is 10:1 for an average developer in a…


GoodReads

First of all, I want to thank this marvelous author who did countless research and interviews to write this important book. It has definitely changed my way of thinking and programming. If you really want to understand fully about clean code, I recommend you to buy this book from Amazon.

This series of articles is intended to give a high-level idea to our fellow developer community on how together we can write a better code for the next generation.

Why Clean Code?

Programming in an existing codebase is not easy. We all have been in a situation where our productivity was slowed down…


Import usually happens in the Rails app as record-by-record which is good until the number of records to be inserted is less. I recently had to write a feature of importing records for one of our use-cases. MySQL DB was used with Rails. There was an existing implementation in our app of record-by-record import. Out of curiosity I searched for some gems that could help in bulk imports and came across activerecord-import. I would recommend you to go through its documentation before reading further here.

If you are familiar with Rails, you would know about its callback functionalities. Unluckily the…

Ashish Muralidharan

Programming Nerd ashishm.dev

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store