Why you should do Competitive Programming, even if a little

Avi Aryan on October 06, 2018

First posted on Dev Letters I first started Competitive Programming (CP) in the first year of undergrad college. I should have started soone... [Read Full]
markdown guide
 

Hi Avi,

I agree with many of your points. Here are my thoughts on the same:

  1. Competitive coding improves one kind of thinking namely that of formulating algorithms where the problem statement is static. Most business tasks are more of getting data from multiple sources, combining them according to domain specific rules and handling various types of failure cases. Competitive programming does not help in this case.
  2. One plus about learning competitive coding is that you learn the standard library of your language very well in order to complete some tasks with minimal fuss. It also makes you dig deeper into the documentation to see why a particular function or structure is slow.
  3. It is one way of improving your perseverance. Coding is all about learning from failure. Trying repeatedly to pass the question hardens you to compile and runtime errors and improves your debugging skills.
  4. On the flip side, you must be careful about writing 1 letter variables and cryptic functions in production because unlike competitive coding where you are the only consumer of your code, your whole team depends on your code.
 

Agreed! I am not saying Competitive Programming is all you need, but it's something you should have an idea of. Carrying some CP experience into real-world programming helps.

 

Hey, you're the guy that wrote ClipJump! I just started using it a week ago. What a small world!

Anyway, these are great reasons to do competitive coding, or even more laid-back programming challenges. I really like programming challenges since they're great to do when you have some spare time, and there's tons of them! Here's a short, non-exhaustive list:

  • Advent of Code — Fun Christmas-themed challenges every December. Many of the problems are based on famous math and computer science problems. My first foray into programming challenges, and one of my favorites. Hosted by Eric Wastl.
  • Project Euler — Very math oriented. Haven't yet tried this one, personally
  • Synacor Challenge — Another one by Eric Wastl, quest-oriented like Advent of Code, but delves into things like creating virtual machines and more.
  • Exercism — Variety of programming problems and challenges for a plethora of languages and tools. Check out the tracks page, it's huge!

Programming challenges are great exercises, and are a really fun way to get into a new language and try it out, as you don't have to come up with something non-trivial to work on, and will definitely get you to learn the ins and outs of the language and its standard library.

 

Hey, you're the guy that wrote ClipJump! I just started using it a week ago. What a small world!

Haha, I am surprised people still find the need to use it, especially when Windows 10 included a similar feature natively.


I have tried Project Euler for some time, and yup, very math-based. I had to look up theorems for some questions. But it's okay since most of the problems are really elemental, that is, they don't require too much theory knowledge, but just that you need to be smart with math.

 

I think you should add a part on how to get started with competitive programming also :) great post btw

 
 

I'm actually going to do this next week, going for the second year with some buddies to the IEEEXtreme competition. 24 hours of straight problem solving with code.

 
 

I completely disagree with you. I find young coders getting into CP all the time. They are driven by the short term reward cycle that various problem solving sessions have.

"premature optimization is the root of all evil" - Donald Knuth

Writing the kind of code you write in CP is by no means the best possible code. Actual codebase for actual humans should be declarative and simple.

A more wholesome way to learn is to first build your personal portfolio with projects and then moving into open source-- trying to learn from beautiful codebases while trying to contribute yourself.

 

Shoutout to Code Wars ! I think they have a good collection of problems and a good structure of problems to start with.

 

The website looks sick. Will give it a try someday.

 
 

Yeah, big fan of CodeFights. Didn't knew they changed their name. The 1-on-1 fights are a great way to kill your time, very addictive.

 

Agreed.. I started with battle of bot on HackerEarth platform. competition was so much fun to ctraye bot which plays game for you. it increases problem solving and also intrest towards coding.

code of conduct - report abuse