Coding in your browser

The semester is almost over and I’m playing with some Python in my spare time (In addition to Unity (XNA is on the back shelf, it looks lonely back there…)) in an online course at Udacity. More on that later in the month.

I just stopped in to talk about how you can play around with and test code for several interpreted languages in your browser. Sure, we’re all got assemblers, interpreters, and notepad lying around… there’s something fun about typing up some quick bullshit code in your browser. You know, like when you had time to write programs that come up with stripper names.

Some Python Code:

def getData(person):
#Assume we looked up person’s name, age, and idNum
name = “Christian”
age = 24
idNum = 987239874928374

#Python ‘packs’ the different values
return name, age, idNum

#And ‘unpacks’ them, gotta catch ’em all
a, b, c = getData(‘Person key value’)

#Notice Python will add two spaces where we used the commas
#to seperate the int parameter
print a + ” is”, b, “years old.”

Place to make code do something: http://repl.it/ (Does a bunch of other languages too)

Notice the multiple returns? That’s freaking awesome.
Notice the lack of semi-colons and smexy squiggly brackets? That’s freaking lame. Also typing “or” instead of || (Though you can use the bitwise | if you absolutely must use the pipe.)

Another useful website to mention when speaking of coding in your browser is Pastebin. You paste code into your browser, give people the link to it (or embed it) and they get to see nicely formatted code (you can also change the code and repaste it).

[Edit]
I felt like tacking this on here instead of making a new post. These are cool places where you can see your code come alive (with shmancy graphics) in your browser
http://codepen.io/vorg/full/Aqyre (Cool functions of time every programmer should know)
https://www.shadertoy.com/

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s