Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

Create Account  |  Retrieve Password

TopCoder, Math, and Game Programming

Posted by CowboyNeal on Thu May 15, 2003 10:40 PM
from the racking-his-brain dept.
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."
+ -
story
This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More
Loading... please wait.
  • by stonebeat.org (562495) on Thursday May 15 2003, @10:49PM (#5970035) Homepage
    programming 3D rendering engine. that is where all the action is. i learned more about linear algebra while writting 3D rendering libraries, then i did during the course of my degree. :)
    • Same here. I remember more linear algebra from my 3d graphics class then I do from my linear algebra class. Then again, the 3d class was 9 months ago, the linear algebra classes were over 3 years ago. Still, I'll bet I'll rarely ever screw up normal vector computation due to all my texturing errors rather then due to missing 15 points on my LA final.
    • by qortra (591818) on Thursday May 15 2003, @11:16PM (#5970141) Homepage
      It really depends on how you define "action". Encryption seems to me to be even more exciting a field. It isn't as glamorous as game programming, but the math involved is amazingly interesting (advanced number theory, primality), and good encryption tends to last for longer than good game engines.

      3D rendering is not entirely about math (probably a lot more to do with studying the brain and how people generally interpret images that they see). Encryption however is ALL math. Anyhow, that's my 2 cents.
      • Yes, it's actually quite math-heavy -- the obvious linear algebra, and geometry for the graphics part. And since a 3-D world wouldn't be very interesting without things that move about and obey the laws of physics, add calculus, differential equations, and numerical analysis to the mix.

        There's lots of math to challenge any math lover -- it's just a different kind than that used in encryption. If you hate math, you won't be a good graphics programmer.
      • by plierhead (570797) on Friday May 16 2003, @12:18AM (#5970346) Journal
        Hah, encryption, I spit in your face !

        Payroll processing is where the action is. COBOL rocks! And you'll score loadsa chicks.

  • beh (Score:5, Funny)

    by Anonymous Coward on Thursday May 15 2003, @10:50PM (#5970042)
    game programming is where the action is
    Then why do I always have rendering operations rather than second dates in my pipeline?
  • Top Coder: "What? This isn't done yet?"

    Bottom Coder: "No, your Code Mistressness!"

    Top Coder: "You pathetic little worm! Get back in there and code until your hands bleed!"

    Bottom Coder: "Right away your worshipfulness!"

    Expect to see more ads for "Dominatrix" pop up in Silicon Valley...
  • Language of Choice (Score:5, Interesting)

    by avdi (66548) on Thursday May 15 2003, @10:52PM (#5970052) Homepage
    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++.

    I'm not sure what conclusion to draw from that fact, I just find it interesting.
    • a math double-major, who's considering becoming a math professor, uses C++ as his language of choice

      A good friend of mine recently finished a PhD in Maths and decided to start his career in the IT industry. Having never done any computer science, he did a six month course in C++ and then a six month course in Java and found that Java was much easier for him. He said that he never felt that he fully understood C++, but he topped the class in Java. I am sure he could have done well in C++ if he had w

    • by larry bagina (561269) on Thursday May 15 2003, @11:07PM (#5970110) Journal
      TopCoder cofirms it: functional programming is dieing. You don't need to be Eliza to predict functional programming's future: functional programming is dieing. Scheme is the most endangered of them all, having suffocated under a deluge of ()s. It was auctioned off to gnu/emacs, anoter charnel house, with an equally precarious future. Induction proves that the downward spiral will continue until termination.

      Fact: functional programming is dead.

      • Fact: functional programming is dead.

        There seems to be a lot of life left in that corpse, given that Perl and Python have essentially become Lisp (lexical closures, dynamic typing, list comprehensions, etc.) and that O'CAML is thriving.

    • TopCoder permits only Java, C++, and C#.

      -- a red
      • Ok, this "Topcoder" site should hire some of its own contestants to reprogram its site. Problems so far looking around:

        1. Little popup that puts up the red button to enter the competition areas has the bottom line (warning about DON'T CLOSE THIS WINDOW!) chopped off.

        2. Actual coding window when scrolling upward has graphic artifacts and you must highlight the scraggly area and dehighlight to make it look good.

        3. Went back later, window with red button hasn't gotten as far as displaying the red button (o
    • Well OpenGL and DirectX are both C++ based. We talking about game and graphics programming right? Its true that Java is offering some GL like libraries or wrappers but performance is not one of its strengths.

    • by White Shadow (178120) on Friday May 16 2003, @12: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 swillden (191260) <shawn-ds@willden.org> on Friday May 16 2003, @10:39AM (#5972997) Homepage 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++.



    • Say what you want, but for the math gifted, most of them will code in Occaml, or one of the Meta Languages (ML), if they ever come across them.

    • by jgerman (106518) on Friday May 16 2003, @05:54AM (#5971221)
      Kids aren't taught functional languages in college much anymore. You can go through all four years, get a degree and know very little about even imperative programming. Object Orienting caught on at schools when it was at the height of it's buzzword curve and hasn't let go yet.


      I'm sure I'm not the only one working in the industry that's had to deal with poorly educated fresh out of college employees. Kids that only know one langauge, and one way of doing things.
      OTOH I don't believe I learned much from college, it was the reading and coding I did on the side.


      I wish when kids chose CompSci as a major, the first thing they got was a copy of Knuth, Godel Escher and Bach, the Planiverse, and the Turing Omnibus. (There are obviously others I'm leaving out for instance Programming Pearls, Hackers, ext.) I think it would go a long way towards a better Comp Sci education.

    • 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.
    • I find that LISP programmers tend to think more verbally than C++ programmers, who think more numerically. LISPies construct ideas verbally, parenthetically. C++ programmers think in a manner more closely in line with machines: operation, operation, operation. Am I making this up? In my C++/3D engine-type courses, the guys and occasional gals fit the compsci stereotype more closely: dungeons and dragons, late nights playing Quake. In my LISP courses, usually AI/GA/GP, there were a lot of guys/gals taking po
  • 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.
    • 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.

      Actually it's not as simple
      • So for a long term employment (3+ years), I would rather hire a young successful TopCoder participant (one can always gain experience but not smarts) than a regular but experienced guy.

        I'd agree, but I also wouldn't expect the TopCoder to stick around at a job for 3 years. Unless it was a very challenging job (Like game development, or scientific research in their area of interest.)
      • So for a long term employment (3+ years), I would rather hire a young successful TopCoder participant (one can always gain experience but not smarts) than a regular but experienced guy.

        Sorry for responding twice, but I just had another thought... I would think a TopCoder participant/winner would be more apt to re-invent the wheel than find an existing solution. While often times, re-inventing the wheel is a good solution, it is still unnecessary and adds too much onto the development time.

        Whether it's f
  • Top Coder (Score:5, Funny)

    by mao che minh (611166) * on Thursday May 15 2003, @11:09PM (#5970117) Journal
    Top Coder (top côder)
    n.

    1. Winner of the Collegiate Challenge
    2. The one person on this Earth in which the act of procreaction will be the most difficult to engage in.
    See also: "employment lost to Indian national"

    *ducks*

  • Uhhh.. I read the whole article.. After I got done, I re-read the /. story, saw the reference to game programming being where the action's at - went back to the article, searched for 'game', and found nothing. WTF? ..

    Porno's where the action's at. Game programming? Who in the hell made that up.

  • Experience (Score:5, Insightful)

    by methangel (191461) on Thursday May 15 2003, @11:12PM (#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
    • I agree, I have been programming since I was 13 and when i finally took some college classes on programming I ended up dropping them.. the deadlines and everything took the fun out of it.

      i still code, but on my own terms.
    • Well.. (Score:5, Insightful)

      by varjag (415848) on Friday May 16 2003, @07: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 Samir Gupta (623651) on Thursday May 15 2003, @11:33PM (#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 Thursday May 15 2003, @11:53PM (#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 1in10 (250285) on Thursday May 15 2003, @11:53PM (#5970286)
    Wow, someone who won top coder is saying it's a good indication of real world ability.

    In other news, Microsoft says Windows is the most reliable, and George Bush says America is the best.
  • by Duncan3 (10537) on Friday May 16 2003, @12:09AM (#5970328) Homepage
    In other words he's smart enough to know even he can't get a job programming, and so it's a waste of his time to try.

    A friend of mine hired two AMERICAN programmers for 6$/hr last week. I told him he could get them for $4/hr in India, but he doesn't like remote workers.

    The party is over. Move along.
  • David Arthur (Score:2, Informative)

    by Anonymous Coward
    David went to my highschool, Upper Canada College (Canadian version of Exeter/Eton), and he was a couple grades below me.

    Sadly, he had the misfortune to be at the school while the Canadian High School Math champion was there so he didn't get much glory in the math department.

    He is a smart dude, but was incredibly socially inept :) i.e. No girlfriends. Maybe university has changed him now, I dunno.

    Anyways, he wrote a complete 3d FPS game in ~ grade 10 . He also crushed everyone in the Waterloo CS cont
          • Re:David Arthur (Score:3, Insightful)

            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 lingqi (577227) on Friday May 16 2003, @12:51AM (#5970460) Journal
    well after 69 comments (hehe), there has not been a SINGLE one discussing the competition problems, all three of which are quite interesting.

    especially the hard one, probably, because my mind is drawing a blank on how to have it implemented... (no i didn't cheat and look at the solution).

    heh, actually they go like this:

    *easy* - okay, i can think of a algorithm. probably not the fastest thing in the world, but it should work out.
    *medium* - have a haze of an idea on what an algorithm might look like. with enough caffine it MIGHT solidify.
    *hard* - at least I understand the problem, but curses on the restrictions of a binary tree =)... no idea on algorithm that would finish executing before the end of the universe. (granted, only 50 elements, so maybe it's possible brute-force)

    Damn; this is exactly how /. lowers productivity. making people spending way too much brain power on stuff that's completely unrelated and time consuming. heck; i might lose sleep over this.
    • well after 69 comments (hehe), there has not been a SINGLE one discussing the competition problems, all three of which are quite interesting.

      I'll take a shot.

      Ironically, I find the "easiest" one the hardest. I can think of a brute-force O(n^4) algorithm, but it's not pretty.

      The medium problem seems to be straight-up dynamic programming.

      Sadly, the "hard" problem is also straight-up dynamic programming, and is well-known. It's very lame that they chose this problem -- I'm pretty sure it's in CLR (Cormen, Leiserson, Rivest "Introduction to Algorithms"), and it's definitely considered in many other sources.

      Overall, these questions don't seem to be testing for breadth of knowledge, or even ability to think creatively. They all have essentially cookie-cutter answers.

      Coding up correct answers under time pressure is another matter, of course. I give all the credit in the world to someone who can crank out the code and test out all the corner cases properly.
      • Actually, you're right, these problems weren't that hard. In fact, three of the four finalists finished all the problems in about 40 minutes.

        There was actually a problem (a switch died, then the backup switch died) during the final round and they had to cancel the match. The question here are actually a second batch of problems.

        The hard problem from the first back was a get the animals across the river problem. Given a set of up to 16 animals and what animals can't be placed on a boat together, fin
          • Yeah, that's the problem. Except there is no farmer and the restriction on what animals can be left alone together only applied to the boat (so you could lave a bad combination on either shore).

            Oh, BTW, you get 8 seconds for your solution to run, so brute forcing all combinations would take way too long. In more concrete terms, this means you want something with a time complexity less than about 50 million.
        • 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? :)
  • by Anonymous Coward on Friday May 16 2003, @09: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
    • Re:good thing (Score:5, Insightful)

      by SamBeckett (96685) on Thursday May 15 2003, @10: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.
      • by lingqi (577227) on Friday May 16 2003, @01: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:good thing (Score:5, Insightful)

        by ErroneousBee (611028) <neil:neilhancock.co.uk> on Friday May 16 2003, @03: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.

        • Re:good thing (Score:3, Interesting)

          by Anonymous Coward
          Yup. There wasn't a challenge. I did them for awhile. When they used to pay for all competitions, I learned it was better to stay in the bottom ranks. There you could take a room on one question, the easiest because all you needed were language tricks. When it was just Java, this basically meant that you learned all of java.util and java.lang packages. Basically my strategy boiled down to this:

          1. Read the easy question.
          2. Recall the Java class/method that shortcutted the problem.
          3. Write 3-5 lines
    • 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