How to master a language inside out?

If you’re a newbie coder and slightly struggling with programming, don’t fret too much! Coding can be slightly taxing at first, especially when you are new to it. But once you make sure that you give it enough time and work, you’ll love it!

So, let’s face it, you want to learn a language, and there are so many ways you can do that, but the question is how can you really master a language? “Master” is a heavy word, but today all those bigwigs are actually looking for expertise coders. Besides, programming can be really stressful if you don’t approach it with a right mindset and attitude.

So, here are 7 ways to master a language inside out:-

1. DON’T DO IT IN ONE NIGHT

The idea of learning a skill overnight is exhilarating, yes! and being so used to those “all nighters” for college examinations can make us think that that’s the only way to study, but NO, trying to cram programming overnight can be a big mistake.

One needs to take it one session at a time, giving every session ample amount of time and using it more practically than mugging up the theory.

2. ENROLL IN A COURSE

Of course! What’s better than enrolling yourself in a course where you have amazing mentors to guide you, newbies like yourself to get along with, and TA’s to assist you through every step. An environment of healthy competition and learning in a group will not only keep you highly motivated, but you’ll also learn at your own pace.

Register for our courses  here!

For all those who are too lazy to get out from their houses(it’s the heat, we don’t blame you!) or people who live too far from our center, we have this awesome option for you, ONLINE COURSES! with amazing features like adaptive learning, individual TA support, and lots more! (A little bit of promotion never killed anyone!)

3. PRACTICE! PRACTICE! PRACTICE!

Well, who doesn’t get a hard time from the semicolon and the brackets?! If you don’t have any prior coding experience, the number of syntax rules in any coding language can make your head go for a spin. The best approach to this is practice, one needs to practice a lot of questions and over a period of time, those silly syntax rules will come naturally to you.

One needs to take practice seriously, solving a lot of questions will definitely build your expertise in the field and your approach to solving questions will develop, turning you into a Code Genin.

4. IF YOU CAN’T EXPLAIN IT, YOU SIMPLY DON’T UNDERSTAND WELL ENOUGH

A very interesting approach to learning anything is the Feynman approach, based on the great physicist Richard Feynman who believed that the best way to grasp something is by breaking it into simpler concepts and teaching it to someone.

Explaining things to someone else will help you analyse your weak areas and will definitely solidify the concepts in your mind. It will help diagnose the weaker niches and compel you to learn things better from a newer angle.

5. JOIN COMPETITIVE PROGRAMMING

One sure wants that edge when they’re learning the language, don’t they?  To get that extra panache in your coding realms, one must start with competitive programming. Competitive programming is a mind sport taking place in particular forum involving participants to program according to provided specifications.

Competitive programming will allow you to code under tight specifications. This will strain you brain to think under constraints, increasing your skills exponentially! Also, coding in an environment of healthy competition will keep you glued to it.

Join the world of competitive programming at CodeZen, Stand out in the leaderboard and win amazing cash prizes!

6. PLAY WITH PROJECTS

Once you’re comfortable with the language, syntax and the concept, it’s time to put those skills in to use! For absolute newbies, think of  a simple game like Tic-Tac-Toe, Othello, to head start with your skills. Building even a small project will not only build your confidence but you’ll know exactly how to apply your newly acquired knowledge actively.

Be creative! Code something that interests you or what you’d actually want to use. Projects will help you retain a lot better and will interest you at a very personal level.

7. DON’T PANIC!

Relax! It’s not you, it’s programming.

Programming can be a little intimidating and it’s okay to struggle with it. The important thing is to keep yourself on track and keep trying. Ask help when you need it, try different resources and keep recalling previous concepts. Give it a little time, and it will surely come your way.

Embrace your bugs and errors. Learn how to debug and avoid them in future. Practicing can help you build confidence, and that will keep you away from stress.

Recursion (The Good, the Bad and the not so Ugly)

Recursion is a topic most beginner programmers fear and when you get the hang of it, it works like magic (Congrats! Not a noob anymore). When someone introduces recursion, they say it’s basically a function which calls back itself, and your brain goes like WHAAAAAT??

So here’s this GIF which not only gives you a complete mindfuck but also a visual description of what recursion is. Too scary huh? Well, not really. Once, you get an idea of how recursion works and  which base case to work with, it runs smooth as ice. Sometimes, you won’t even be able to fathom how your code worked when it did.
Well, the mantra for recursion is ” Let recursion do the work for you”.

THE GOOD

1. For all those people who want to make their code look pretty as a picture, recursion is the best way to do that. Recursion makes a code more compact, readable and so very elegant.
2. If you can master recursion, it can turn out to be your best friend. Solutions using recursion are easier to strike and code. It also avoids redundancy of code, and your codes are easier to read and maintain.
stackbuddies

3. Three magic words: tail call optimization: Some functional languages implement this wizardry. So basically, what happens is, if a function’s return expression is a result of a function call, the stack frame is reused instead of pushing a new stack frame in the call stack. Sadly, only a few imperative languages have this wizardry.

 

The secret magic of tail call

THE BAD

A lot of programmers avoid using recursion and believe that it is less efficient than it’s iterative counterparts.

 1. Recursion can lead to the perils of stack overflow. To understand better, let’s look at the steps for functions call:-
  •  space is carved out on the stack for function arguments and variables.
  •  arguments are copied into this new space
  • control jumps to the function
  • function code runs
  • function results are copied into the new value
  • stack rewounds to its previous position
  • control jumps back to the caller
Mostly, all of these steps consume more time than their iterative counterparts. Therefore, recursive methods are relatively less efficient in those cases.
recursionagain
2. More importantly, when most programs start, they allocate a single chunk of memory to the stack, if that memory is used, the entire program crashes due to stack overflow.
3. Each function call eats up a lot of space. That amount of space isn’t recovered until the function returns. Iterative methods do not suffer from such problems.
r_219071_tbWYT