Coder Stories -The Code Hygiene Fault-line

Coder Stories -The Code Hygiene Fault-line

cs002:The Code Hygiene Fault-line

??????????? ?????? ??????? ?????????? ?????????? ????? ?????.
Water ensures external purity while truthfulness shows the internal.

If you have been coding for a long time, you would agree that coding is fun. However, code review is not, and now with automation, developers are caught swiftly for poor coding practices. There was a time in my life when there were no code reviews. I had a few books that introduced some coding conventions. However, most had our novel methods. Programmers from the COBOL world had some sense of structure to their code. But in most cases, the code was efficient, but the coding conventions were ugly. Given the 8086/8088 processors and 512k RAM, coding was all about efficiency.?

Variable names and file names were a stew. However, we had so much fun naming the files and functions. Believe it or not, there was a header file called Kathukuthu.h (????????????.h). Kathukuthu in Tamil denotes the ear-piercing "function." Child Ear-piercing function is a tradition in our culture regardless of gender. We put all our supporting "functions" in an include-file and the file name was the Tamil function's name. The term Kathukuthu is also used as slang for fooling someone. For my part, I started to write sarcastic code comments.?

/** Do not touch this code. Dare you to do so, be my guest, and make the worst. Before trashing me, remember you are not that clever too, **/

/* say zeeboomba before compiling */ (zeeboomba is similar to Abracadabra)

Jokes apart, my first motivation to write clean code was to recollect what I coded. As my coding velocity increased, I had problems recalling, so I started to code with some structure. Then came a period of multiple developers in a project. Code hygiene came into the picture. We evolved slowly, creating coding conventions, and then came the ritual of code reviews.?

It was Human Ego vs. Human Ego—a brawl. Senior developers, aka code police, took it upon the juniors. Senior code police will ask you to explain every line. Then they will provide their "esteemed" opinions like Ex-cricketers turned commentators. Every such code review was tense and fiery. Sparks flew, and the reviewer and their victim combusted. Code reviews of the past transformed your friendly peers into poet?Nakkirar - (The bearded person in the cover image - known for pointing out flaws, he bravely pointed out flaws in a poem written by Lord Shiva himself.).

The fun part here is that if you ask the experts to define clean code, you will never get a straightforward definition. It is something like asking - What is good music? You will get millions of definitions based on the listener's preferences and biases. I define good music in two facets, technical and aesthetical. Technically, something that is composed and arranged by someone who cares. Cares about what? Care about attention to detail and numerous tiny little nuances that build and accentuate their creative thoughts. Aesthetically, if a song can capture the attention and admiration of more numbers of "ears," it is also good music.?

So what did I learn about clean Code? Let us take the above idea to define clean code. Clean code looks like written by someone who cares. Nothing is evident in the code that you can do to improve it—a super-saturated solution. A developer has spent time keeping it simple and orderly by paying appropriate attention to details. The difference between a professional and an amateur is - "paying attention to details." here are some of the details.?

  • Zero redundancy or duplication?
  • Represents all the design conceptions of the system
  • Adequate but minimal number of entities such as classes, methods, and functions.

Name of Thrones! :?Name ceremonies happen throughout software development. Every developer goes through this naming ballet. We must provide names for folder structures, variables, functions, arguments, classes, packages, DLLs, jars, wars, models, config, etc., adhering to predefined naming conventions passed from our ancestors (kathukuthu.h:) who coded the earlier versions. Meaningful names have been a fundamental crisis in the programming community for about a million or more project management years. Hence it is critical for us to pay attention to it. You might think more about the notation when naming variables, but it is much more. In my past several years as a coder, a good variable name reveals intent. What do I mean by intent? A simple variable name should reveal - its purpose, usage, and activity (what it does).

eg: int interest; // contains interest

int customerCheckingInterest /// this provides more intent and context than the above.?

To conclude, I have read terra bytes of books and concepts that preach to a lot. However, coding is an art, just like music. Books might provide you with the theory, but as a developer, you must make code hygiene a habit that acts subconsciously.?

Cleanliness is the hallmark of perfect standards, and the best quality inspector is the conscience.

Good luck.

要查看或添加评论,请登录

Srikanth Devarajan的更多文章

  • A Life of Many Streams: Remembering My Father

    A Life of Many Streams: Remembering My Father

    He taught us that life depends on preparation, not luck; hard work, not shortcuts; and doing things the right way, not…

    16 条评论
  • The Small Wall - Podcast- Breaking Barriers

    The Small Wall - Podcast- Breaking Barriers

    How Federated Learning and Synthetic Data Propel AI Innovation Amidst Privacy Challenges. In the evolving landscape of…

  • Introducing The Small Wall Podcast!

    Introducing The Small Wall Podcast!

    I’m excited to launch my brand-new podcast, where we dive deep into a variety of topics, from the latest tech trends to…

  • Preemptive Fatigue & The Proposal Paradox

    Preemptive Fatigue & The Proposal Paradox

    Companies treat proposal deadlines like high-stakes championship games, where winning means revenue, growth, and…

  • Agentic AI to Backlog Management

    Agentic AI to Backlog Management

    What is Agentic AI? Agentic AI is an AI system that perceives, plans, acts, and learns autonomously to achieve goals…

  • AI-Ready Data: The Missing Foundation for Enterprise AI Success

    AI-Ready Data: The Missing Foundation for Enterprise AI Success

    I recently gave a lecture titled "Demystifying AI" for a non-technical audience. To simplify things, I explained that…

    1 条评论
  • Little Feet, Big Dreams

    Little Feet, Big Dreams

    Travel Log #1 I set out on a short trip to a few temple towns in Tamil Nadu, including our ancestral village. Leaving…

  • Lethargic Momentum: A Silent Crisis

    Lethargic Momentum: A Silent Crisis

    In today’s fast-paced world, where efficiency and innovation are critical, many dedicated and passionate leaders find…

  • Amazon Reviews Are Gold for Indie Authors:

    Amazon Reviews Are Gold for Indie Authors:

    The fact is, writing a book is achievable with perseverance, but getting people to talk about it? It is not easy…

  • The Passion Equation - The art of micro-prioritization

    The Passion Equation - The art of micro-prioritization

    Recently, the popular Tamil film star Ajith Kumar (AK) showcased his passion beyond his profession. A few years ago, I…

社区洞察

其他会员也浏览了