Computer Science Canada

Thoughts on Contests?

Author:  Saad [ Sun Mar 23, 2008 3:47 pm ]
Post subject:  Thoughts on Contests?

Programming Contests, in my opinion are misnamed and make for very bad coders, they are in fact algorithm knowledge contests. The actual code quality is not marked, rather its marked on if it works or not.

Programming contests make for very poor coding habits. This is due to the fact that contests have time limits. To finish in time all the bad coding habits are used:
- Lack of variable names - Contest code always consists of one letter variable names. This leads to a lot of of obfuscated code and only is readable by the writer and for a certain bit of time after which no-one has a clue
- Lack of thought into coding - This again is due to the time limit, we want to just start coding and try to get the program to work which is the exact opposite to what should happen.
- Memorization of Algorithms - Most contests problems are all based on certain algorithms. As a result people start to memorize algorithms since they always show up on contests. However in most situations these algorithms are not used.
You should be able to think outside the box for contests and come up with your own algorithms rather then just regurgitate them.

Also wtd makes a great point located here,
Quote:
As you take part in programming contests, keep in mind that the most important contest is with yourself: to constantly become better than you were before.

The worst programmer in the world would have a perfect formula for winning contests and use it again and again without change.


Now, I'm not saying that contests are bad in any way. However just realise that it leads to bad coding habits which should be avoided.

Comments/Different Opinions/Thoughts?, I want a discussion. Smile



Saad

Author:  Mackie [ Sun Mar 23, 2008 3:57 pm ]
Post subject:  RE:Thoughts on Contests?

I've never taking part in a 'programming contest'. But I think it would be a good experience. I think that humans should mark the code, and only factor in the output when there's a tie.

Author:  zylum [ Sun Mar 23, 2008 3:58 pm ]
Post subject:  RE:Thoughts on Contests?

Quote:
You should be able to think outside the box for contests and come up with your own algorithms rather then just regurgitate them.


I would disagree with this point. Just because one knows how to do dynamic programing and recognizes that the problem they are doing requires dynamic programing, does not mean they simply regurgitate the algorithm... This may be the case for the easier contests such as DWITE, ECOO and CCC to some extent, but for the more recognized and difficult contests, this is not the case. For these, you require a considerable amount of ingenuity and thinking outside of the box.

Author:  Tony [ Sun Mar 23, 2008 5:02 pm ]
Post subject:  RE:Thoughts on Contests?

I'd love to have something more to the contests, but marking 100 submissions by hand is a bit too much. And DWITE is a fairly small contest.

Besides, it would be way too subjective. And it's difficult to compare programs done in different languages.

Although if there are ideas to change DWITE for better, I'd love to hear them as well.

Author:  fishtastic [ Sun Mar 23, 2008 8:47 pm ]
Post subject:  RE:Thoughts on Contests?

I agree with Saad on some points

Programming contests does
-make a habit of using bad variable names
-using inflexible code structure due to time limit
-marked only based on work/not work (0%/100%)

also this years CCC did not have any interesting questions. In my opinion every question is a know it/ not know it questions. So people who memorized algorithms probably did better.

unfortunately there are no other ways of testing people's programming skill that can have a strict marking system. you cant give a 100% fair mark based on how good their code is.

Author:  Saad [ Sun Mar 23, 2008 8:58 pm ]
Post subject:  Re: RE:Thoughts on Contests?

zylum @ Sun Mar 23, 2008 3:58 pm wrote:
Quote:
You should be able to think outside the box for contests and come up with your own algorithms rather then just regurgitate them.


I would disagree with this point. Just because one knows how to do dynamic programing and recognizes that the problem they are doing requires dynamic programing, does not mean they simply regurgitate the algorithm... This may be the case for the easier contests such as DWITE, ECOO and CCC to some extent, but for the more recognized and difficult contests, this is not the case. For these, you require a considerable amount of ingenuity and thinking outside of the box.


I based that point on the contests I've done/seen (which are DWITE, CCC, ECOO, USACO, TopCoder), Top Coder I'd say is a great contest as like you said they do require thinking outside the box, however all the others, I feel have somewhat just the same algorithm (excluding ECOO, since it has some rather interesting questions that don't involve any algorithms discussed normally). However seeing as you've had more experience with contests, I'll agree with you there.

Author:  McKenzie [ Mon Mar 24, 2008 8:45 am ]
Post subject:  Re: Thoughts on Contests?

Computer contests are like so many activities that approximate something else. Boxing is not "real" fighting, debate is not a "real" argument and Computer contests are not "real" programming. There is a game element to programming contests. The fact that certain algorithms are over-represented is a game, that fact that there is no concern for things like the development life-cycle is a game.

Even though boxing is not "real" fighting, I wouldn't want to try my luck with a good boxer in a back alley. Computer Contests may not be real programming but the activity approximates it close enough to say that the guys with the best contest scores are probably great programmers, and that's been my experience as well.

Author:  A.J [ Mon Mar 24, 2008 10:40 am ]
Post subject:  Re: Thoughts on Contests?

Saad, I know that you started this forum as a way to tell me to stop doing contest practice questions.....
but I DON'T memorize algorithms or just use them from my memory.......I actually think.....
but I would agree that most people (including me) have obfuscated code. I also agree that contests usually DON'T define how good a person is. Your programming skills and your level of finesse are defined by your experiences/your knowledge in various subjects/topics. Most people don't just memorize algorithms eventhough it seems like they are. They in fact try to recreate the respective algorithms with every question they tackle.

Author:  Saad [ Mon Mar 24, 2008 11:02 am ]
Post subject:  Re: Thoughts on Contests?

A.J @ Mon Mar 24, 2008 10:40 am wrote:
Saad, I know that you started this forum as a way to tell me to stop doing contest practice questions.....


This topic was not directed towards you, I'm sorry if you thought that. These were rather some thoughts I had and I wanted to see what other had to say.

Author:  A.J [ Mon Mar 24, 2008 11:09 am ]
Post subject:  Re: Thoughts on Contests?

No offense taken Wink
but I still say that people don't just memorize algos.

Author:  CodeMonkey2000 [ Mon Mar 24, 2008 11:22 am ]
Post subject:  RE:Thoughts on Contests?

Meh, I like to do my own thing, as it strengthens the creative process.

Author:  fishtastic [ Mon Mar 24, 2008 12:41 pm ]
Post subject:  Re: Thoughts on Contests?

A.J @ Mon Mar 24, 2008 10:09 am wrote:

but I still say that people don't just memorize algos.

when you do a contest, you DO use (or develop on) the algorithm you memorized.

no one figures out all the algorithms they use by themselves.
what is important is the understanding of algorithm.
you can memorize the algorithm after understanding of it.

Author:  Mackie [ Mon Mar 24, 2008 12:49 pm ]
Post subject:  Re: Thoughts on Contests?

fishtastic @ Mon Mar 24, 2008 12:41 pm wrote:
A.J @ Mon Mar 24, 2008 10:09 am wrote:

but I still say that people don't just memorize algos.

when you do a contest, you DO use (or develop on) the algorithm you memorized.

no one figures out all the algorithms they use by themselves.
what is important is the understanding of algorithm.
you can memorize the algorithm after understanding of it.


I could argue that. While knowing an algorithm could help you do something faster. Coming up with your own algorithm is not only possible, but it happens all the time. How can you claim that no one figures it out on their own? Not saying A.J does, I'm saying some people do.

Author:  A.J [ Mon Mar 24, 2008 1:12 pm ]
Post subject:  Re: Thoughts on Contests?

Mackie wrote:

Not saying A.J does

Hey, what's that supposed to mean Question

anyways, I agree with Mackie. I am not saying that people come up with the algorithms, but I am trying to say that they don't MEMORIZE them. They merely understand them enough to implement it themselves.

Author:  r691175002 [ Mon Mar 24, 2008 3:33 pm ]
Post subject:  RE:Thoughts on Contests?

IMO While programming contests are not at all similar to real coding, they improve your ability to code by a lot.
While yes, they involve writing what boils down to unmaintainable garbage, I have never brought any of my bad habits into real projects. Programming contests are not focused on testing your ability to write pretty code, they are focusing on your logic skills.
Most of the time you don't know all the algorithms by heart, but enough about how to solve similar problem that you have a pretty good idea of how to solve it.

I know for sure that I became a better programmer by learning about algorithms and problem solving. While it may not be something that comes up in everyday programming, when it does it will help a lot. I also found that it gives you a different perspective when approaching problems.

Author:  A.J [ Mon Mar 24, 2008 7:00 pm ]
Post subject:  Re: Thoughts on Contests?

r691175002 wrote:

IMO While programming contests are not at all similar to real coding, they improve your ability to code by a lot.
While yes, they involve writing what boils down to unmaintainable garbage, I have never brought any of my bad habits into real projects. Programming contests are not focused on testing your ability to write pretty code, they are focusing on your logic skills.
Most of the time you don't know all the algorithms by heart, but enough about how to solve similar problem that you have a pretty good idea of how to solve it.

I know for sure that I became a better programmer by learning about algorithms and problem solving. While it may not be something that comes up in everyday programming, when it does it will help a lot. I also found that it gives you a different perspective when approaching problems.

I agree COMPLETELY !
Claping Bravo!Claping

Author:  klopyrev [ Tue Mar 25, 2008 7:32 pm ]
Post subject:  Re: Thoughts on Contests?

Hmm... As someone who's done programming contests quite a lot, I feel that programming contests are a great way to train programming overall. First of all, from programming contests, you learn how to write bug-free code quickly. If you say that you develop bad programming habits from doing programming contests, then I can confidently say that you don't do very well on programming contests. For easy programming problems, like the ones they give on DWITE, you can write bad code and get away with it. However, once you go higher, your code has to be nearly perfect to work. On hard programming contests, your code has to be fast, efficient and get the correct answer. If you write code that has an overall bad structure, you're bound to introduce many bugs into it that will take forever to fix. If you write code that just gets it done, without focusing too much on runtime, it will probably time out. If you write code that's hard to maintain and long, then you will probably waste hours of your time, while everyone else passes you by. From programming contests, I've developed many more good habits than bad habits.

As for memorizing algorithms... If you memorize all the basic algorithms out there, it will help you on programming contests. However, if all you do is use memorized code, you may do well on DWITE or CCC Stage 1, but you'll be completely lost on IOI. You probably won't get more than 1 problem on ACM ICPC.

Hard programming problems come in many different forms. Some of them require you to come up with a unique algorithm. Others require you to find an application of an algorithm that works and prove that it works. There are infinitely many problems that have network flow as solution. When reading most of those, you probably won't even think it has a solution with network flow, unless you're Richard Peng, that is.

Author:  A.J [ Tue Mar 25, 2008 8:23 pm ]
Post subject:  Re: Thoughts on Contests?

True..Richard is WHACK Very Happy!

Author:  CodeMonkey2000 [ Tue Mar 25, 2008 8:42 pm ]
Post subject:  RE:Thoughts on Contests?

I learn a lot more from independent projects. I'm currently learning openGL and plan to have a game with fully functional AI and physics. Within these few months I have leaned so much about graphics and APIs, and how they work. And what I have learned isn't just limited to computer science and graphics, I also now have a greater understanding of physics that we won't cover (ever) in high school (yea physics! Razz). Plus with a personal project, I can be as creative as I want (well...within reason). Contests are okay, but I'm not very competitive, I just like learning. I think contests test your quick wit rather than your innovation and creativity.

Author:  nike52 [ Tue Mar 25, 2008 9:26 pm ]
Post subject:  Re: Thoughts on Contests?

Quote:
Computer contests are like so many activities that approximate something else. Boxing is not "real" fighting, debate is not a "real" argument and Computer contests are not "real" programming.


My thoughts on contests and adding to McKenzie's analogy to describe it. Why learn how to box when you can learn real fighting? I plan to still do contests because they're a great way to improve your real fighting, but not to the point where I deviate from the goal of real fighting and I'm doing contests for the sake of doing them. Why do you want real fighting? You want to be skilled at something that will make you money, becoming a better programmer, not becoming a better programming contest contender. If you want real fighting, getting into open source is better instead, it simulates real fighting, how programming in the real world is like.

A similar discussion.
http://forums.topcoder.com/?module=Thread&threadID=607689&start=0&mc=8
-SRM skills are basically contest skills

'Notice how doing contests will only give you a few of the skills you need.
Quote:
In my own definition, a fresh graduate good/skilled programmer should have the followings:
1. *Strong skill of one or more good languages* like C++, Java and C#.
1. Must have strong skills with control structures. Don?t mess up if you?re asked to print out triangle or other shaped piles of ?x?s with loops.
2. Must have strong skills with recursion. You must know how to transform a looped task into a recursive one and vice versa, for example: multiplication using addition recursively.
3. *If your language is C/C++, you must know how to play with pointers and references.*
4. Understand pass by value and reference.
5. *Clearly understand scopes and memory allocation, de-allocation. Know when a object is destroyed and when to destroy.*
6. *Know the usage of all operators including bit-wise ones.*
2. *In-depth* knowledge of OOP.
1. *Only being able to write classes and doing encapsulation and inheritance is not what you should call good OOP.*
2. *Clearly understand how function overloading, overriding, polymorphism works.*
3. *Clearly understand how constructor/destructor (if any) works with inheritance.*
*4. Clearly know the difference and use of Interfaces and Abstract classes.
5. Know how to overload operators. Why and how copy constructor is defined/used.
3. Know common data structures
1. At least know the common data structures like stack, queue, linked list, doubly linked list (know circular version of all of them) and trees.
2. Be a skilled implementer of any of those, have clear concept of how push, pop, add, delete, peek etc method works on those data structures.
4. Know most common algorithms well
1. You don?t need to memorize pseudo codes line by line but you need to have clear concept of most common algorithms of sorting(bubble, quick, merge, heap, bucket, etc), searching (including DFS, BFS), etc.
2. As a fresher you must know their time and space complexities, pitfalls and improvements (if any).
5. General computing concepts:
1. Know processes and threads, how are they related to each other, how to program them, etc.
2. Understand TCP/IP: Don?t think it?s only the network administrator?s task to understand TCP/IP. All programmers ever doing any network or web programming should have clear TCP/IP concepts and understanding.
6. Be skilled in debugging in IDEs:
1. Be skilled in any or many of Visual Studio/Visual Studio.Net, Eclipse, Netbeans, KDevelop, etc.
2. Know how to debug your code.
7. Have basic knowledge of Software Engineering and SDLC.*
[/quote]

Author:  Mackie [ Tue Mar 25, 2008 10:15 pm ]
Post subject:  Re: RE:Thoughts on Contests?

CodeMonkey2000 @ Tue Mar 25, 2008 8:42 pm wrote:
I learn a lot more from independent projects. I'm currently learning openGL and plan to have a game with fully functional AI and physics. Within these few months I have leaned so much about graphics and APIs, and how they work. And what I have learned isn't just limited to computer science and graphics, I also now have a greater understanding of physics that we won't cover (ever) in high school (yea physics! Razz). Plus with a personal project, I can be as creative as I want (well...within reason). Contests are okay, but I'm not very competitive, I just like learning. I think contests test your quick wit rather than your innovation and creativity.


I completely agree with that point. I have like 6 personal projects going on right now and, form each one I've learned new programming, scientific, or math skills. With personal projects, you've come up with the idea, you have researched and learned everything YOU need to know to get it complete. Not so you can beat the person next to you. Or have some arbitrary number assigned to you. But, because you want to do it. To prove that you can and create something great.

Author:  md [ Tue Mar 25, 2008 10:31 pm ]
Post subject:  RE:Thoughts on Contests?

This is not a contest, therefor I moved it to General Discussion where it belongs.

Incidentally I agree with Saad that *most* contests do not actually encourage good programming habits or teach anyone how to think. Properly designed contests can help mitigate those two issues though.

I might post one after exams are done. Maybe.

Author:  zylum [ Wed Mar 26, 2008 12:17 am ]
Post subject:  Re: Thoughts on Contests?

Quote:
'Notice how doing contests will only give you a few of the skills you need.
Quote:
In my own definition, a fresh graduate good/skilled programmer should have the followings:
1. *Strong skill of one or more good languages* like C++, Java and C#.
1. Must have strong skills with control structures. Don?t mess up if you?re asked to print out triangle or other shaped piles of ?x?s with loops.
2. Must have strong skills with recursion. You must know how to transform a looped task into a recursive one and vice versa, for example: multiplication using addition recursively.
3. *If your language is C/C++, you must know how to play with pointers and references.*
4. Understand pass by value and reference.
5. *Clearly understand scopes and memory allocation, de-allocation. Know when a object is destroyed and when to destroy.*
6. *Know the usage of all operators including bit-wise ones.*
2. *In-depth* knowledge of OOP.
1. *Only being able to write classes and doing encapsulation and inheritance is not what you should call good OOP.*
2. *Clearly understand how function overloading, overriding, polymorphism works.*
3. *Clearly understand how constructor/destructor (if any) works with inheritance.*
*4. Clearly know the difference and use of Interfaces and Abstract classes.
5. Know how to overload operators. Why and how copy constructor is defined/used.
3. Know common data structures
1. At least know the common data structures like stack, queue, linked list, doubly linked list (know circular version of all of them) and trees.
2. Be a skilled implementer of any of those, have clear concept of how push, pop, add, delete, peek etc method works on those data structures.
4. Know most common algorithms well
1. You don?t need to memorize pseudo codes line by line but you need to have clear concept of most common algorithms of sorting(bubble, quick, merge, heap, bucket, etc), searching (including DFS, BFS), etc.
2. As a fresher you must know their time and space complexities, pitfalls and improvements (if any).
5. General computing concepts:
1. Know processes and threads, how are they related to each other, how to program them, etc.
2. Understand TCP/IP: Don?t think it?s only the network administrator?s task to understand TCP/IP. All programmers ever doing any network or web programming should have clear TCP/IP concepts and understanding.
6. Be skilled in debugging in IDEs:
1. Be skilled in any or many of Visual Studio/Visual Studio.Net, Eclipse, Netbeans, KDevelop, etc.
2. Know how to debug your code.
7. Have basic knowledge of Software Engineering and SDLC.*


All of those skills can be learned in two or three intro compsci courses. This would take maybe two semesters and hardly qualifies a person as a good programmer (I do agree thought, that a good programmer must have these skills.) Furthermore, all of these 'skills' are more or less memorized. Two skills missing in this list which, in my opinion, are much more important are problem solving and attention to detail. These are true skills as they can't simply be memorized. To become good at these, it takes years of practice and a good way to practice these skills is by doing programming contests.

Author:  klopyrev [ Wed Mar 26, 2008 5:25 pm ]
Post subject:  Re: Thoughts on Contests?

Becoming a great programmer takes a lot of practice. You can get that practice from work, doing personal projects, etc. You can also get that practice from doing programming contests. However, with programming contests, you also learn a lot about algorithms. You learn how to write code quickly. You learn how to avoid making bugs. You learn how to make code simple. I'm sure you can learn all those things outside of programming contests, but programming contests make learning those things exciting. I got a job for my next Co-Op term only because of my successes in programming contests.

Author:  nike52 [ Wed Mar 26, 2008 7:34 pm ]
Post subject:  Re: Thoughts on Contests?

What do you guys think is the best way to become a better programmer? For now, I plan to get into open source or do a personal project while still doing programming contests. I think the skills they teach complement each other well.

Author:  Nick [ Wed Mar 26, 2008 7:42 pm ]
Post subject:  RE:Thoughts on Contests?

I just pushed myself to do a lot of different projects, even if you don't finish one make sure you take something from it, every project you do has potential to give you a lot of knowledge

Author:  PaulButler [ Wed Mar 26, 2008 8:36 pm ]
Post subject:  RE:Thoughts on Contests?

I think of contests like a sport. If you think about hockey, basketball, or whatever your favorite competitive sport is, it becomes quite arbitrary. For example, hockey is a competition to determine which team is the best at putting a small rubber disk into a net while skating on ice. If it wasn't for the sport of hockey, these particular skills would not be all that useful in real life. The ability to dribble a basketball or swing a bat would be equally worthless when you are not playing basketball or baseball. Likewise, the ability to code a throwaway program that solves a problem you didn't even think about 5 minutes ago is a fairly arbitrary skill.

The reason why sports - and programming competitions - are important, is that behind these arbitrary skills are real skills. In sports, it's the ability to work as a team, think on the spot, and be athletically and mentally fit. In programming competitions, it's the ability to think a problem through to a solution, and consider every possible case without the resources to test the code extensively.

Author:  PaulButler [ Wed Mar 26, 2008 8:50 pm ]
Post subject:  Re: Thoughts on Contests?

nike52 @ Wed Mar 26, 2008 7:34 pm wrote:
What do you guys think is the best way to become a better programmer? For now, I plan to get into open source or do a personal project while still doing programming contests. I think the skills they teach complement each other well.


The skills will definitely complement each other. Working on an open-source project will give you everything that programming competitions don't. When you have other people reading your code and commenting on it, I can't think of a better way to quickly learn the skills of code organization and writing readable, efficient code, which is exactly what competitions don't teach you. Also, building something people are actually using is a great way to keep motivated, even if it is just a simple plug-in or code snippet.

Also, dive into ambitious self-initiated projects. Even if you decide to stop working on it when you realize the scope of the project, researching, designing and writing the code will teach you a ton.

Author:  klopyrev [ Thu Mar 27, 2008 12:10 pm ]
Post subject:  Re: Thoughts on Contests?

However, unlike sports, if programming contests didn't exist, these skills would not be useless.

Author:  PaulButler [ Fri Mar 28, 2008 1:03 pm ]
Post subject:  Re: Thoughts on Contests?

klopyrev @ Thu Mar 27, 2008 12:10 pm wrote:
However, unlike sports, if programming contests didn't exist, these skills would not be useless.


I agree that the skills needed for programming competitions are still useful outside of competitions. I would describe most competitions as writing a throwaway program to do a specific calculation on a certain set of data. This is not an uncommon situation to face outside of a competition. However, I think it is not the specific ability that attracts employers, but the skills that it implies you have - problem solving, quick thinking, etc.


: