Hacker News new | past | comments | ask | show | jobs | submit login
Practice coding with fun programming challenges (codingame.com)
165 points by chipz on Sept 19, 2016 | hide | past | favorite | 42 comments

As one of the employers posted on a Reddit forum (https://www.reddit.com/r/InternetIsBeautiful/comments/53h2sl...), CodinGame is not really a "learn coding" style site. If anything it's a "reinforce what I know" site. You aren't 'learning' the concepts, nor are you learning 'game programming', you are practicing what you already know via a game format.

I once had a student that was taking my Java 2 (OOP concepts) course and was using CodinGame for "fun".

If anything, I believe CodinGame's business model is more on the recruitment side, as their tournaments often offer interviews with the sponsors.

I've always advised against being introduced to programming through game development.

As much as game development is appealing and fun, the process is complicated and requires advanced knowledge of some fairly complicated algorithms even for fairly trivial games.

Also you can find yourself spending hours shuffling sprites and designing levels which is time spent not learning programming.

Also engines like Unity provide a false sense of security when infact you have no idea what's going on behind the scene and when something goes wrong you don't know where to begin and end up discouraged.

Start slow, build your foundation, learn your bits and bytes, data structures and sorting algorithms first then venture out.

    > Start slow, build your foundation, learn your bits and bytes,
    > data structures and sorting algorithms first then venture out.
Maybe that works if you've already convinced yourself that you're going to learn to program no matter what. That certainly wasn't me, though.

In my experience, the challenge for beginners is that they lose interest and make no progress at all, not that they take some suboptimal path.

It's like picking up a guitar. You can come up with the Perfect Five-Year Roadmap and preach about how someone should first learn music theory and proper form before taking a crack at it. But for most people, that's dull and they'd never learn guitar if they had to do that before jumping in and just trying.

I think beginners should optimize for doing anything at all, and nothing should be advised against as a suboptimal route. The optimal route is the one that compels them, even if it amounts to faking it til they make it with a game framework and devoting 75% of their time to things completely unrelated to programming.

Sorting algorithms? Bits and bytes? Seriously? I started dozing off during that sentence and I've been programming in some form for at least 10 years. That's not how you're going to woo most people into programming.

> You can come up with the Perfect Five-Year Roadmap and preach about how someone should first learn music theory and proper form before taking a crack at it.

Oh come on now. That's hardly the same thing as suggesting someone could put in a few hours with a decent resource and see where they get without needing it to be in game format, for goodness sake.

I think learning to code by writing a game is perhaps not the greatest method to learn to code, and definitely not a great way to learn computer science, but it does have its advantages.

A visual feedback loop can be useful to those unfamiliar with computer concepts. Being able to think about complex algorithms with concrete examples (think graphics, physics, game state machines, dialogue scripting) can help reign in the abstract concepts.

Additionally, being exposed to multiple forms of art can be useful to find a creative outlet you may not have considered before e.g. music, art, writing, design.

That being said, I think making games is really hard. I think a lot of people want to make games and don't realize how difficult it really is. I think everyone should try it at least once.

I typically recommend Processing[0] to young hopefuls.

> Also engines like Unity provide a false sense of security when infact you have no idea what's going on behind the scene

And that's okay. Maybe that's a lesson that can only be taught the hard way. Maybe you care deeply about what is going on behind the scenes, maybe you couldn't care less.

Also, most successful games are not written from scratch. Unity and friends have had a staggering impact on the indie game industry. I wouldn't be surprised to learn that plenty of game developers have never used anything else.

I think the most important thing is that no matter what you do you should enjoy doing it. If you really want to make a game but you have no idea how to code, and you find it intimidating, maybe this is for you.

[0] https://processing.org/

Yes, processing is great. I like that it lets you explore graphically and creatively without a win/lose mentality. (Competition is highly motivating for some people, not so much for others.) If you're a Python fan, there's a Python mode for Processing [0], and if you prefer JavaScript, there's p5.js [1]

[0] http://py.processing.org/

[1] https://p5js.org/

Another engine aimed at beginners is GameMaker[0]. It's been on the rise as some successful indie 2d games were made with it. The latest offering, Hyper Light Drifter, also seems to be getting some traction.[1]

[0] http://www.yoyogames.com/gamemaker

[1] https://www.youtube.com/watch?v=nWufEJ1Ava0

I find the opposite to be true.

Sure writing an entire game is a lot of work. But starting with the typical "print "Hello world"" then looping. Then text input. Then average 5 numbers = Students quit out of boredom.

Where as inside a game you get instant visual feedback. You start possibly with a simple exiting game and start modifying. Whether it's Pong or Breakout or a simple space shooter. All of those can teach the same core elements and yet the instant visual feedback means students are far less likely to be bored and far more likely to explore other ideas.

Similarly creative coding (processing, p5.js, etc.) often go the same way. The instant visual feedback leads to excitement and exploration for many more than the "learn these 100 foundational things before you can actually do anything interesting"

I feel like you could make a distinction between "making a AAA title game" vs. "modeling game logic in a terminal".

There are a lot of great learning opportunities for building a game without a graphics layer / engine. A new developer trying to build a Tic Tac Toe game in the terminal will be exposed to some challenging but not impossible challenges that will have a wide scale application.

Plus for many people, these types of games are already a familiar domain. For people new to coding I try to encourage them to build what they know. If that's a DOS-era blackjack game, it will be much more engaging to them than trudging page to page through an algorithms book.

Don't get me wrong the materials you listed in your last sentence have their application, but the sorting algorithm section of a learn programming book / video is (while useful!) less engaging for someone looking to get hooked on a new skill/hobby/career.

I think this actually used to be easier. Back in the QBasic days, throwing some graphics up on the monitor was as easy as SCREEN 13, and then PSET, LINE, and CIRCLE away.

Processing has been mentioned upstream, and is easy enough to do most of what you put forth.

Racket is also good for this [1,2]:

    #lang slideshow
    (circle 10)
or in 3d:

    #lang racket
    (require pict3d)
    (sphere origin 1/2)
I have been in a time vortex playing with Raylib [3], a C-based game environment that is cross platform, easy to setup and comes with plenty of examples. I have modified the included game examples, and created a Windows .exe, an Android apk, and a web-based version (via Emscripten) with no hassles.

Disclaimer: I am not a gamer, but the area of games brings a lot of the things I am interested in to study. I am also interested in NetLogo for simulations and the subject of 'serious games', or 'applied games', which are not a bash on recreational gaming, but a name for games used in things like civic planning, scientific exploration, or basically simulations vs. entertainment.

I am now onto putting some long-forgotten knowledge to use again in reimplementing AI search algorithms, sorting and data structures. It is motivating. Raylib is a pretty simple, yet functional setup for me.

[1] https://docs.racket-lang.org/pict/

[2] https://github.com/ntoronto/pict3d

[3] http://www.raylib.com/

I learned programming in flash with as2 a little and then as3, and I feel that is still the easiest way to learn programming, you convert your symbols into classes and bam, in two seconds you're doing OOP, setting properties and calling methods (like play() stop()), it even helped me find the use of sines and cosines because it wasn't clear how trigonometry was useful back in school. I find it easier to learn the concrete stuff first, and then go to the abstract.

It's fairly easy now with a little Javascript and some html knowledge.

Agreed. Implementing even a trivial game like chess or Pac-man requires either a huge amount of knowledge re: programming concepts or an equally huge amount of hand-holding from the game engine and tutorials.

In fact, I would rate game programming as one of the most difficult software domains of all. I can't think of any other domain where you're immediately hit with the same level of algorithms, performance concerns, design questions, etc.

I learnt by coding games. Granted, my first games were "find a number" and some text adventures full of gotos but still. When you are young you need some reasonably fast gratification. While I was hacking at my games (one unfinished after another) I was not aware about algorithms or what did the weird ^ symbols (in pascal) actually meant. But I saw pixels move on the screen and it was magical.

I can program (mainly C++, Java, Perl, Ada, SQL) and I had difficulties to improve my weak level in Python because I had (still have) few opportunities to practice. I have followed an easy MOOC (https://www.coursera.org/learn/interactive-python-1) that uses game development. It was very motivating and a good reminder that game programming can remain simple.

I agree. Game dev is a very different way to learn to code, and one that's more accessible when you don't have specific guidance.

If you just want to do indie game dev, it's great, but it doesn't transfer and it teaches bad habits without the basis you mention in bits & bytes, data structures & algorithms.

While programming in general is highly abstract & often requires you to form a roughly analogous model of the situation in your head, game-dev programming usually involves you working directly on that model. It's very physical. Move this to that location, shrink those, animate the other, fade that out of existence. It's much easier to see the effect of your code in a game engine than through programming a sorting algorithm and logging the results to console.

For that reason, it's a great way to see if programming might be something you enjoy. It's not a great way to learn programming.

edit: apologies, I didn't see xyzzy_plugh's comment before making my own.

Games are fun. Here I'm teaching to code one without any engine stuff. Straight up programming: http://buildanappwithme.blogspot.com/2016/01/build-your-firs...

Personally, I think the best way to learn to code for someone who has talent for it is project Euler (projecteuler.net). No dependencies, no IDEs, no graphics and no gimmicks. Very short, clear, discrete problems that can be solved using any language.

If you really need shooting, explosions and fancy graphics to keep you motivated then I don't think programming as a career is for you. Most programming jobs aren't going to give you much of that. And frankly, I think all the wizz-bang graphics just interferes with your learning and getting good at visualizing in your own head what the code is doing.

The problem with Euler is it is very heavy on math. Math and programming aren't the same things. (although certain programming paths do rely heavily on math)

Its better to do something. ANYTHING. Euler? Hackerrank.com (or other similar websites? exercism.io? "Crack the Coding Interview" (or any other similar book)? codereview.stackexchange.com? codegolf.se?

Or any of the other dozens of ideas here http://programmers.stackexchange.com/a/764/2536

The key is DOING. Repetition. Solving problems and overcoming obstacles. Repeatedly. Till you get better. Then do it again. Repeat yourself.

Did I mention repetition? repeatedly?

How do you learn to piano? Guitar? fix cars? Years and years of practice. Programming is no different.

> The key is DOING.

Yes, especially doing things that are useful to you. This can be something very small. Many years ago, I needed to list filenames in a folder. (I had no idea of the command line). I knew some basic Python and I figured out how to do this.

Or I wrote a flashcard quiz test game to prepare for my history test in school (Javascript and HTML).

Or I wrote a small program to find rar or zip files on my computer that have also been extracted and now take up approx. double the space on the disk (the extracted version and the archive are both there).

Or some animations in Javascript to understand things we learned in physics class (harmonic oscillation and similar things). Small projects like that.

Or a program with GUI where I plotted some function we learned in math class about, with sliders to control some parameters of the function and see how the plot changes instantly.

I liked it so much that I enrolled in university to study computer science and I really liked the uni courses too, because I already understood how programming things is helpful in everyday life, it wasn't a dry abstract thing that you build for its own sake.

"Yes, especially doing things that are useful to you."

I'd also expand that to say things that lead you in the direction you want to go.

Game development? Healthcare software? Big business? Small business? Big Data and report writing? Database management?

Once you get past the basics there is a plethora of tools and sites... its important to try and veer towards something that meets those goals.

Euler and Math is good - math crosses all boundaries. But Fibonacci isn't as important to UI or Game programming (depending on the game types, of course)

I like how Project Euler is perceived very differently by people of varying backgrounds: programmers always say it's heavy on math, math folks tend to say it's mostly about programming!

Well, I see a lot of problems that are made trivial when you understand certain parts of math.

You can definitely "brute force" a portion of the problems... but some problems just get simple when you can see certain math parts.

I honestly wouldn't say its more math or programming - it's deeply both. More as you get past the first few problems.

My point was more that there are, these days, a good collection of more directed practice tools that don't rely on knowing or learning math.

HackerRank for example is one that has many languages and many problems that don't rely on "math". I like it and it's ilk because you can learn/practice basics without having to know the Pythagoras theorem or Fibonacci's sequence.

I think Euler has a special place in these kinds of conversations because it's one of the leading sites that did this kind of thing. That's why people are always like "Oh, you want Euler". It's what programmers immediately think of with these kinds of questions.

Project Euler (IMO) depends too much on math skills that many novice programmers (and experienced ones) lack. http://www.hacker.org is one that I introduced to a few friends that got more positive results with them. And I also encourage people to go to https://www.rosettacode.org and try their hand at adding solutions for the languages they're interested in.

For me it was PythonChallenge.com

It's not as math heavy and quite engaging.

> If you really need shooting, explosions and fancy graphics to keep you motivated then I don't think programming as a career is for you.

It can come later. For example when I started out programming, I first build websites and then found out that Javascript exists and without having the slightest idea what I was doing, I built things based on examples, like animations etc. It gave me a foundation and interest in programming other stuff, like generating things for modding games in Python, deciphering the format where games store strings and writing a program to translate them to my native language and similar hobby projects.

If you have your own goal and interest in it, it's much much easier to reach an advanced level than by learning in a linear fashion with boring artificial tasks.

Later on I took proper university courses as well, but I think it helped me a lot in staying motivated that I already associated programming with fun because of the prior experience of playing around (without too much understanding).

Except the Project Euler problems are mostly pretty boring, if you're not excited by math. I've worked through it a little bit, and it reminds me a lot of Math Team competitions in high school: the problems are a cinch if you know the formula or the rule that applies, otherwise it's a tedious slog.

My buddy runs a project Euler meetup based in Chicago for anyone who is interested. The attendees range from beginning programmers to math PhD's on a regular basis.


I play on Codingame on and off for some years now, and the fact is: it is a game. And this game is played by programming.

Thus, it is really good to try out a new language, because it is fun immediately.

Doing the contests is also really fun, since you are compelled to improve your program more and more. And if you're still new to programming, you experience very soon the problems coming with "poorly written code" (as poorly maintanable code).

I think this is possibly the best implementation of this type of thing I've ever seen ... and jeez look at the number of languages it supports.

And it doesn't take half a month to load/download. Neat. It seems fun even as a non-novice, just to learn other languages in a fun way.

This is by far the best-done "trick you into learning how to code" onboarding experience I've been exposed to. (I've tried many because I want to get some friends interested in coding)


* Note that I'm a CodinGame employee, so my answer might be biased.

Thanks for the feedback :) It's really appreciated. Coding with friends is always more fun than learning to code alone, and if you want to onboard your friends onto programming, maybe you can also take a look at our "Clash of Code" category.


These are short coding "battles", from 5 to 10mins, where you can challenge your friends in small coding exercises (filter prime numbers, find how many ones there are in a binary representation, that sort of things). You can create private clashes and play together with your friends

Using unity: https://noobtuts.com/

"getting noticed" ? As an indie game dev, I really don't make sense of that one.

I'm trying to figure out why this site exists, what their business model is, and what they're hoping to accomplish. There's no pricing data available anywhere that I can tell, but it's obviously a company. I'll comb over it in more detail when I'm not at work.

Hi! * Note that I'm a CodinGame employee, so my answer might be biased. The business model is mostly based on connecting developers who like to code with companies who are in need of programming workforce. We host online programming contests on our platform (there's actually one coming up on saturday) and depending on your performance (so, anonymously), you can land a job at one of the sponsor companies.

There are leaderboards. If you dig into the section targeted at companies:

    The best place to hire developers
    CodinGame for Work allows you to source, screen, and recruit bright and creative developers

Nice front-end.

If I could tell my past self in 1999 that seventeen years later I would be writing Perl purely for entertainment, I would have laughed, and laughed, and laughed.

This is excellent! Thanks for building this. The onboarding is awesome, I was compelled to sign up after the walkthrough.

I forwarded this to my kid. I had a quick go and thought it looked great.

This is actually quite fun to work through.

No BEAM languages, sadly.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact