Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Programming IT Technology Entertainment Games

TopCoder, Math, and Game Programming 287

reiners writes "DevX.com has an interesting interview with David Arthur (dgarthur), the 2003 TopCoder Collegiate Challenge winner. Arthur discusses many interesting topics: the similarities between TopCoder problems and math problems, why TopCoder performance is positively correlated with 'real-life' programming performance, and why game programming is where the action is."
This discussion has been archived. No new comments can be posted.

TopCoder, Math, and Game Programming

Comments Filter:
  • by Xerithane ( 13482 ) <xerithane.nerdfarm@org> on Thursday May 15, 2003 @11:55PM (#5970062) Homepage Journal
    Uh, you are asking a student who has held an Internship. His points are fairly valid:
    • Test your code
    • Make it readable
    • Spend time designing

    Those 3 don't happen as much in the real world as one would hope to think. Very few companies do code reviews correctly, nor do most programmers spend enough time testing their algorithms.

    I would look at a Top Coder victor the same way I would look at someone who can answer trivia questions correctly. The experience is incredibly valuable, but I wouldn't say that they are parallel at all. Most of the questions and tests are biased against people who have experience doing competitions. A veteran programmer would probably perform 10x better in a real world environment, and is much more valuable than a TopCoder winner who is still in school... but I could be wrong.
  • Re:good thing (Score:5, Insightful)

    by SamBeckett ( 96685 ) on Thursday May 15, 2003 @11:56PM (#5970072)
    hehe you must have scored REALLY bad on the competitions to have this kind of attitude. From my experience, I have a relatively average score (~1400) and have nothing but the utmost respect for the true "top coders". Being fast is just one part of it, algorithm knoweldge and language mastery is a must-have to be competitive like these guys are.
  • Experience (Score:5, Insightful)

    by methangel ( 191461 ) on Friday May 16, 2003 @12:12AM (#5970128)
    It is my firm belief that people have a 'love' for programming do a lot better than educated and real world programmers. It really all comes down to whether the task is being done because of PERSONAL motivation, versus /having/ to do it for class or work.

    Just my $.02
  • by Samir Gupta ( 623651 ) on Friday May 16, 2003 @12:33AM (#5970206) Homepage
    I like to think of game programming vs. other fields of software like flying fighter planes vs. flying airliners. The airlines are much more prevalent, make a lot more money for the pilots, and probably benefit society far greater than the fighter pilot.

    But the fighter pilot is one of an elite few, is much more well-trained and on the cutting edge of technology, and sure has that sex appeal and WOW factor as well.

    So it is with game programming. Gamers always strive to push the cutting edge, not just get a job done but to try new things always with each iteration, unlike the business programmer who solves a task to be solved rather than invents new problems just to see what's possible, and it's really no coincidence that the needs of games is what drives a lot of PC hardware technology forward. While game programmers may not make as much money or benefit society as the suits, it's sure fun, and I have no regrets about being in the field.
  • by Ryu2 ( 89645 ) on Friday May 16, 2003 @12:53AM (#5970285) Homepage Journal
    Graphics and games (which along with movie SFX are probably the most visible applications of graphics) are cool to me, because any layperson can appreciate the results of your work. This is probably not true of any other area in practical or theorectical CS.

    Just show them your cool real time renderings, and they go wow! Your average Joe Blow will not appreciate your proof that P=NP, your RDBMS that sets new records in a TPC benchmark, or your preemptive, reentrant OS kernel. But people like and understand visual things, and so it's easy for them to appreciate the fruits of your labor.
  • by White Shadow ( 178120 ) on Friday May 16, 2003 @01:59AM (#5970478) Homepage
    Did you read why C++ is his language of choice? The reason he gives is because it's the language he has the most experience in. In fact, most of top ranked competitors use C++ (you have a choice between C++, C# and Java). My theory on this isn't that most of them think that C++ is a better language, it's just that most of the top competitors went through school when C++ or C was being taught so they know it the best. Most (but not all) of the top ranked coders are at the ends of their undergraduate careers or older.
  • by lingqi ( 577227 ) on Friday May 16, 2003 @02:13AM (#5970513) Journal
    I personally think this [inria.fr] is a better programming competition paradigm than TopCoder.

    in case people will probably not bother to click, it goes something like this:

    you have three days to do the programming task (72 hours), and you submit it via email. you can use whatever language you want, etc etc. here is an official quote:

    Programming should be about correctness and elegance, not about writing something in a hurry. Correctness is more and more important, for example in life-support systems and drive-by-wire automobiles, where there is no room for error.

    There is no room for error in this contest either. The first thing the judges will do is test the programs and eliminate any entry that does not give correct results on all tests. Besides, the task will be simple enough that 3 days will be enough time to write, debug, and do some tweaking on your program, and get a normal amount of sleep. It was already the case for the previous years, and we see no reason to change.

    the cool thing is this
    [for the 1st place] Finally, the contest judges agree to state at least once during the presentation of the awards that the winning team's programming language is "the programming tool of choice for discriminating hackers."

    [for 2nd place] The contest judges agree to state at least once during the presentation of the awards that the winning team's programming language is "a fine programming tool for many applications."

    [for special judges prize] The contest judges agree to state at least once during the presentation of the awards that the winning team is comprised of a group of "extremely cool hackers."

    anyway... the money isn't as good, but I like it much better. btw the winner for the 2001 one used haskell, and second place used Dylan, ha! eat my (shorts), Arthur. =)
  • Re:Kid Programmer (Score:2, Insightful)

    by HoldenCaulfield ( 25660 ) on Friday May 16, 2003 @02:15AM (#5970520) Journal
    hmm . . . with topcoder being a timed contest, where points are awarded dependent on speed, and the coding phase being 75 minutes for three questions, that quick and dirty serves a need? We're not talking large scale projects here . . .

    I had a competitor comment to me once that while lots of others don't mess with objects, he does, just because he likes the structure and makes his debugging easier, even for tournaments . . . most others skip them because it's a level of conceptualization that can be skipped . . . modular code doesn't serve much benefit in 75 minutes . . . (well, unless you're referring to STL . . . )
  • Re:Kid Programmer (Score:3, Insightful)

    by White Shadow ( 178120 ) on Friday May 16, 2003 @02:19AM (#5970528) Homepage
    When are they goining to start teach good coding practices in school?
    They try to, but there just isn't enough time. Really, most after you take data structures (maybe a sophmore level class) you never get any formal programming training. Instead you move on to more specialized stuff like graphics or AI or theory or compilers or whatever.

    And really, should the university be responsible for teaching you that stuff? In my experience, the best way to become a better programmer is to program and have other (more experience) people examine your code and give you feedback, and to look and learn from other people's code. If you're smart, you learn very quickly how to program for "the real world" when put in a job environment.
  • Summarizing your algorithm: for every pair of nodes that are not connected, do the proper intersections of their in/out-neighborhoods. (Note however that the pair of nodes in the other corners must be checked for connectedness too.)

    "For every pair" => O(n^2)
    "intersect neighborhoods" => O(n log n)
    (by sorting the entries in the neighborhoods and comparing from there)
    But as for checking connectedness of pairs in the two intersections, that's again O(n^2).

    So we're back at O(n^4) (not to mention the work that goes into preventing double-counting of cycles that are found in several different ways).

    Which solution would you rather code up? :)
  • Re:good thing (Score:5, Insightful)

    by ErroneousBee ( 611028 ) <neil:neilhancock DOT co DOT uk> on Friday May 16, 2003 @04:37AM (#5970899) Homepage
    hehe you must have scored REALLY bad on the competitions to have this kind of attitude.

    I did a 'sort of' competition thing (it was actually a study in how programmers program), and I found that the problem was nothing like what I meet in the real world:

    • The spec was really watertight, not 'Uh, make it show birthdays, and, uh, see if the users like it'.
    • There were no OSINTOTs or other gotchas like broken APIs or liscencing issues.
    • The spec didnt change halfway through the task.
    • No-one dumped a completely unrelated, but more urgent, task in my lap just as I was about to start coding.
    • QA didnt suddenly start bitching about a feature thats been in the product for years, but theyve only just noticed, and no-one uses anyway.
    • The problem was chosen for its elegant recursive solution. Most of my real world problems are solved by a tiny bit of iteration and masses of conditional logic/exception handling dealing with all the dumb things the user/system can get up to.

    In general, I suspect these competitions reflect academic computing, producing nice and small programs. The real world is more like Google's pagerank software, a simple idea, but complicated by all sorts of issues like Bloggs and Googlebombers.

  • by sql*kitten ( 1359 ) on Friday May 16, 2003 @06:56AM (#5971230)
    I find it interesting that a math double-major, who's considering becoming a math professor, uses C++ as his language of choice, with Java coming second. Not Lisp, not Scheme, not Haskell - C++.

    Clever programmers use Lisp, Scheme and Haskell.

    Smart programmers use whatever language the market's hiring, and don't get caught up on language wars.
  • Re:good thing (Score:3, Insightful)

    by jgerman ( 106518 ) on Friday May 16, 2003 @06:57AM (#5971234)

    change halfway through the task


    Wow you're being generous. My favorite is when it changes hourly.

  • Well.. (Score:5, Insightful)

    by varjag ( 415848 ) on Friday May 16, 2003 @08:12AM (#5971438)
    It is my firm belief that people have a 'love' for programming do a lot better than educated and real world programmers.

    You'd be surprised if you knew how many educated and real world programmers love programming.
  • by zatz ( 37585 ) on Friday May 16, 2003 @08:41AM (#5971586) Homepage
    C++ is a terrible teaching language. A portable assembler that thinks it's an object system... what could be more confusing? Teaching systems programming is certainly apprpriate, but please, use C for that.
  • by Anonymous Coward on Friday May 16, 2003 @09:34AM (#5971877)
    I think you can pretty safely assume that the reason he prefers c++ for the competition is because it's the language he knows best. In fact, he says exactly that in the article. You read the article, didn't you?

    He's still pretty young and probably hasn't worked seriously in more than a couple of languages yet. Couple that with the obvious fact that he's a bright guy and it's reasonable to assume that he probably doesn't have any religious views about programming languages yet. Give him a few years and he'll probably have an opinion on the subject.

  • by Anonymous Coward on Friday May 16, 2003 @10:34AM (#5972285)
    I don't normally read SlashDot, but after a friend pointed out this post to me, I had to check it out. Having done so, I couldn't resist making a couple comments.

    "I find it interesting that a math double-major, who's considering becoming a math professor, uses C++"

    I don't see much use for computer programming at all in mathematics, except in applied areas that don't interest me. I learned C++ because it was ideal for game programming, and I learned Java because it was taught in college and used at the company where I worked.

    "Maybe there is some kind of speed math problem think tank that secretly controls the world around us"

    Amazingly enough, it is actually possible for certain people to do more than one thing, including math research and contests. For example, I once met this guy who could walk and talk at - get this - the same time. It was pretty crazy.

    "With looks like those... it's no surprise he has nothing better to do."

    Yeah, screw you too. At least I have better things to do than flame college students on SlashDot. In fact, I spend no more than two hours a week on TopCoder, often less. I almost never practice, and I have not competed very many times.

    "someone who won top coder is saying it's a good indication of real world ability"

    I believe I said that it is not completely irrelevant. That would be different. Since I did this interview for some internet thing that neither I nor my friends read, and since I am not even looking for a job right now, I didn't really have a vested interest.

    "(tenured math professor = job security)"
    "he's smart enough to know even he can't get a job programming"

    If you guys think it is easier to get and maintain a good programming job than it is to get and maintain a math professorship at, say, Harvard, you are very much mistaken.

    "So this guy is telling us he makes this for the money and he will become a math professor?"

    I believe I mentioned that money is no longer my primary reason for doing TopCoder. Furthermore, just because I choose to spend minimal time making lots of money given the opportunity, does not mean I can't live with a bad-paying job.

    "normally you do not *decide* to become a professor"

    Really? I actually think this is precisely what happens.

    "other serious, more difficult, competitions like the ACM"

    You don't know what you're talking about. Everybody in the TopCoder top 10 has done extremely well on some or all of the ACM, the IOI, the Putnam, and the IMO. Of these contests, I'd say the ACM is actually the most worthless (straightforward problems, missing constraints, ridiculous 3-person 1-computer dynamic, ridiculous 2-year limit).

    "Mr. TopCoder could very easily be a pro athlete. He sure answers questions like one."

    What do you want me to say? Maybe I should have answered questions like "Have you thought about how you want to apply your computer skills after graduation?" with "Actually, since I'm a super-genius, I thought I would show P != NP, and then maybe move on to the Riemann hypothesis, and then maybe I'd see if I could fly just by thinking really hard, like that dude in the Matrix". Certain questions will get lame answers every time.

    To those of you who aren't asses, good day.

    -- David Arthur
  • by swillden ( 191260 ) <shawn-ds@willden.org> on Friday May 16, 2003 @11:39AM (#5972997) Journal

    In theory, C++ would be the worst of the three in a timed contest--too much housekeeping.

    Absolute nonsense.

    If you know C++ well, and use the language effectively, there is very, very little housekeeping. My C++ code probably has less housekeeping code than typical Java code, because destructors are an immensely useful tool. Toss in auto_ptr, a couple of other smart pointer types and a few design guidelines and C++ is very good at allowing you to focus on the problem, not the tool.

    Plus, I never have to remember to call "close()".

    Java has an edge not in the area of housekeeping (and, as you mentioned, Java is unpleasantly verbose, particularly with respect to all of the casting that is often required) but in the area of libraries. This gap isn't as large as some might think, though, because (a) many of the Java libs are rather poorly designed and make you work much harder than you should have to and (b) there are some decent libraries around for C++.

  • by Anonymous Coward on Friday May 16, 2003 @11:53AM (#5973159)
    This is about the first time I've read slashdot in about 2 years, but I just wanted to say that you all should be ashamed of yourselves for saying anything but the highest praises for dgarthur.

    As a fellow Duke student, I can tell you from personal experience that I don't think anyone has seen David without a smile for the past three years, so you guys REALLY have done an amazing job to piss him off. Congratulations, losers.

    But it's okay--I'm sure dgarthur will be laughing all the way to the bank.
  • Re:David Arthur (Score:3, Insightful)

    by lars ( 72 ) on Friday May 16, 2003 @02:22PM (#5974518)
    I agree; this thread is ridiculous and kind of sad. A lot of people confuse having social skills with fitting in. It is well known that people who are very intelligent also tend to have excellent social skills and a good sense of humour. If anything, too good -- that's the real reason they might not fit in so well. Both times I've met Dave I've found him to be outgoing and impossible not to get along with. Socially awkward is me or most of the fellow grad students and profs I work with.
  • by zatz ( 37585 ) on Friday May 16, 2003 @10:05PM (#5977599) Homepage
    Personally I don't think physics is that confusing. And it's not a fair comparison; we have a bit more control over language design than the laws of nature :)

    If you read my post, I endorse C as a teaching language (although my more mathematically-inclined colleagues would doubtless prefer Lisp or Haskell). C++ doesn't model anything except itself, though. I've done a fair bit of development with it, and like Java, I mostly find it useful for the libraries. It's full of random gotchas, and doesn't possess the almost one-to-one mapping to machine instructions which C does.

    Unless you do a lot of embedded or systems programming, you may as well think of the computer as a virtual machine. It certainly is one to a user process. Most software spends all its time waiting for the user, so "slow" languages are fine.

    "C++: an octopus made by nailing extra legs onto a dog" -- Steve Taylor, 1998

    "I *made up* the term 'object-oriented,' and I can tell you I did *not* have C++ in mind." -- Alan Kay, one of the inventors/designers of Smalltalk
  • Unless it was a very challenging job (Like game development,

    Um, there is a HUGE amount of grunt coding in game programming. Coding the GUI, writing a script parser, or processing keyboard clicks ain't challenging. But you only need just so many programmers on a given project to write the graphics engine or the AI or do other "challenging" work. (well, of course the AI will absorb as many programmers as you want to throw at it, but for a game that will actually ship...).

    Having been a game programmer for five years, I have to say that Slashdotters seem to have some very strange ideas about game programming... :-p

Real Programmers don't eat quiche. They eat Twinkies and Szechwan food.

Working...