Welcome to Siva's Blog

~-Scribbles by Sivananda Hanumanthu
My experiences and learnings on Technology, Leadership, Domains, Life and on various topics as a reference!
What you can expect here, it could be something on Java, J2EE, Databases, or altogether on a newer Programming language, Software Engineering Best Practices, Software Architecture, SOA, REST, Web Services, Micro Services, APIs, Technical Architecture, Design, Programming, Cloud, Application Security, Artificial Intelligence, Machine Learning, Big data and Analytics, Integrations, Middleware, Continuous Delivery, DevOps, Cyber Security, Application Security, QA/QE, Automations, Emerging Technologies, B2B, B2C, ERP, SCM, PLM, FinTech, IoT, RegTech or any other domain, Tips & Traps, News, Books, Life experiences, Notes, latest trends and many more...

Friday, April 8, 2022

Learn to write well..

'Learn to write well' advices and tips by Rajan from his Newsletter

It has repaid me more than my super-expensive MBA, my electrical engineering degree, or pretty much anything useful I have done – I am talking about the craft of writing.

For more than three years, writing on LinkedIn and Quora gave me the privilege of serving millions of readers. For every drop of sweat I put in, I got back 100-times over.

So allow me to share an unsolicited piece of advice: Learn to write well. It will change your life.

But this advice is as useless as it is correct. Sure, we should all learn to write well, but how? That is what I will explain in this newsletter. But before that, a disclaimer: I am not a trained writer, nor do I claim to be great at writing.

However, over time, I have gotten better at writing. And if I can get better, anyone can.

Therefore, here is my personal writing guide that evolved over the years. It is not the only way to write – just my way. Use it with caution.

So here we go:

  1. Don’t ever bore your reader – it is a crime. In fact, grab their attention in the very first sentence, and then don’t let up. Here are a few ways to do that:
    • Fire up their curiosity. In the very first sentence, make the readers want to know something that only comes later in the writeup.

      Example: Look at the opening of this newsletter. If the first few words don’t make you read the whole sentence or if the first sentence doesn’t make you read the next one, you would not have reached here.
    • Another option: Start with a story, preferably your own.

      Here is a sample – ‘My mother said to me one day, “The night you were born, the stars in the night sky were dancing – I swear to God. I said, “Mom, it’s ok. You were just drugged and a bit delirious!”

      This is just a random story I wrote. But as long as there are specific characters, events, and something unexpected, it will grab your attention.
    • One more option: Say something that will connect with your readers – something that you both share.

      Example: “Every time I have to order an Ola or Uber, my heart palpitates – I feel like the driver will now conduct my first job interview.”

      Anybody frustrated with Ola/Uber drivers asking for cash or refusing a ride will connect with this. And once that connection is made, you have the reader's attention – for at least one more sentence.

      So, short of gimmickry, do whatever it takes, grab them – don’t allow anyone to walk away after reading the first sentence.

      And once you grab them, don’t let their attention wander. Keep the writing flowing. Each para should make them read the next. And if you have a punchline or surprise, hold it off till the end or as much as possible.

      Finally, end memorably. The last line is the second most important line. The most important is the first.
  2. Write like you are talking to the reader – one-on-one.

    And this is not my advice – it comes right from David Ogilvy, who once said, “Don’t address your readers as though they were gathered together in a stadium. When people read your copy, they are alone. Pretend you are writing to each of them a letter on behalf of your client.”

    I like writing as if I am talking to you. In fact, right now, in my mind, I am talking to you – and just you, nobody else.
  3. Use active voice. Yeah, I know it is obvious but it is amazing how often we still don’t follow this.

    Example: Don’t say, “Today’s match will be decided by Rohit’s and Kohli’s batting.”

    Instead, say, “Rohit’s and Kohli’s shots will decide which team wins.”
  4. Use action verbs. Minimize passive descriptions.

    Example: Don’t say, “Amazon has a great culture. They have free counselors, available on call.”

    Instead, try, “If you are having a bad day at Amazon, just call 1199 and in 30 min you will be talking to a counselor – bawl on their shoulders all you like – it is free.”

    Of course, I am taking excessive poetic license, but you get the drift.
  5. Don’t preach, for God’s sake. Don’t tell people what they should do. Don’t tell them this or that is important. Anytime you use the phrase “you should”, think again.

    Just see the difference between the following:

    Sample A

    To be a good product manager you should have three major traits – A, B, and C

    Sample B

    In two years, my classmate Amit went from an intern to one of Flipkart’s star product managers. And the three traits that got him there are – A, B, and C

    Admittedly, I made Sample B more dramatic but again, I hope you get the drift. So please avoid generic, preachy writing.
  6. Tell stories. Stories evoke emotions, and emotions move people. Without an emotional connect, it is hard to persuade people.

    We all believe we are logical people – yeah right! The truth is, we are all emotional people.

    If you and I bond emotionally, the things we will do for each other will surprise us. That is what friendship, love, and brotherhood are – the irrationality of emotions.

    Good writing can make you laugh or cry. Bad writing can also make you cry, but for different reasons!
  7. Be specific. Take names. Talk places.

    Don’t say, “People slog for many years for the UPSC exam.”

    Instead, try something like, “For the fourth straight year, Amit was writing UPSC – no movies, no games, no fun – just slog. And he was no exception.”

    Specific names, events, places, and dates grab our attention much better than generic descriptions. Who wants to read one more essay?
  8. Show, don’t tell.

    I often see people write things like, “The dinner in Shangri-La was amazing.” Really? Then make me feel that – don’t tell me outright.

    Think about all the things that made the dinner amazing and make me experience that vicariously. Then, I might say, “Oh wow, that was an amazing dinner!” Mission accomplished.

    For example, you could say, “After the bruschetta we had at Shangri-La’s dinner yesterday, I felt I could die without regrets. But after the rest of the six courses, I thought the bruschetta was mediocre in comparison!”

    Another example: Instead of saying, “Clearing the CFA is hard”, you could say, “I studied 20 hrs per week for three years, and yet before every CFA exam, I was awake with exam-terror.”

    Once again, I made the examples above a bit too dramatic but you can hopefully see the difference between showing and telling. What I am asking you to do is hard, but absolutely critical to good writing.
  9. Don’t use big words and jargon – please don’t be cruel.

    Use simple words. Even when you know a big word, when a simpler one will do, use it.

    Don’t say: “The operational synergies between Jet Airways and Kingfisher Airlines combined will help us strategically rationalize cost.”

    Instead, say: “If Jet Airways and Kingfisher Airlines pool and share their ground staff and resources, the cost will go down by 20%.”

    Please leave jargon for big companies and government – you and I will talk to each other like normal human beings. Deal?
  10. Omit needless words. This is hard. But do it.

    Adding unnecessary words is pouring water into milk to increase its volume. Why would you dilute your writing? Why?

    But here is the problem: Once you write a sentence, deleting it feels like killing your baby. But delete it. Every useless word is water added to milk.

    Once a London-based lawyer told me this: In a well-written legal agreement, every word should add to the meaning – and if you pull out a single word, a good document should collapse like a house of cards.”

    This is a very high bar and I seldom meet it, but we got to try.
  11. Edit, edit, edit. And then edit some more.

    Whenever I write a draft, it is perfect. But when I chop some words, it looks even more perfect. Then six months later, I read it, I go – “So much fluff here. Who wrote this?”

    When you see beautiful writing, you are seeing a ruthless editor. When editing, be brutal. As a human, be kind :)

    The biggest challenge in editing is that once you write something, your eyes get used to it and glaze over it. If a preposition is missing, you may not see it – your mind inserts it while reading.

    Two solutions to this problem: Put your writing away for some time (even if just for a minute) and read it again. And when possible, a friend to critique it.
  12. If you are writing on social media (e.g., LinkedIn), don’t write in long paragraphs.

    I don’t have to tell you that the human attention span is now reduced to about one nanosecond, do I?

    But I also hate it when someone writes 20 paragraphs, each just one sentence long. God – I so hate it! So don’t be extreme, but shorter paras generally do better.
  13. Be authentic and maintain integrity.

    If that means ignoring everything I said here, please do so.

    Don’t write like you are Bertrand Russell or Winston Churchill – write like you are you. And that is your trump card. Nobody has lived your life. Nobody has dreamed your dreams or seen what you have seen. Only you can speak in your voice – so do it.
  14. Do rules of grammar and composition matter? Or can you take creative liberties?

    Let me put it this way: If you are Virat Kohli and play a random shot, people will say, “Wow, Kohli is going really unconventional today.” But if I were to do the same, they would say, “Get this monkey out of the field. Who let him into the team?”

    The moral of the story is that if your grammar is good, people will love your deviations for your style quotient. But if your grammar is all over the place, it will be a pain to read.

    So first earn the right to take creative liberties with grammar, and then, do it selectively.
  15. Lastly – don’t hold back.

    Write with rage – let it flow. Don’t censor yourself.

    This is not a license to throw in profanities. All I mean is once your thoughts or emotions start flowing, let them – don’t apply brakes. Editing comes later.

    Just to give you an example. I once wrote an answer to a very boring question on Quora – “What is holding back India’s progress?” Just search for that question on Google and you will see.

    For some reason, that day, I was in a rage at the state of our country. And in that rage, I wrote a very long answer. It is probably the most popular piece I have written on Quora, read by half a million people or more.

    You obviously don’t have to wait for rage to write – if you are a writer, write regularly. But there will be days when you are overflowing. Let it overflow.

That will be all for now. Like all advice, take it with a fistful of salt – use your judgment.

I just shared whatever my mind came up with. I am sure I will remember more stuff tomorrow, but that’s ok – we don’t have to be perfect.

If you found this newsletter useful, do try incorporating it into your writing. Just for your easy reference, here is a link to the PDF.

While writing this, I felt like I was talking to you – hope you felt the same. That is what makes writing fun.

Do well in life and stay in touch.

Rajan

Sunday, April 3, 2022

A few cheat codes and tips from experienced Software Architects

 Having clean software architecture and staying conform to pre-defined design principles from start of the project is one of the best ways to avoid possible technical debt in the future of that software system. Clean Software Design is a key point for an effective software product.

Let us have a look at some important principles, rules, guidelines that ensure a clean software design:

Principles:

  1. Loose Coupling — if classes use each other, they are coupled together. The less classes are coupled, the easier is to change them.
  2. High Cohesion — degree to which elements of a whole belong together. Components of the class should be highly cohesive.
  3. Locality — Changes, maintenance, extensions are only local. This leads to no harming whole environment.
  4. Removeable — Software Components should be easily removeable.
  5. Small Components — software system should be only of small components ideally each doing only one task.

Class Design:

  1. Single Responsibility Principle (SRP) — class should do only one task.
  2. Open Closed Principle (OCP) — class should be extended not modified.
  3. Liskov Substitution Principle (LSP) — child classes must be able to replace their super classes.
  4. Dependency Inversion Principle (DIP) — dependeny is reversed: high level components are free of low-level components.
  5. Interface Segregation Principle (ISP) — interfaces should be small: classes should not implement unnecessary methods.

Cohesion Principles:

  1. Release Reuse Equivalency Principle (RREP) — only together releaseable components should be bundled together.
  2. Common Closure Principle (CCP) — classes that change together should be bundled together.
  3. Common Reuse Principle (CRP) — classes that are used together should be bundled together.

Coupling Principles:

  1. Acyclic Dependencies Principle (ADP) — no dependency cycles.
  2. Stable Dependencies Principle (SDP) — depend on direction of stability.
  3. Stable Abstractions Principle (SAP) — the more abstract, the more stable.

High-Level Architecture:

  1. Keep Configurable Data at High Levels — constants or config datas should be kept in high level.
  2. Don’t Be Inconsistent— have a convention, principle, rule or guidelines and always follow them.
  3. Prefer Polymorphism To If/Else or Switch/Case.
  4. Separate Multi-Threading Code — isolate multi-thread from rest of the code.
  5. Only one level of Abstraction per layer — stay conform to existing abstraction layers.
  6. Fields Not Defining State — fields holding data that does not belong to the state of the instance but are to hold temporary data. Use local variables or extract to a class abstracting the performed action.
  7. Micro Layers — avoid unnecessary design layers.
  8. Singletons / Service Locator — Make use of dependency injection.
  9. Base Classes Depending On Their Derivatives — Base classes should work with any derived class.
  10. Feature Envy — The methods of a class should be interested in the variables and functions of the class they belong to, and not the variables and functions of other classes. Using accessors and mutators of some other object to manipulate its data, is envying the scope of the other object ©.
  11. Unused Coupling — avoid unused dependencies, be greedy.
  12. Hidden Coupling — make sure that order of calls to different methods are correct.
  13. Transitive Navigation — (Law of Demeter), write isolated code. Classes should have access to only its direct dependencies.

Environment:

  1. Project Build Requires Only One Step.
  2. Executing Tests Requires Only One Step.
  3. Source Control System — Always use a source control system.
  4. Continuous Integration — Assure integrity with Continuous Integration.
  5. Overridden Logs— Do not override warnings, errors, exception handling