Friday, July 12, 2019

How Did I Become A Programmer?

Arya asked me from Germany, "How did you start with programming? Maybe write a blog about it? Your learning strategies".

To those of you who know me as a doctor, I'm a professional programmer who can work on any part of the stack (and even off the stack), and a free software advocate. To those of you know me as a programmer, I'm a professional modern medicine practitioner who can manage any kind of illness (including emergencies in the appropriate setting). To those of you who do not know me, I do much more than what I just described.

But how does one become a doctor and a programmer? As it takes indeed some explaining to do, the suggestion to write blog was excellent and here it is.

I have written about my privileges previously. So I won't repeat that. But it is important to know that some of the things I'm going to describe maybe either much easier for you or much more difficult for you depending on where you are in your life. In other words, your mileage may vary. But do read on, as there are some common principles which should apply to everyone.

Start early
I started in fifth standard, I think. With a simple programming language called MS Logo. I didn't know what a programming language was back then. All I was doing was moving a small turtle move on the screen and draw shapes. But the only way to move that turtle was by writing commands.

FD 50

The turtle would move forward 50 steps

LT 90

The turtle would turn left

FD 50

Another 50 steps forward, but this time to the left of your screen

You could write this 4 times each and get a square.

But soon you will feel like you are writing too many commands and that sometimes these are repetitive. For example, drawing the square above required the same two steps (FD 50 and LT 90) four times in a row. What if you could tell turtle to repeat the same?

REPEAT 4 [FD 50 LT 90]

That would make a square in logo! And that is what a loop is (pun not intended).

Loops are the biggest fundamental concept in programming. If you can understand a loop, you can understand the entirety of programming. That means, if you could read the above section and make sense of it, you have everything that is required to become a programmer. Only time and effort can hold you back now.

But there is so much more about it, right?

True.

Let's not digress. Where did we stop? Logo. Check this article/tutorial on logo. Don't try to run it or anything. Just go through the entirety of it. When you see the complex fructals that gets drawn towards the end of the page, you should be able to realize another big and fundamental truth about computers or programming - you can make the computer do anything, but only if you tell it exactly how to do it.

Well, that is what programming is, you see. Telling computer every single step of what needs to be done. The computer is insanely smart and insanely dumb at the same time. It can do anything and everything, but you have to tell it how to do it. And you have to tell it every single step of how to do it.

Imagine you are teaching the computer how to make tea. Let us have an imaginary conversation with the computer on how to make tea.

You: Make tea
Computer: How?
You: Heat water. Then put tea dust. Then put milk. Then put sugar. Then stir. Then pour to cup.
Computer: How to heat water?
You: Take water in a vessel. Then keep the vessel on the stove. Then switch on the stove. Then wait till the bubbles start coming in the water.
Computer: How to take water in vessel?
You: Move vessel under the tap. Switch on the tap. Wait till the vessel is filled half. Switch off the tap.
Computer: How to move vessel under the tap?
You: Find out where the vessel is. Pick it up by the handle. Find out where the tap is. Move till there. Keep the vessel perpendicularly under the tap with empty side up.
...

You get the point, right? If we go down this route till the level of physics, we will have made an electronic teapot. It will unfortunately not be able to make coffee though.

But that is all there is. Break down a problem into individual single steps till the point where a computer can natively "understand" what you mean to say. CPU is a rock that we tricked into thinking. It only "understands" electricity. All that we see in the computer world is manipulation of this electricity into configurations that we want it to be in.

But, that's so deep? How can we break down everything to such great level of detail? Is it even humanely possible? That brings us to the second fundamental tenet about computers - you build on the work of others.

You literally cannot build a computer all alone. There are thousands of parts to a computer which were made through even larger pathways that are possible only due to the combined human investment of effort in the past thousands of years. If you could take all the knowledge that exists in world today and go back a 1000 years, it would still be impossible to build a computer.

You build on the work of others. That's what you do in programming. People have built operating systems, libraries, applications, programming languages. There already is a lot of what you want to do out there in the world. Instead of trying to figure out everything by yourself, you build on others' work.

Even learning. People write about what they have learned. You can then use their learning as your learning. The programming world is an excellent model of co-evolution. A communist utopia.

You want to build a website? There are libraries and frameworks available for that.
You want to build a business? There are e-commerce frameworks.
You want to write a blog? There are blogging software.
What about that teapot? Well, you can build on existing work for that too.

There is one thing, though. You can't learn programming without doing programming. It is like cycling in that sense. You have to start slow, fall a lot of times. But once you get a hang of it, you can keep improving till you start doing tricks that make you look like a pro.

One approach that has helped me a lot is not giving up. Every programming task appears daunting in the beginning. But once you break it down into smaller steps and start working on each piece, you feel a bit more confident. And then you inevitably run into trouble. But there are literally thousands of resources on the internet to help you.

Understanding what exactly your problem is, and then looking for solutions to that problem helps. At this point, I will be less of a hacker, if I don't link to ESR's article on how to become a hacker, instead choosing to repeat what has already been accomplished. While you are at it, also learn how to ask smart questions.

Still feel like you need a prescription? Here you go:
Set up linux on your computer.
Pick up python or javascript.
Find out a problem you want to solve, and use python or javascript to solve that.
Keep repeating.
Pick up other technologies on the way.
Don't leave anything as "I don't know that, it is not for me", instead tell "I don't know it yet, so I should learn it now".


If you like what you're reading, subscribe!

Get posts via email:

Thursday, May 2, 2019

How To Travel in Bangalore

I've been traveling extensively in and around central Bangalore for the past 6+ months. I have experimented with various modes of transport and various tools that assist finding the right transport in these journeys. Today when I met Nishan on his first day of a new life in Bangalore, I realized I have been traveling long enough to give some travel advice.

Disclaimer: This may not apply to all parts of Bengaluru, especially the Electronic City side (which actually should come under Chennai metro)

What is the best way to travel in Bangalore? It depends. What time is it? Where are you going? How much time do you have?

BMTC
BMTC is the most connected public transport system in Bangalore. The frequency of buses is usually inversely proportional to how badly we want to reach somewhere quickly. But, if we leave enough time to wait for the right bus, there will always be a bus. 

The BMTC app on play store is a hit and miss. If you've used it successfully in a particular route and if the time is before 8pm there is a high chance that the "Trip planner" will show buses that actually are plying. In fact, in such situations the information is so accurate (location, bus number plate, etc.) that I've been thinking about an Uber like service on top of the BMTC app.

There is a monthly pass if it works for you. For ₹1100 in ordinary buses and ₹1700 in AC buses you can travel wherever you want how much ever you want for a month. These passes can be got from any of the bus stations. There is also a daily pass which can be got from bus conductors.

Metro
Namma metro is simple. It either goes where you are going or it doesn't. Indiranagar, Jayanagar, Majestic, Mysore Road, Yeshwanthpur - these are best connected by the metro. The unfair advantage metro has over any other means of transport is that at 7 o'clock when the entire road network is jammed up, the metro rail just flies over the traffic.

In rush hour, if possible, always choose metro.

Get a metro card. It saves 15%. It can be recharged online. And it can be kept in wallet which allows you past gates by waving the wallet over them.

Uber/Ola/Rapido/Speedo/Ludo/Bodo/whatever-do
Uber and Ola are for business class travel. Also, when it is late night and there is no other way to travel. Rapido is for teenagers who aren't afraid of dying. Avoid all these unless absolutely trapped.

Google maps
The only tool you need to figure out the best route to anywhere is Google maps. It may not always get the timing right (especially for buses), but it always calculates the quickest route. Use the public transport tab. Use options and choose "subway" whenever there is a chance. Experiment with the starting/ending point a bit and there may be more convenient routes.

When using Google maps for planning travel, always be mindful of the time of day for which the calculations are made. Change this in the "arrive by" or "depart at" setting.

To conclude, traveling cheaply in Bangalore is possible. The secret is in planning and timing. Use the tips I've laid out with your own judgement and enjoy traveling!


If you like what you're reading, subscribe!

Get posts via email:

Sunday, March 17, 2019

Making Time

Yesterday Swathi and I visited Anivar and Joshina and their kids. It has been at least 5 months since we started planning this visit. And we finally made time for it, yesterday.
The moment we stepped inside Noonu and Ilan were on us - showing their toys, making us read story books, laughing at jokes, jumping, dancing, and purely enjoying. I burst out laughing at one particular joke in Balarama and could not control myself for half a minute. We had lots of food for stomach and mind.
I had asked Joshina about her work some time in the recent past. She told me about her current life philosophy which resonates with what Anivar told about his life philosophy a few weeks back, both of which struck a chord in me. The following is what it boils down to.

The society will expect superhuman things from you. Whenever you do something, there will be a few people to ask you about that next thing that you haven't done. If you keep trying to satisfy all these "next things", you will never be able to keep up. Because it is humanly impossible. But more importantly, you will be happy only if you are doing the things you want to do and those are things that bring you happiness.
A few weeks ago, I had said to myself "the secret to getting things done is to have more things to do". I think I was not entirely right. The focus should never be on getting things done. The focus should be on finding out things worth doing.
Today, coincidentally, I read Make Time: How to Focus on What Matters Every Day (affiliate link). I started it today and I made time to finish it today. And now I have made time to write this blog post today. The book gave me a strategy to implement the theory I learned in The One Thing (affiliate link).
The idea is to focus on life and not let it wither away. To focus on things that make sense to you. Things that are meaningful to you. Things that you will regret not doing. Make time for those things.


If you like what you're reading, subscribe!

Get posts via email:

Sunday, February 24, 2019

On (Not) Judging People

Human beings have an in-built sense of "morality" that they routinely apply against everything that they come across. There are multiple ways one's sense of what is moral and what is immoral emerges - including religion, upbringing, exposure, rationality, mental health, and so on.

Is morality necessary?

Morality is necessary. Not just because it allows people to live together without killing each other. But also because it helps an individual answer their own questions about what to do in any particular situation. It is the moral compass that often shows the direction to forge.

Should we use morality to judge others?

A distinction needs to be made before answering this. When "judging" someone, are you judging the person or their action? The answer matters a lot.

When you judge a person for a particular action, you are labeling that person as "good" or "bad" based on that action. For example, if you see the CEO of a company scolding an employee for a "small" thing and judge the CEO to be a bad person, you may be making two mistakes.
1) You do not know the reasons why the CEO is scolding the employee. It may even be for the good of the employee in the long term.
2) By labeling the CEO as a bad person, you have created a barrier between you personally and them which might make it difficult for you to work with them.

There are several cases where reason 1 does not apply at all. For example, say the CEO is actually doing something, say, being corrupt, which they themselves might not be able to defend.

But reason 2 is more important for someone who is trying to get things done. People are not dispensable. Human resource is hard to come by. If you start judging people by a few of their actions and dismiss them as "bad". If you make it impossible for you to be working with them. Then you have one less person to work with. And when we are all humans and everyone will have some or the other "follies", especially when you are viewing them through your sense of morality (which, having been formed by your own unique experiences in life, is going to be different from anyone else's sense of morality), judging people will soon leave you with nobody you can work with.

In other words, every human is different. If you keep looking for people who think, walk, and talk exactly like you to forge teams, you will never be able to move forward.

But, does it make sense to judge actions? Yes. As long as the judgement does not spill over to the person as a whole. In fact, judging actions is natural and direct consequence of morality. But extrapolating that judgement to an entire person is human bias.

But what if someone is wrong in all areas of their life? I think it is quite right to be mathematical here. The total value of a person is the sum of all their individual values and the added value that interaction of values give them.


If you like what you're reading, subscribe!

Get posts via email:

Friday, December 28, 2018

[jog-journal] Track Change

Four months, quintals of biriyani, and almost fainting inside the metro day before yesterday because I darted to catch it and came to a standstill immediately. It took me these to realize that I should take care of my health even if Bangalore isn't as enticing as Mysore to go for morning jogs.

There is Jayaprakash Narayan Park near where we stay. It does have some water body inside it, but not a lake. There are brick lanes throughout the park and a sand lane that runs through the perimeter. So, today morning when I woke up at 5:40 after ten minutes of my alarm ringing, I decided that I shall resume jogging. Since I'm not a big fan of the calendar days I didn't have to wait till new year for making a resolution.

There was a pup about 2 months old tied to the gate of my neighbour's house. It jumped up and caught my calf with its tiny paws two days back when I saw it. But today it was sitting still, yet vigilant. The Rajapalayam which roamed third main road was sitting in front of its owner's gate. The German Shepherd (also known as Alsatian, a fact I came to know now when I searched "difference between German Shepherd and Alsatian") inside was not near the gate and so didn't bark at me like it usually does. The obese dog at the corner was walking today, for a change. It usually is always sleeping. Maybe it too had a realization today morning.

By the time I came back even the two Indian Pariahs right next door were up. And the Pomeranian was walking behind the newspaper boy for getting its well deserved pat. The pup had broken its meditation, raised its paws and reached out as far as the leash would allow it to.

Did you notice one thing? There were no cats around. I've never seen a cat do morning walk. Neither one that actually eats cockroaches. Cats are everything that humans should not be - lazy, selfish, and enigmatic about what their thoughts are. And dogs? Dogs set the ultimate standard that humans should strive to reach - persistent, caring, and down to earth about their feelings. You now know why I love dogs more than cats.

The primary care fellowship and infectious diseases case based learning series are both set to start in January. I remembered it because just yesterday in JeevaRaksha JALS workshop at NATCON 2018, we met some wonderful young doctors with idealism not lost and that spark remaining in their eyes. Hopefully the day after we will meet again and discuss the heroism of incremental care, the wonderful life without "specializing" and the rat race, and a different style of learning and practising the art and science of medicine.


If you like what you're reading, subscribe!

Get posts via email:

Monday, November 12, 2018

11 Years of Blogging

I am on Blogger since November 2007. It is 11 years this month.

When I began, it was just me exploring the Internet. Everyone was making blogs back then. And I had to make one too.

I made one. Then I made another, and then another. I have created some 36+ blog on blogger. I made one for my village, for my city, for my school, for my other school, two for my college, one for my university, one for pre-med preparation, one for physiology, one for biochemistry, one for anatomy, one for boss linux, one for scouting, one for APJ Abdul Kalam, one each for all subjects that fascinated me. The vast majority of them are bare barring one or two posts.

Facebook, Twitter, and others took the crowd away and in turn the publishers. I have written countless posts on Facebook only to lose them all when deleting my account.

But it wasn't about the medium. It was about the act. Expression of an opinion. Free speech. Archiving thoughts and information for posterity. In fact, the latter is the philosophy behind my website learnlearn.in.

Thank you @freephotoscc for sharing these awesome photos on https://freephotos.cc/ for free! 🎁
Blogging helped me develop a perspective on things. It made me think more concretely and in depth about whatever I wrote about. And I wrote about a lot of things.

It also gave me a rare confidence of accomplishment. I was creating things rather than consuming. And on the internet, the creators are one rung above the consumers. It is this confidence that propels me on a path of building things.

I am excited about this milestone. And the result is going to be more things from me for you to read.


If you like what you're reading, subscribe!

Get posts via email:

Friday, September 28, 2018

Photograph 51, Bangalore Little Theatre rendition

In my 6+ years in Mysore, I've seen around 6 plays. 2 plays that I don't remember, and 4 times "Madhyarathriya Thiganegalu" by Rangayana.
Come my second week in Namma Bengaluru, I witnessed a 1 hour 30 minute spectacle called "Photograph 51" by Bangalore Little Theatre. Oh, where do I start about this heart warming, yet insanely funny and intellectual play?

The venue was JRD Tata Auditorium. There were scientists and senior citizens taking up majority of the seats. The stage was set as a dimly lit Chemistry lab. The story of Rosalind Franklin.

"The play is about the race to solve the structure of the DNA and the role of Rosalind Franklin who provided the critical evidence for this. For a long time, she never got the credit and this play highlights her efforts in science at a time when the doors of science were not open for women."

The introduction by the director and his daughter set the tone for what was about to come. Photograph 51 is that image of the DNA taken by Raymond Gosling and made the mystical thing a little less mystical.

As soon as the cast walked on to the stage, the narration started, by none other than the actors themselves. This is one of the many exciting things about the play. There is no narrator. But there are many narrators. And they are all part of the play as well. The narration is sometimes weaved through dialogues. The fourth wall gets breached many times, but what do you call the wall between the narrator and the actor?


Then there is the wit. If I were to put the play in one genre, I would choose comedy over history, feminism, and science. But it is not a comedy play. The wit never bothered the story. Wit was always self-contained either in soliloquies or in quick exchanges between the actors.

There is love. There is passion. There is heartbreak. There is reality. This play is a must watch.

And for that matter, they are performing it one last time on 29th September in Bangalore. Head over to BLT's website for more information.


If you like what you're reading, subscribe!

Get posts via email:




One more time, subscribe via email: