Suesa's Adventures in Programming - Part 3/? - First steps in JavaScript

in #programming6 years ago

By acekreations on pixabay.com


I am back, stronger than ever!

This time, not with SML (who needs that anyway ... I stopped going to the lectures when they tried to teach me grammar. Me is not interested in grammar), but with JavaScript!

@reggaemuffin introduced me to "Codecademy", which offers an extensive course for this language, in the Pro version. Lucky for me, the Pro version is free for 7 days (at least as of right now).

How extensive you ask? Well, after 3 hours of consistent coding, this is my progress:

grafik.png

There might be some more material waiting for me.

What did I code so far? Only super serious stuff, of course. How to calculate my age in dog years for example!

Dog Years.PNG

Or, you know, telling people what my favorite animal is!

MyfaveAnimal.PNG

Something that threw me off slightly, was that you can apparently use recursive (recursive looking?) statements, and it works without crashing everything:

Recursion feels wrong.png

fahrenheit = Math.floor(fahrenheit)
is not something I would do in SML. Although I must confess, it's been a while since I worked with that language, maybe it'd work? My gut feeling says "no".

After I had already tempered with tamparatures tampered with temperatures, it was time to write something about the seasons that will expect me if when I move to Ireland: 404 - Summer not found.

Summer not found.PNG

The greatest thing about this tutorial? It allows you to insult non-existent people for their lack of success:

Last place you suck.PNG

And last but not least, I wrote a short program that can tell the future. And as you all know, Magic Eight Balls do not lie, this certainly proves that Steem will moon this year!

Steem will moon.PNG

So, what's my assessment so far?

JavaScript itself seems to be an easy to understand language, what I've seen so far is intuitive even for a biologist. Yes, having basic knowledge in SML might have helped, although it also led to 10 minutes of debugging, because I didn't realize that, while SML uses if - then - else, JavaScript uses if - else.

I like the fact that you can use ? : instead of if - else.

let dessert = "pudding";

if (dessert) {
console.log("HELL YEAH!")
}
else {
console.log("Awww :( ")
};

is just so much more to write than


dessert ? 
console.log("HELL YEAH!")
:
console.log("Awww :( ");

On top of that, the tutorial offered by Codecademy is really nice. Depending on how fast I get through, I might actually pay money for the Pro version.

Sort:  

Dammit! Now, I wanna code something new in JS... screw lectures, I guess xd Hope they won't tell anything important today :)

Great job! Add random number generation to that, and you have enough to make a simple text game where you fight a dragon. :P

The basics of JavaScript aren't that hard. It does get a bit more annoying as the programs grow and do more complex things though. It's a lot easier than it used to be though, because there are a lot better libraries, so your code can be cleaner and smaller.

Now I want to make that text based game ....
another time. Got a different project to work on first. Stay tuned for the 1st of April!

Oh god no...

There's also Steem libraries for JavaScript. So you could write a bot or a simple game or something for Steem. :)

That'd be a fun future project :D

The most important thing is that all this is something that you like a lot. I really liked the super serious things you codified. Hahaha!

Hopefully the Steem takes off and goes to the moon as you say ... Hehehe! That would motivate us much more than more than one on this platform.

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.027
BTC 60654.57
ETH 2343.25
USDT 1.00
SBD 2.48