28 February 2016

National science day: The cultivation of scientific temper

Today was Breakthrough Society's celebration of National Science Day and the observation of the "Cultivation of scientific temper". It included many school children and adults who were invited to the Raman Research Institute at Bangalore for a seminar and an exhibition.

T'was my first visit to the campus, and I just loved the beauty of it. Reminded me of Bangalore, the way it was before concrete, asphalt and smoke took over the city!

The conference touched upon topics of scientific importance, about the need for research in India, the realization that people should have about science and the way it impacts humanity and an appeal that people go through some trouble in life; even if it involves some amount of struggle, so that their research and discoveries can bring greater good to humanity.

The seminar was followed by a documentary on Dr.C.V.Raman's life.

and a visit to the science museum, where there were various exhibits and publications of Dr.C.V.Raman.

We were shown how Dr.Raman (at the age of 16 or 17), had questioned why the Veena sounded like a human, and pursued the question. Even though Helmholtz had said that a plucked string could oscillate in only an odd number of ways (1, 3 or 5) etc..., Dr.Raman went on to prove that the Veena could even oscillate in even numbers, hence producing sounds similar to that of a human. This was because Helmholtz had experimented with a Violin, whereas the strings of a Veena are strung very differently, and when plucked, they oscillate differently.

Dr.Raman also dropped a metal bearing on glass and noticed the circular crack it made on impact. He tried the same on quartz crystals and noticed that here, the cracks were triangular in shape. Typical scientist :-)

The science museum has a large collection of objects he studied and collected. Said to be the largest collection any scientist has. Photos were forbidden since they said that if the photos were shared on social media, that would dampen the curiosity of the children. I disagree. The collection is so unique and amazing, that people would actually want to send their kids to actually see it. Believe me; there are no photographs that can capture the glimmer and wonder of those stones which are captured by the eye.

Also on display were some interesting quotes:

There was also an interesting quote from Einstein, which I followed up on:
I have now reached the point where I may indicate briefly what to me constitutes the essence of the crisis of our time. It concerns the relationship of the individual to society. The individual has become more conscious than ever of his dependence upon society. But he does not experience this dependence as a positive asset, as an organic tie, as a protective force, but rather as a threat to his natural rights, or even to his economic existence. Moreover, his position in society is such that the egotistical drives of his make-up are constantly being accentuated, while his social drives, which are by nature weaker, progressively deteriorate. All human beings, whatever their position in society, are suffering from this process of deterioration. Unknowingly prisoners of their own egotism, they feel insecure, lonely, and deprived of the naive, simple, and unsophisticated enjoyment of life. Man can find meaning in life, short and perilous as it is, only through devoting himself to society.
The economic anarchy of capitalist society as it exists today is, in my opinion, the real source of the evil. We see before us a huge community of producers the members of which are unceasingly striving to deprive each other of the fruits of their collective labor—not by force, but on the whole in faithful compliance with legally established rules. In this respect, it is important to realize that the means of production—that is to say, the entire productive capacity that is needed for producing consumer goods as well as additional capital goods—may legally be, and for the most part are, the private property of individuals.

But perhaps one of the most important quotes the community was missing out on, was this one:

It's not really about the survival of the strongest or the most intelligent. It is about the one that is most responsive to change.

My view

We see many protests in our country about growing intolerance and the lack of promotion of science. Makes me wonder why this happens. Many decades ago, it was the will of certain curious people which helped them make discoveries, helped the world to advance and brought pride to the nation. Any government would be happy to encourage such people and I believe this is why science was given importance. This is why we had impressive research institutes and dedicated people.

It created value for the nation.

As the years passed by, did something else create more value for the nation? Did research cease to add as much value as something else? Did our nation become self-reliant enough that it no longer needed science? Is it more economical to purchase a technology from a neighbouring nation than to invest in our own research? Does the work of private enterprises add more value to our nation?

As Darwin's quote in the above picture says; it is the species that is most responsive to change that survives. Has our scientific community adapted to the changes? We live at an age that has seen more peace on Earth than in historical times. Is this an age where the entire world works as one (except North Korea)? Where research in basic sciences, can be done at select countries so that other countries can focus on other things? Does a country really need to worry that it is not doing enough research?

What exactly is the bigger picture here? I'm quite sure that if a nation needed more research, the government would have actively pursued it. If a government isn't doing so, there's a reason. What is that reason?

Is our advanced, industrialized society really deteriorating (as Einstein said) and becoming focussed on the trivialities of life?

I believe things will change. Not by dissent; not by protest. The change will be brought about by a mind that conceives such a thought, that it would alter the very way we live our lives. In the same way that a hundred years ago, everyone who predicted the future did not in the least bit take into account or conceptualize the advent of software.

There is hope.

27 February 2016

Descriptive names

We've all been through our initial programming lessons, creating for loops as for(int i = 0; i<10; ++i) and so on. float s = d / t.

Variable names didn't matter much then.

The confusion begins, when you enter the professional world, write large programs, forget about them and months later, look at the code and wonder what in the world you had written long back. Class names, variable names and function names don't make any sense at all!!!
If you took care to write comments, then they are a saving grace, but only for a while.

Which of these would make more sense to you?

//check if customer age is equal to threshold
void check(double v
   if (val == v) {print("yes");} else {print("no");}


void checkIfCustomerAgeIsEqualToAgeThreshold(double customerAge
   if (ageThreshold == customerAge) {print("yes");} else {print("no");}

See the difference? No need of comments. No confusion. You understand what the function and variables are there for, just by looking at the code.

The other big advantage is that if you decided to do some refactoring, you wouldn't have to bother changing any comments, because the class/function/variable name itself is the comment!

Same goes with macros.
I see a lot of C++ programmers using...

#if 0
//some code

...to temporarily deactivate some code. If these programmers get hit by a bus or even if they look at the code many years later, they won't have a clue of why the code was deactivated and whether it is ok to simply delete it.

What if they used this instead:

//some code





Same goes with class names. Which makes more sense?:

class Filter{}
class MicroFilter extends Filter {}


class AirFilterSuperclass {}
class SpecializedMicroFilterOfCompanyABC extends AirFilterSuperclass {}

  • It makes a world of a difference to the person who maintains the code.
  • It makes another world of a difference to the person who reviews your code.
  • And it makes an entirely different world of a difference to the business that profits because developers, tech leads and QA teams spent lesser time figuring out the code and spent more time in being able to create a splendid product!

08 February 2016


 Continued from the previous Aha!

Share with this link

After the sneeze
Share with this link

Continued in the next Aha!