Live data from Hacker News

Competitive programming is useless

kislayverma.com

131–140 of 157 posts

Re: Competitive programming is useless

#131

Earlier quoted context omitted.

To me competitive programming doesn't make you a good software engineer. It will teach you bad practices, like abusing of dangerous programming constructs or data structures to optimized the code or just save some typing while writing the code (like one letter variable names, macros, etc), global variables and state in the program, not using common design patterns, not using OOP, not documenting the code and in gener…

Competitive programming doesn't teach you only algorithms and data structures, it teaches you to think very clearly about program flow, edge cases, debugging etc., points which you seem to just gloss over from the comment you're replying to, just to justify a conclusion you had already reached.

definitely, alot of the "algorithms" in leetcode practice look deceptively simple on the surface, but deep down, there are lots of edge cases and are good practice to think deeply about them

on the otherhand, they can also encourage messy and hard to maintain code, or super efficient implementation can be brittle which you dont want in production unless there is a really really good reason...

if "competitive coding" also judge on other criteria such as clarity, readability and maintainability, in addition to efficiency and "correctness" that would be great imo

Re: Competitive programming is useless

#132
post #59

I'm been following competitive programming for years and know multiple extremely successful "grads" of IOI and ACM ICPC. I have an ICPC bronze medal myself. The HN crowd will know Adam D'Angelo (IOI Gold) - cofounder of Quora and Nikolay Durov (IOI ICPC Gold) - cofounder of Telegram. My personal examples are Singlestore (billion dollar company) which I cofounded and Near Protocol - 5Bln market cap crypto company cofo…

A few successful competitive programmers being successful in general doesn't make it a good metric for all programmers. I'd say the same about competitive math too, despite Terry Tao being a pretty great counter example.

What actually happens at all levels below the gold medalist level is completely different. People memorize leetcode and think they're gods of CS. Ultimately, you have to agree, these competitions come down to learning a vast repo of tactics. A guy who is generally good at CS or math can't show up and do well. You have to burn a lot of midnight oil so to speak.

IMO such data structure and algo mastery is largely illusionary. It mainly depends on the trends in the game at that point in time. If you see people who do well in such competitions, they have embedded themselves in these communities and think about it all day. Why should every programmer be held to this arbitrary standard? What if I want to learn ML, compilers and programming languages or study distributed systems? They are as much CS as anything else but you don't get a cookie every time you navigate a tricky situation. There is no gamification so you have to tread your own course. That IMO takes a lot more originality than what these rat races foster.

Re: Competitive programming is useless

#133

Earlier quoted context omitted.

Not using design patterns seems like pure upside. I don't think it's reasonable to use a library for most things one implements in competitive programming, because the work of getting your problem instance in and out of the library is probably greater than the work of writing the solution yourself, in code length and in runtime. As an example, the only time I ever needed to use A* was on a state space that was larger…

It's not. Because then someone else has to maintain the code you written, and if he cannot see any common pattern in your code he will make 10x the effort to understand the code, that means wasting time and thus loosing money for the company.

Is this about the design patterns or the A*? Design patterns are a mix of techniques to pay complexity make code extensible that usually will not ever be extended and workarounds for the deficiencies of a specific family of languages. An example I posted about previously is that you could spend hundreds of lines across a dozen files implementing double dispatch, or you could use dramatically less if you aren't implementing it in terms of a language-provided dynamic-dispatch-on-the-first-argument-only primitive.

It is nice to write code that can be understood by the next reader. To explain what our invariants are and what we are up to, we have comments.

Re: Competitive programming is useless

#134
post #41
post #7

Earlier quoted context omitted.

Yeah, this. My home state's college's CS program boasted it was one of the best in the northwest. My friends that went through it constantly had to ask me to explain simple stuff to them because the professor's assignments were wrong or confusing. Compare that to our local community college, which seemed to have a much more well-rounded course and taught the fundamentals in a way that made much more sense. Anecdotal…

Not to nitpick your Uber anecdote, but the "candidates in the same age group came from a non-college/-university background and usually outshone those who did" probably had to have some strong non-university background like significant practical experience in projects or work to pass the resume filter process to make their way to your interview stage. So there's probably a great deal of selection bias in that specifi…

Lol, probably not. To be clear, these were people doing on-sites, which means they passed resume filter AND a TPS.

Uber's hiring pipeline was a mess.

Re: Competitive programming is useless

#135

I'd disagree with this assessment. In my own experience, I've found that competitive programming is useful in teaching a few skills. However, the apparent point of competitive programming--building up a good repertoire of advanced algorithms and data structures--is pretty close to useless. In my professional career, the most complex algorithm I've ever had to code myself is ... union-find (on like two occasions), wit…

The worst part of competitive programming is that you need to do it for job interviews. This turned a legitimately fun and deeply engaging activity into a truly tedious and draining one

Re: Competitive programming is useless

#137
post #82

Earlier quoted context omitted.

> However, the apparent point of competitive programming--building up a good repertoire of advanced algorithms and data structures--is pretty close to useless. That's not the point of competitive programming. If you talk to anybody who is good at competitive programming, they will tell you it's _not_ about memorizing algorithms and datastructures. It's about developing algorithmic problem solving skills; skills that…

I have seen successful competitors people do basically that. And I have seen them train how to write basic algorithms super fast again and again. Yes, they had also algorithmic problem solving skills. But they learned huge amount of algorithms and datastructures so that they don't have to derive them each time. And they spend time literally training how to write them fast without mistake. It was not just about proble…

There's not _that_ many algorithms or data structures you see in competitive programming, and the vast majority of them aren't advanced. You do need to memorize a good portion of them, but doing so is the easy part towards becoming good at it.

You can read one moderate length book and know all of the DSes and algorithms you'll need for 99.9% of the time. cses.fi/book is a good one with a free version if you're curious.

https://github.com/kth-competitive-programming/kactl may also be of interest, it contains a good amount of the algorithms/DSes you'd ever need on a few printable pages (20ish).

Re: Competitive programming is useless

#138
post #27

I understand the rant but I would like to hire someone who are good at solving problems (of any kind) and can detect the edge cases very well and without deep math or competitive programming knowledge, it's not possible at all these days. However, I am an undergrad myself and sometimes I take pride in being a generalist, spent my fair share of time on every abstraction layers of CS possible. Now that I'm in my final…

“ but I would like to hire someone who are good at solving problems (of any kind) and can detect the edge cases very well and without deep math or competitive programming knowledge, it's not possible at all these days.” You shouldn’t be so opinionated before you’ve entered the work place. If you find, after a few years of experience, that this is true then fine.

My point is competitive programming or math competitions isn't a field specific skill. It teaches you various ways to solve various (life) problems in general. Brute forcing, divide and conquer, backtracking, recursion/Induction can be applied to anything.

I'm not opinionated. If there is any other way of proving that someone is good at these tactics, I'd love to work with them.

Re: Competitive programming is useless

#139
post #5

I understand the rant but I would like to hire someone who are good at solving problems (of any kind) and can detect the edge cases very well and without deep math or competitive programming knowledge, it's not possible at all these days. However, I am an undergrad myself and sometimes I take pride in being a generalist, spent my fair share of time on every abstraction layers of CS possible. Now that I'm in my final…

people spent their bachelors degree solving problems of some kind. turns out problems of different kind requires different bachelor degrees. for porkin sake, people need to grow up and accept that the state of the art measurement models of human raw intelligence have flaws so much that they can be rendered useless.

> "turns out problems of different kind requires different bachelor degrees."

Aren't we talking about CS here. I understand your point ofc. As a CS undergrad, what other options you have to prove that you are capable and know different strategies and tactics (brute forcing, divide and conquer etc) to handle and maybe solve a problem?

Re: Competitive programming is useless

#140

I like the coding challenges we have at the office. The ones who want come to solve a few riddles (this is a nation-wide competition), food and drinks are provided, we have the opportunity to chat a bit and I can claim my last place, live every year. This allows people who like these kind of things to get together in a relaxed environment.

So you use coding challenges as a form of social get together?

Yes, this is an event we have once a year. The number of seats is limited but we usually hover at 30-40 people (it is held after work hours, we are dependent on the start time, which is the same for everyone in the country)
Post reply on HN