You're looking at Less Wrong's discussion board. This includes all posts, including those that haven't been promoted to the front page yet. For more information, see About Less Wrong.

CronoDAS comments on More intuitive programming languages - Less Wrong Discussion

4 Post author: A4FB53AC 15 April 2012 11:35AM

You are viewing a comment permalink. View the original post to see all comments and the full post content.

Comments (89)

You are viewing a single comment's thread.

Comment author: CronoDAS 15 April 2012 10:59:47PM *  0 points [-]

I lost interest in programming after I realized how much effort it would take me to do anything cool.

For those people here who consider themselves reasonably skilled at programming: how long would it take you to implement a clone of Tetris? I've got a computer engineering degree, and "cin" was the only user input method they taught me in programming classes...

Edit: You're not allowed to use ASCII graphics, and it has to run at the same speed on different processors, but other than that, requirements are flexible.

Comment author: Nornagest 15 April 2012 11:41:26PM *  4 points [-]

User experience makes questions like this tricky: graphics, sound, score-tracking, tightening up controls. If I was working with a graphics library I was already familiar with, I doubt the core gameplay would take me more than a few hours. Writing a reasonable clone of the version of Tetris I played fifteen years ago on the Atari ST would take at least a couple of weeks, though, and that's if I had all the resources I needed on hand. An exact clone would take even longer.

Comment author: RolfAndreassen 16 April 2012 03:14:45AM 3 points [-]

Depends on how many bells and whistles you want. For just a basic clone, I can do it in an evening, using a third-party library to handle the windowing and whatnot. Of course if you wanted to implement the windowing and input handling by talking directly to the OS, it would be an utter nightmare; call it three months.

Comment author: lavalamp 15 April 2012 11:33:12PM 2 points [-]

If you don't care about graphics, like a couple hours. But you could spend as much time as you want on graphics.

Comment author: Vladimir_Nesov 15 April 2012 11:32:24PM *  2 points [-]

An evening? Depends on what you mean by "Tetris" and the target quality. I did a two player Tetris-over-network for a class once (the opponent gets an additional garbled line when you clear multiple lines). It's easy, which is part of the problem: with enough expertise, it can become boring, you don't learn as much new stuff, it becomes more like laying bricks, not designing intricate machines or learning the principles of their operation.

An estimate that I heard on multiple occasions, disbelieved, and then witnessed come true, is that it takes about 4 years of hands-on experience for an enthusiastic smart adult to conquer the learning curve and as a result lose enthusiasm for software development in the abstract (so that you'd need something special about the purpose of the activity, not just the activity itself). I don't know about the probability of this happening, but the timescale seems about right.

Comment author: CronoDAS 16 April 2012 02:28:43AM 1 point [-]

A related question: how much would a beginner have to study before being able to write Tetris? As I said, I graduated with a degree in computer engineering without being able to code Tetris, because I have no idea how to write anything except console programs that use cin and cout to do all the input/output work. "Draw something on the screen, and have it move when someone presses a key" would seem to be a fundamental task in computer programming, but apparently it's some kind of super-advanced topic. :P

Comment author: Emile 16 April 2012 06:14:12AM 2 points [-]

The focus on cin / cout as opposed to GUI is probably because cin is simple and always works the same way (mostly because nobody uses it, no need for a zillion libraries), whereas there are a lot of very different GUI libraries with different ways of doing things; learning one of those would take time and not help you use another one much.

If you want to learn yow to make a GUI you can probably find a "hello world" example for your language/os of choice and just copy-paste the code and then adjust it to suit your needs.

Comment author: CronoDAS 16 April 2012 08:41:45PM 2 points [-]

Yeah... everything is in libraries these days and the libraries are all incompatible with each other. :(

Comment author: ShardPhoenix 16 April 2012 03:18:10AM *  2 points [-]

It's not as hard as it might sound. Modern languages have nice libraries and frameworks that make input and basic graphics very easy. Here's a tutorial for Slick (a Java-based 2D game framework) that walks you through how to do exactly what you ask: http://slick.cokeandcode.com/wiki/doku.php?id=01_-_a_basic_slick_game

Here's a tutorial for how to make Tetris: http://slick.cokeandcode.com/wiki/doku.php?id=02_-_slickblocks

I'm sure similar things exist for C++, especially since it's the most popular language for making games in.

edit: If you want to actually follow one of the above tutorials, see this setup info first: http://slick.cokeandcode.com/wiki/doku.php?id=getting_started_and_setup

Comment author: Nornagest 16 April 2012 09:11:56PM *  1 point [-]

Probably not too long. I wrote (a crappy version of) Breakout in my second semester of high-school programming, and that was using Pascal plus some homebrewed x86 assembler for the graphics (both of which were a nightmare that I wouldn't recommend to anyone), so simple games clearly don't require any deep knowledge of the discipline; if you've got a computer-engineering background already and you're working with a modern graphics library, I'd call it a couple weeks of casual study. Less if you're using a game-specific framework, but those skills don't usually transfer well to other things.

Comment author: gRR 16 April 2012 01:11:51AM 1 point [-]

<brag>I wrote tetris for IBM-370/VM once, during school practice. The main problem was making the keyboard and display work in real time, had to write significant parts in assembler. Took about three weeks of evenings.</brag>

Comment author: ShardPhoenix 15 April 2012 11:49:32PM *  1 point [-]

I did this (in Java) when I had some spare time at work recently. It took a couple of days of work (with some slacking off), including learning a (pretty simple) new game/graphics framework.

Comment author: fubarobfusco 16 April 2012 07:26:32AM *  0 points [-]

Use Pygame. Evidence: People frequently produce playable games using Pygame in 24-hour hackathons.