Name that code - Online programming quiz

Name
Created by OnePlusYou - Free Dating Sites

It’s a bit too easy, but fun anyway …

Tags: quiz game

9 Notes for Developers

fuckyeahcomputerscience:

wedothingsinc:

In any creative discipline, it’s good to have pointers that can keep you on the straight and narrow. Developing is one of these disciplines. From my experiences, I’ve put together 9 quick notes which can improve the way you code, and the way you see developing. It’s a valuable read, especially for anyone starting out or for programmers looking to refine their skills.

Read More

(submitted by floop)

How to choose your first programming language

Everyone has to start somewhere and of course that applies to programming, too. But getting started in programming puts you in front of one important question right at the start: What language should I start with?

There’s a gazillion of languages that are fitted for beginners. Some of them may prove to be your tools of choice even when you’ve gathered some experience. Others, well, won’t.

So how do most people choose their first language? Simple, they don’t. They let someone else tell them what to use. That could be their computer sience professor (which may be good or bad), their boss (probably bad) or “that friend who really knows computer stuff” (wich is almost guaranteed to be bad).

If your choice of a language is only based on one persons views, it’s not unlikely that this person will have a very subjective opinion about the “best language” for you. So I think the first thing to do is to ask more people. In times of the web, this should not be a problem. Just go to any website where programmers hang around (like stackoverflow.com) and start asking. They won’t eat you for breakfast. Most of them actually like to answer these kind of questions because it gives them the opportunity to promote their favorite tools.

Which leads you to the next problem: How can you tell wether the guy who just told you to learn “LanguageX” because it’s “the bestest of them all” is not just a fanboy of “LanguageX”? You can try the following steps, all with one single person:

  1. Ask, why you should use LanguageX. You’ll probably get more than enough answers.
  2. Ask, what the drawbacks of LanguageX are.
  3. Ask, what language does the things mentioned in step 2 better.

If the guy is unable or not willing to provide satisfying answers to questions 2 and 3, he’s probably just a fanboy and you shouldn’t pay much attention to him.

Repeat this with some more people. You’ll notice that you will get very different answers from different people but that’s OK. The whole point of this is to learn what the highlights and pitfalls of all these languages are. Any modern programming language probably “works” for anything you may want to do as a beginner but it can be very disappointing to discover major drawbacks later on after you’ve become used to it.

Of course this is not guaranteed to result in THE PERFECT CHOICE™ but it may help you get started with a lot less pain and a lot more fun because it’s just awesome to discover later on that the tool, that you started out with can still do the job for you.

After having said that, I suggest, you learn Piet because it’s just super incredibly cool and perfect in every aspect with no drawbacks at all. Period. Just look at what you can do with it

Adding .indexOf() to arrays in Internet Explorer

Most of you will already know this but hey, it doesn’t hurt to tell the tale again.

Looking up an array elements value by key is trivial:

var bar = someArray['foo'];

In actually working javascript implementations the reverse is simple, too:

'foo' == someArray.indexOf(bar); //will be true after the above code snippet

The actual API docs can be found over at Mozilla.org.

However, there is still this one JavaScript engine that is not only broken beyond repair but also lacks important features in the first place. I’m talling, of course, about our beloved Interbet Explorer.

Trying to use someArray.indexOf() in up to IE8 will result in an error message telling you that the object does not support this method.

So, let’s fix this!

if (typeof Array.prototype.indexOf !== 'function') {
    Array.prototype.indexOf = function(value) {
        for (var idx in this) {
            if (this.hasOwnProperty(idx)) {
                if (this[idx] == value) {
                    return idx;
                }
            }
        }
        return -1;
    }
}

This will check, if the engine that your script is running on already has the indexOf() method, and if not, it will simply add it to the Array prototype and by that to all present and future arrays.

Not exactly a game changer, but useful.