The Miracle of Self-Descipline

Studying Successful men and women is one of my fondly cherished hobbies. I have studied over 100 of successful people through biographies,autobiographies,blogs,diaries and many more just to find out what it takes to be successful.  I have always been very intrigued with the thought that why there are so few people on this planet who become successful in what they do while we all have the same 24 hours of time every day?

Scientifically, it has already been proven that talent is overrated. There are probably millions of unknown people on this earth who are way more talented than some of our famous ones but unfortunately, we never get to know them. Hardwork definitely plays a key role. In fact, in one of my previous posts “10,000 Hours of Practice“, I have already pointed out there is no substitute for hardwork if you want to be successful in life. But even then, that is not all it takes. There is one more characteristic of successful people that popped up repeatedly in my study of Successful people. Therefore, today I am going to talk about that missing element that will make you successful in whatever you do and the name of that element is “Self-Descipline”.

What is ‘Self-Descipline’?

Self-Descipline is a habit, a practice, a philosophy and a way of living. Contrary to common belief, self-discipline does not mean being harsh toward yourself, or living a limited, restrictive lifestyle. Self discipline means self control, which is a sign of inner strength and control of yourself, your actions, and your reactions.All successful men and women are highly disciplined in the important work that they do. All great success in life is preceded by long, sustained periods of focused effort on a single goal, the most important goal, with the determination to stay with it until it is complete.  Throughout history, we find that every man or woman who achieved anything lasting and worthwhile, had engaged in long, often unappreciated hours, weeks, months and even years of concentrated, disciplined work, in a particular direction.  Fortunately the quality of self discipline is something that you can learn by continuous practice, over and over, until you master it.  Once you have mastered the ability to delay gratification, the ability to discipline yourself to keep your attention focused on the most important task in front of you, there is virtually no goal that you cannot accomplish and no task that you cannot complete.

How do we build it?

Now that we know what it is, the next obvious question is how can we build it?

Lets imagine for a second that there was a switch in your brain that would allow you to efficiently smash through your daily to-do list, eat only foods that are good for you, and never skip a workout again. Ever wonder How would our life be different then?  Well, I have a certain vision of my future-self in my mind and every morning when I wake up, I always try to put my best effort to move one more step forward towards my goal. Life is always hard and I am still not there yet, but I am NEVER STOP researching and trying new ways to get there and one day I know, I will.

There are plenty of ways you can teach yourself on becoming self-disciplined. Below are the one that are my top priorities right now. Research shows that these are the most influential areas of your mind that can lead you to success.

  • Meditation – The Zen Way

    Practicing mindfulness meditation for a few minutes each day can actually boost willpower by building up gray matter in areas of the brain that regulate emotions and govern decision making.” 

  • Exercise- Magic for your body

    This is already a well-discussed topic. Not only does it increase our fitness and mental performance, improve our mood and sleep quality, reduce our body fat percentage, anxiety levels and likelihood of becoming sick. It’s also been shown to improve our willpower.

  • Harness the power of Accountability

    Admittedly, accountability isn’t the sexiest word in the English language. But the concept it represents is extremely powerful.The idea behind it is that when we’re left to our own devices, it’s easy to come up with excuses not to do something.

    I’m tired, I don’t feel like it, it’s too much work, it’s too hard.”

    The solution is simple: build structures in your life that will hold you to a higher standard and that will prevent you from coming up. If you do not like to go to gym, hire a trainer, if you do not feel motivated to work, have a co-worker or partner to whom you report every day, if you do not have anyone, use website like stickK. Whatever specific system you use, the most important thing is that it takes away your ability to procrastinate and make excuses, and that it makes you stick to your plan and highest values.

  • Set SMART goals

    When someone asks me how they could have more discipline and willpower, my first question to them is always, “do you have clear goals for yourself?” 90+% of the time, the answer is no. Oops.Why is it so important to have defined goals?Because they give you a clear direction in life and help you connect your daily actions to a greater purpose. I have worked really hard to define my goals. Trust me, it is not easy. But once you have that, its easier to take control on rest of your life.

    When you create your goals, make sure they are SMART: Specific, Measurable Attainable, Relevant and Timely

For instance, don’t set a goal of “I want to lose weight” or “I want to make more money”. Instead, it should look more like “I want to lose 10 lbs of body fat by March 1s”  or “I want to increase my monthly income by $5000 by June 10”. Once you do that, taking action and staying disciplined every day will be infinitely easier. You’ll be “pulled” towards the achievement of your goals, and you’ll feel a great sense of  purpose and fulfilment.

  • Remove Temptations and Distractions

    We all are subject to temptation—it’s just in our nature. And in today’s world we’re surrounded by more temptations than ever.Google gives us access to all the information in the world within a few seconds. YouTube is filled with funny, entertaining, and interesting videos. Our Facebook newsfeed gets updated every few seconds. Our smart phones are full of apps and other cool things. Knowing this, it’s imperative to figure out a system to bulletproof ourselves against all these distractions.

Some of the ideas along this line would be putting our phones away when you are working, use apps like Freedom to block internet for a certain period of time, block hours in your daily routine when you do not want to be disturbed by others, keep only those foods in the fridge that is good for your health etc.

  • Eliminate Unnecessary Decisions

    Our brain is our the most important resource and we need it protect it.As Baumeiseter found, every single decision we make during the day dips into our willpower reserves. Therefore, we need to cut down the number of decision we make to a minimum, and focus on the ones that truly matters. President Obama once said, “I don’t want to make decisions about what I’m eating or wearing because I have too many other decisions to make.

This is why all the famous people like Steve Jobs, Mark Zuckerberg and many othe prefer to wear the the same outfit, eat the same breakfast and lunch every single day.

  • Create Power Habits, Rituals, Routines

    Creating rituals is a great way to remove needless decision-making from your day. Once something has been turned into a habit, you don’t even have to think about it. You do it without using any of your willpower. Each step of the ritual is carefully choreographed for optimal results, yet it requires no willpower on my part because it’s engrained in my ritual. You can read my other post on this related topic here.

  • Hack your Mind- 5 Minute Rule

    One of our mind’s greatest flaws is that it often struggles to get things started. But once we’re in flow, it’s easy to keep going.

    If you’re struggling to get started on some work you have to do, or to start your daily meditation/workout, make the following deal with yourself: you’ll do it for just 5 minutes.

    Answer one email. Run 1 time around your block. Meditate for 5 minutes.

    From personal experience and discussing it with others, I’ve found that 80 to 90% of the time, once we’re in motion, we end up continuing well past the 5-minute mark we had decided on.

  • Go for 100% Commitment

    Jack Canfield, author of the book Chicken Soup for the Soul famously said “99% is a bitch, 100% is a breeze.

    If you really want to do something, commit to it 100%.

    If you’re just sorta-committed, there’ll always be a little voice in your head saying “aahh, maybe today I’ll take the day off“. You’ll waste a lot of willpower fighting off that little voice.

    But the moment have you that 100% commitment, the game becomes easy. You don’t have to think about it… you just do it!




IRC is Back

Internet Relay Chat (IRC) is a protocol, created in 1988, and was meant to help facilitate group discussions, via various channels. The channels served to identify different discussion topics you could pop in on. In the 90’s, IRC chat was world changing and career-influencing. However, I was too young to enjoy its flavor back then, but there is no doubt that it showed the developers the potential of the Internet as a globally-connecting venue for meaningful cultural collaboration and connections. Over the time, IRC has lost 60 percent of its users, going from 1 million in 2003 to about 400,000 today. And IRC channels? In 2003 there were 500,000; now there is half that number. This is due in large part to the advent of the Web, social media, and tools that can do a lot more than plain text can do. 

But here is the thing. I’ve noticed in the last couple of years is a resurgence in using IRC as a primary means of communication, especially for open source projects. I hear about IRC all the time in the geek world. I asked on Twitter and Facebook if people use it and, sure enough, the open-source and developer crowd shot right back that it is still their chat world of choice. While there have been group-based services for a while (Skype, Campfire, Google Hangouts, etc.), the relatively open nature of IRC makes it easy for large groups of people to hop on a channel and collaborate easily.

So you want to get into this “IRC thing”. That’s actually a good thing because to be honest, a LOT of great discussions are happening on there and in some cases, going to a channel is the only way to get any decent support, especially for some open source efforts. I did some research on it lately and findings are amazing. Read on..

Right Network

IRC works by using some type of client that connects you to an IRC network. The networks are just machines that are setup to allow users to connect to IRC. There are a number of networks out there, and most are targeted to specific interests. According to, the major networks are as follows:

  • EFNet
  • Freenode
  • Dalnet
  • Undernet
  • Quakenet

While QuakeNet targets video game players – especially Quakeworld players, Freenode is rightfully one of the best development platforms. Here’s how the Freenode network describes itself:

“An IRC network providing discussion facilities for the Free and Open Source Software communities, not-for-profit organizations, and related communities.”

And with open source software so vitally important today to just about every major web property, it makes perfect sense why so many of the popular development channels are on Freenode. Wikipedia lists it as the largest of the major networks, with approximately 85k users on it at peak hours.


Specific networks have specific channels for specific topics. By joining a channel, you’re choosing to jump into a discussion group about a specific topic. The discussion is typically free-form so don’t expect to go into a threaded UX with everything tightly organized or hierarchical. In fact, depending on the number of users in the channel and how active they are, discussions can be challenging to piece together. You’ll typically participate in group chats, but IRC does support 1 to 1 private chats as well, along with the ability to transfer files. As always, safe Internet practices are essential. Chances are high that you DON’T know the person on the other end of the wire; so you need to be careful when accepting anything from anyone.

Developer Channels

I recently asked senior developers in Twitter and Quora about channels that developers are using and I got some nice feedback. The following list is a little long, but I think worth posting since the channels are incredibly useful:

  • #html5
  • #gruntjs
  • #yeoman
  • ##javascript
  • #jquery
  • #angularjs
  • #requirejs
  • #node.js
  • #css
  • #httpd
  • #webgl
  • #webrtc

This is NOT an all-encompassing list of every awesome web development channel so if you think there are others that would be useful, drop them in the comments section.

The hash (“#”) in front of the channel is purposeful and meant to identify channels that are available across a whole network.

Getting Connected

  • Windows – HexChat, mIRC
  • OSX – Colloquy, LimeChat
  • Browser Based- Just hop on over to Freenode’s Web Chat if you do not want to install any software.

Useful Commands

  • /who <nick> – This allows you to get more information about someone in a channel.
  • /list – This will return a list of all channels available on a network.
  • /join – This allows you to join a channel via the Freenode command line. Remember to prefix the channel name with a hash (“#”)
  • /msg – This allows you to have a private chat with the person whose nick you’ve specified and will send them the message to kick off the chat
  • /invite – This allows you to invite a user to another channel for a chat
  • /away – Tells users that you’re away from your PC for a bit
  • /quit – Tells the network you’re done and are leaving

Stay Safe

I can’t stress enough that IRC offers no anonymity. Don’t assume anything you say is private and can’t be seen (unless you’ve gone to great lengths to anonymize yourself). Conversations can be logged and in fact, most IRC clients have that feature built-in. Your IP address is also easily visible by simply using the “/who” command.

  • Don’t accept file transfers
  • Don’t accept direct connection requests (you’re bypassing the IRC server and directly connecting to another computer)
  • Don’t run commands that someone tells you to run
  • Don’t run scripts that someone has sent you. You can get backdoored.

Go through this page for more details.


IRC offers a great opportunity to get developers from across the world together and share a wealth of knowledge. So, if you haven’t yet tried IRC or you’re a veteran that needs to re-grease the wheels, IRC is back and ready for you.

LAMP vs MEAN vs Whatever

It was only a few years ago that MongoDB, Express.js, AngularJS, and Node.js were raising eyebrows on their own. Now they’ve grown up and ganged up, and together they’re doing some really serious work, poaching no small number of developers from the vast LAMP camp. But how exactly does this newfangled MEAN thing stack up against LAMP? When is it better to choose the well-tested, mature LAMP over this upstart collection of JavaScript-centric technologies? These are few of the questions I am going to try to answer today.

LAMP stack

As we all know, LAMP stands for Linux, Apache, MySQL and PHP/Python. It has been popular for a long time, which means there are tons of tutorials and stack overflow posts that you can reference if you get stuck. Even the worst hosting services generally support it.It has time-tested tools like PHP Admin and powerful CMS tools like WordPress and Drupal. By combining a Web server (Apache), dynamic components (using Perl, Python or PHP), and a database (MySQL) you can create a truly database-driven and dynamic Web site that is easy to update and provides rich functionality to support users.

MEAN Stack

MEAN stands for MongoDB, ExpressJS, AngularJS, and Node.js. Here, Linux operating system is replaced with any operating system that Node.js can run on. This includes MS Windows, Mac OS, and Linux.
The Apache web server is replaced with the Node.js.
The MySQL is replaced with MongoDB, which is a No-SQL database that frees you from having to micromanage migrations and schemas.
The PHP server side programming language is replaced with the ExpressJS, which basically provides a thin layer of features over Node.js.
Note that ExpressJS and Node.js in combination are tools to run JavaScript on the server side.

Why MEAN took my heart away..

Below I have listed the primary reasons to choose MEAN over LAMP.

  • Javascript and only Javascript

    In the last decade, the JavaScript was, and still is, a mainstream scripting language that runs on the client side (browser) and makes web pages dynamic and responsive. The MEAN stack keep using the JavaScript on the client side by introducing the powerful client side Javascript framework (AngularJS) which makes it easier to build modern Single Page Apps. As you might notice, there is no programming language to be used with the MEAN stack other than the JavaScript. Using the same language on both ends make lives simpler for developers.

  • MongoDB is built for the cloud

    This modern database comes equipped with automatic sharding and full cluster support, right out of the box. Plug in MongoDB and it spreads across your cluster of servers to offer failover support and automatic replication. Given the ease with which apps can be developed, tested, and hosted in the cloud, there’s little reason not to consider MongoDB for your next project.

  • MySQL’s structure is confining

    Like all relational databases, MySQL forces you to push your data into tables. This isn’t a problem if every single entry fits into exactly the same format, but what if two people share the same address but not the same account? What if you want to have three lines to the address instead of two? MongoDB, on the other hand, offers a document structure that is far more flexible.

  • Node.js simplifies the server layer

    Want to change how your app routes requests? Sprinkle in some JavaScript and let Node.js do the rest. Want to change the logic used to answer queries? Use JavaScript there as well. If you want to rewrite URLs or construct an odd mapping, it’s also in JavaScript. The MEAN stack’s reliance on Node.js put this kind of pipework all in one place, all in one language, all in one pile of logic. You don’t need to reread the man pages for PHP, Apache, and whatever else you add to the stack. While the LAMP generation has different config files for everything, Node.js avoids that issue altogether.

  • MEAN makes code isomorphic

    The simplicity doesn’t stop with using JavaScript on the server. By going MEAN, you can enjoy that same JavaScript on the client, too, leaving behind the LAMP stack’s client/server schizophrenia. If you write code for Node and decide it’s better placed in AngularJS, you can move it over with ease, and it’s almost certain to run the same way. This flexibility makes programming MEAN-based apps significantly easier. Plus, if you’re staffing up a project, you don’t need to look for a PHP expert and a JavaScript expert, or a front-end and a back-end specialist. Instead, it’s all JavaScript across the stack.

  • JSON everywhere

    AngularJS and MongoDB both speak JSON, as do Node.js and Express.js. The data flows neatly among all the layers without rewriting or reformatting. MySQL’s native format for answering queries is, well, all its own. Yes, PHP already has the code to import MySQL data and make it easy to process in PHP, but that doesn’t help the client layer. This may be a bit minor to seasoned LAMP veterans because there are so many well-tested libraries that convert the data easily, but it all seems a bit inefficient and confusing. MEAN uses the same JSON format for data everywhere, which makes it simpler and saves time reformatting as it passes through each layer.

  • Node.js is superfast

    Apache was great, but these days, Node.js is often flat-out faster. A number of benchmarks show that Node.js offers better performance, while doing much more.

  • AngularJS is fresh

    It’s not exactly fair to compare the “A” in “MEAN” with anything in the LAMP stack because LAMP doesn’t include an analog. If you want to do anything on the client side, you’re on your own. Sure, there are plenty of good PHP-based frameworks that work with MySQL, but each is a bit different and moving in its own direction. WordPress, Joomla, and Drupal, for example, offer differing strategies, and it’s hard to switch between them, let alone port code from one to the other. Anointing one client framework adds consistency and stability.

    It also helps that AngularJS was built by folks with 20 years of experience building Web apps. They knew well enough to leave the design work to HTML and CSS. They also figured out how to add a bit of JavaScript to scan the HTML. The designers of AngularJS looked at what humans do well, then tailored the JavaScript to support the humans.

In Conclusion,

Of course, if you’re really picky, there’s no reason why you can’t mix it up a bit. Plenty of developers use MongoDB with Apache and PHP, and others prefer to use MySQL with Node.js. AngularJS works quite well with any server, even one running PHP to deliver data from MySQL. You don’t have to be a slave to the acronyms.


Success vs Failure

“Success” and “Failure” are two of my most favorite terms of all times. I have been dealing with these two since very early age and I am sure it is true for most of you as well. But have you wondered what exactly these two terms mean and how they define our lives – our happiness, health and wealth?

In short, whatever you do in life, there is a final result for it. Success and Failure! When you do something, you have an intention of achieving, completing or changing a thing. The Real-Life form of those expectations are called Success. And when things opposite or unexpected happens, that’s a fail and it becomes what we call — A Failure!

The sweetest victory is the one that’s most difficult. The one that requires you to reach down deep inside, to fight with everything you’ve got, to be willing to leave everything out there on the battlefield—without knowing, until that do-or-die moment, if your heroic effort will be enough. Society doesn’t reward defeat, and you won’t find many failures documented in history books.

Diving deep into ‘Failure’

Dreams strengthens you and Fear weakens you. When you have strength to do things, you’ll be more hard and smart working. But when you’re afraid, that means you’ll be afraid to move closer to success too. The more hard working you are, the more chances of success getting hit to you and the more afraid you are, the more chances of you failing again and again. So, you’ll live just like an ordinary person if both dreams and fear hit you on the same time. You won’t be having any success nor failure. You seriously don’t want a life like that, right? Well, I don’t!

When we take a closer look at the great thinkers throughout history, a willingness to take on failure isn’t a new or extraordinary thought at all. From the likes of Augustine, Darwin and Freud to the business mavericks and sports legends of today, failure is as powerful a tool as any in reaching great success. But sadly, today’s conservative corporate cultures, don’t want to go there.

“Instead they choose to play it safe, to fly below the radar, repeating the same safe choices over and over again. They operate under the belief that if they make no waves, they attract no attention; no one will yell at them for failing because they generally never attempt anything great at which they could possibly fail (or succeed).” – Ralph Heath

Things to avoid

Many times when I see a roadblock ahead of me or it feels like a failure, I tend to avoid doing certain things

  • Laziness
  • Distractions
  • Thinking that I will do things later
  • Stay depressed for long
  • Criticize myself
  • And finally giving up !!

There is always a ‘tomorrow’ and we don’t know what is in there for us. But instead of being hopeful, we end up imagining the worst possible situations. One of my  most favorite quotes that has been proven true many times in my life is below

“You can’t connect the dots looking forward you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your future. You have to trust in something: your gut, destiny, life, karma, whatever. Because believing that the dots will connect down the road will give you the confidence to follow your heart, even when it leads you off the well worn path.”  – Steve Jobs

The Truth

The truth is that you usually have to fail to succeed. No one emerges at the top. Even those born lucky eventually get a turn on the wheel of misfortune. Anyone with a resume of accomplishments also has a resume of failures, humiliations and setbacks. Jobs was fired by the company he co-founded. Yet it was during this period of exile that he picked up a little computer graphics company later called Pixar Animation Studios, the sale of which made him a billionaire. I can go on.

This is to say, to fail is human. To resurrect oneself is an act of courage.

To Conclude

  • Focus on what you can do best at this moment. When we start to look too far into the future then any task or project can seem close to impossible. And so we shut down because we become overwhelmed and start surfing the internet aimlessly instead.
  • Be an optimist for today and believe that everything will work out just fine.
  • Be persistent and never give up. You never know how close you are to reach your goal.Our mind probably has a reasonable time-frame for success. This might not correspond to a realistic time-frame though.
  • Remember, most troubles never happen. Most things you fear will happen never happen. They are just monsters in our own mind. And if they happen then they will most often not be as painful or bad as you expected. Worrying is most often just a waste of time.

This is of course easy to say. But if you think back and remind yourself of how little of what you feared throughout your life that has actually happened you can start to release more and more worry from your thoughts. I know it because I have done it.

This makes it a lot easier to start doing more of what we really want in life. And to move through our day to day life with a lighter, happier and more optimistic attitude.

Good luck for tomorrow.

The Tale of a Full Stack Developer

Full Stack? Excuse me, what?

The term full-stack means developers who are comfortable working with both back-end and front-end technologies.

A full stack developer is capable of performing tasks at any level of the technical stack in which they reside. It means:

  • Working with systems infrastructure (knowing what hardware to ask for , what OS to install, how to prepare the system and dependencies for all software)
  • Understanding, creating, manipulating, and querying databases
  • API / back-end code in one or more languages, e.g. Ruby, Java, Python, etc.
  • Front-end code in one or more languages, e.g. HTML, JavaScript, CSS etc.
  • Project management / client work, e.g. gathering requirements, creating technical specifications and architecture documents, creating good documentation, managing a project timeline (e.g., someone who knows Agile/SCRUM).

However, the developer doesn’t need to master all of the areas and technologies he needs to work on, because that just makes it nearly impossible, he just needs to be comfortable working with those technologies, and that’s a lot too.

Full Stack – Back in 2000 and Now

2000 was a long time ago, in that year PHP 4.0 was released. Yes, 4.0. Back then, a good web developer knew a little HTML, CSS and some procedural PHP, because proper OOP didn’t even exist until version 5.0.

The LAMP (Linux – Apache – MySQL – Perl/PHP) stack was all the rage in those years, with little or no alternative. In the early 2000s if somebody used version control they were considered either technological heretics or wizards. Today it’s unheard of and laughed at, not using one.

So, let’s try to break down and categorize the main technology stacks that are required from a full-stack developer today:

System Adminstration

  1. Linux and basic shell scripting
  2. Cloud computing: Amazon, Rackspace, etc.
  3. Background processing: Gearman, Redis
  4. Search: Elasticsearch, Sphinx, Solr
  5. Caching: Varnish, Memcached, APC / OpCache
  6. Monitoring: Nagios

Web development tools

  1. Version control: Git, Mercurial, SVN
  2. Virtualization: VirtualBox, Vagrant, Docker

Back-end technology

  1. Web servers: Apache, Nginx
  2. Programming language: PHP, NodeJS, Ruby
  3. Database: MySQL, MongoDB, SQL / JSON in general

Front-end technology

  1. HTML / HTML5: Semantic web
  2. CSS / CSS3: LESS, SASS, Media Queries
  3. JavaScript: jQuery, AngularJS, Knockout, etc.
  4. Compatibility quirks across browsers
  5. Responsive design
  6. AJAX, JSON, XML, WebSocket


  1. Converting website design into front-end code
  2. UI
  3. UX

With many of the mentioned technologies a developer can get away with not knowing to code or use, such as Ruby or specific JavaScript libraries, but all these are interconnected in one way or another. For example if you want to set up Vagrant you need to know Ruby’s syntax, as simplified as it is or if you want to manipulate DOM elements, jQuery is a good to know technology.

One other category that deserves mentioning is mobile technologies. It’s a very dynamic industry and closely related to web development:

  1. iOS
  2. Android
  3. Hybrid: PhoneGap, Appcelerator

A full-stack developer should know about these technologies as well.

Wow, then should I even try to become a Full Stack Developer after all?

I consider a great full-stack developer to be someone who is good at lot of things but great at some. I’d wager that there are zero individuals with advanced-level knowledge in each of these areas that would be capable of single-handedly delivering this next generation kind of application. Just keeping up with the advancements and new programming interfaces in each category is almost a full-time job. So, I would rather advise you to pick your eco system and become an expert in it, but don’t try to be everything to everyone or you will burn yourself out. There are a lot of great stacks available  and you must learn one of them thoroughly.  In order to “have a deep understanding of all areas” you must begin with a deep understanding of just one area.  Only then should you expand.

Future of Full Stack

Whether you choose to specialize in front end or back end development — or position yourself as a full stack generalist — the job outlook is positive. The role of software developer is recognized by the U.S. Bureau of Labor Statistics as one of the occupations that will have the most growth over the next ten years. In 2014, just over 718,000 people were employed in some capacity as software developers — and the nationwide median salary was $95,510. That number is expected to rise by 135,000 jobs to more than 853,000 by 2024.

So, Good Luck and let me know your thoughts.


Learning Better From Cognitive Science

From many of my earlier posts, you might have already figured out atleast one fact about me, that is, I am addicted to productivity and in order to achieve the highest level of productivity, I read a lot about cognitive science. Learning about how our brain and mind work together as a team has become one of my hobbies since many days now.

So this post is about a book that I just finished reading. The title of the book is Why Don’t Students Like School?  The author Daniel Willingham is a Harvard educated cognitive scientist who writes books and articles about how to learn and teach better. The book is divided into principles of learning and I highly recommend getting a copy for yourself as Willingham explains many of the details and implications of each of these principles. I wanted to discuss each principle briefly, to share the implications it has for learning better.

Note: The book lists nine principles, but two were more related to teaching, so I omitted them here.

1. Factual knowledge precedes skill

Einstein was wrong. Knowledge is more important than imagination, because knowledge is what allows us to imagine. There is considerable research showing the importance of background knowledge to how well we learn. Without background knowledge, the kinds of insights Einstein praised are impossible.

Careful studies show that having more background knowledge on a topic means we can read faster, understand more when we do and remember more of it later. You cannot teach someone “how” to think, without first teaching them a considerable amount of “what” to think. Thinking well first requires knowing a lot of stuff, and there’s no way around it.

2. Memory is the residue of thought

You remember what you think about. Whatever aspect of what you’re learning your mind dwells on, will be the part that it is likely to be retained. If you, inadvertently, spend your studying time thinking about the wrong aspects of your studies you won’t remember much of use.

The problem with this principle is that knowing about it is not enough. We can’t constantly self-monitor our own cognition, noticing what we’re noticing. So even if you try to pay attention to the right things, it can be easy to accidentally focus on less important details which will take precedence in memory. There are many techniques like taking side notes, highlighting, using analogies that you can follow to avoid this trap.

3. We understand new things in the context of what we already know

Abstract subjects like math, physics, finance or law, can often be hard for people to learn. The reason why is that the we learn things by their relation to other things we already know. Willingham here suggests using many examples to ground a particular abstraction in concrete terms before moving on.

4. Proficiency requires practice

The only way to become good at skills is to practice them. Additionally, some basic skills require thorough practice in order to be successful at more complicated skills.

I cant stress enough on this point. Practice can be the one gap you have to close between yourself and your goals (Choose to close it). It can be the one impediment that can hold you back and leave you wondering why others are so much better at that something for which you pine (Don’t allow it). It can make the difference between good and great, mediocre and magnificent(Go for the latter).

5. Cognition is fundamentally different early and late in training

Should you learn science like a scientist, making hypothesis, testing experiments, revising your theory to fit the data? Willingham offers substantial evidence that the answer is no.

I think there’s merit in understanding how scientists perform their work, but it’s also clear that knowledge creation and knowledge acquisition are very different. Because they are different, the learner needs to weigh them against each other. For most disciplines, understanding scientific facts is more important than scientific process, for the simple reason that scientific facts will inform our lives, but few of us will ever do scientific research. The same applies to history, philosophy and nearly any other discipline of knowledge.

6. People are more alike than different in how we learn

Learning styles are bunk. There is no such thing as visual, auditory or kinesthetic learners. This is also true for every serious theory of different cognitive styles for learning.

This suggests that the ways we learn are more similar than different. Some people might be better at learning certain types of things than others, but given a particular subject, science hasn’t different ways of learning it that are consistently better for some people but not others.

7. Intelligence can be changed through sustained hard work

This was probably my favorite part of the entire book because it validates much of how I think. Intelligence is partially genetic and partially environmental. Innate differences do matter and some people are born with more talent than others.

However, Willingham argues that intelligence is malleable. Psychologists used to believe that intelligence was mostly genes. Twin studies and other natural experiments seemed to bear that out. Adopted children turn out more like their biological parents than their adoptive parents in many dimensions.

However, now the consensus has turned far more towards nurture, rather than nature. One of the biggest pieces of evidence is the Flynn Effect, which is the observation that people, over the last century, have gotten smarter (and the effect is too large to be from natural selection). Genes may have an important role in intelligence, but most of that role is played out through the environment, not independent of it.


Definitely go and read this book. Its a very easy read, full of scientific data and research and it will answer a lot of questions about learning that you might have. I was happy that most of the principles discussed in the book reflected my own thinking. It’s comforting to see when the experience I’ve gained from my own learning challenges converges on the serious work scientists are doing to understand the brain and how we learn.

Why Prototypal Inheritance Matters?

Prototype-based programming is a style of object-oriented programming in which behaviour reuse (known as inheritance) is performed via a process of cloning existing objects that serve as prototypes. This model can also be known as prototypal, prototype-oriented, classless, or instance-based programming. Delegation is the language feature that supports prototype-based programming.

Problem with classical Inheritance:

Most JavaScript programmers will tell you that classical inheritance is bad. However only a handful of them really know why. The truth is that classical inheritance is not bad. Python has classical inheritance and it’s a great programming language. Nevertheless classical inheritance is not suitable for JavaScript. Python got classes right. They are simply factory functions. In JavaScript however any function can be used as a constructor.

The problem with JavaScript is that since any function can be used as a constructor we need to distinguish a normal function call from a constructor function call; and this is achieved using the new keyword. However, this breaks functional features in JavaScript since new is a keyword, not a function. Hence functional features can’t be used in conjunction with object instantiation.

Classical vs Prototypal:

In prototypal inheritance, instances inherit from other instances. Using delegate prototypes (setting the prototype of one instance to refer to an examplar object), it’s literally Objects Linking to Other Objects, or OLOO, as Kyle Simpson calls it. Using concatenative inheritance, you just copy properties from an exemplar object to a new instance.

It’s really important that we understand these differences. Class inheritance by virtue of its mechanisms create class hierarchies as a side-effect of sub-class creation. Those hierarchies lead to arthritic code (hard to change) and brittleness (easy to break due to rippling side-effects when you modify base classes).

Prototypal inheritance does not necessarily create similar hierarchies. I recommend that you keep prototype chains as shallow as possible. It’s easy to flatten many prototypes together to form a single delegate prototype.

Understanding Prototypal Inheritance:

Prototypal inheritance is simple. In prototypal languages you only have objects. No classes. There are two ways to create new objects – ex nihilo (“out of nothing”) object creation or through cloning an existing object. In JavaScript the Object.create function (discovered by Douglas Crockford) is used to create new objects. Newly created objects are then extended with new properties.

Inheritance and the _proto_

When an object rabbit inherits from another object animal, in JavaScript that means that there is a special property rabbit.__proto__ = animal

When a rabbit property is accessed, and the interpreter can’t find it in rabbit, it follows the__proto__ link and searches in animal.

  1. var animal= { eats: true }
  2. var rabbit = { jumps: true }
  3. rabbit._proto_ = animal     //inherit
  4. alert (rabbit.eats)                  //true

The eats property is actually taken from animal. Here’s the picture: 

If the property is found in rabbit, then __proto__ is not checked.

For example, when eats is in the child object, parent is ignored:

  1.  var animal= { eats: true }
  2. var fedUpRabbit = { eats: false }
  3. fedUpRabbit._proto_ = animal     //inherit
  4. alert (fedUpRabbit.eats)                  //false

One could put a method into animal and it becomes available in rabbit:

  1. var animal = {
  2.       eat: function() {
  3.            alert( “I’m full” )
  4.            this.full = true
  5.     }
  6.  }
  7. var rabbit = {
  8.      jump: function() { /* something */ }
  9. }
  10. rabbit.__proto__ = animal

The is executed in two steps:

  1. First, the interpreter looks up There’s no eat in rabbit object, so it goes torabbit.__proto__ and finds it there.

  2. The function runs with this = rabbit.The value of this is completely irrelevant to __proto__. It is set exactly to the object before the dot (see more about thishere).So, this.full = true stores the value in the rabbit object:

Look what we’ve got. An object calls parent method, but this is set to the object itself. That’s the inheritance.The object, referenced by __proto__ is called a prototype. So, animal is a prototype of rabbit.

Object.create (proto[,props])

Creates an empty object with given __proto__

  1. var animal ={ eats: true }
  2. rabbit= Object.create(animal)
  3. alert (rabbit.eats)                   //true

The code above creates empty rabbit with animal __proto__:

Once the rabbit is created, we can add properties to it.


Returns the value of obj.__proto__. The method is standard, so it works in browsers which don’t support __proto__ property.

The prototype

Remember, any function creates an object when called with new. A new function call sets the __proto__ of the object to the value of its prototype property.

  1. var animal = { eats: true }
  2. function Rabbit (name) {
  3. = name
  4. }
  5. Rabbit. prototype = animal
  6. var rabbit = new Rabbit (‘John’)
  7. alert (rabbit.eats)                // true because rabbit. _proto_ == animal

The code Rabbit.prototype = animal literally means the following:
”set __proto__ = animal for all objects created by new Rabbit.


All objects have hasOwnProperty method which allows to check if a property belongs to the object or its prototype.


It is essential to understand the prototypal inheritance model before writing complex code that makes use of it. Also, be aware of the length of the prototype chains in your code and break them up if necessary to avoid possible performance problems. Further, the native prototypes should never be extended unless it is for the sake of compatibility with newer JavaScript features.