Learning Javascript after C++

Started by
5 comments, last by DeFessler 8 years, 7 months ago

Hey there,

Some time ago I started programming in C++ to learn the basics of programming.

Now, I know those basics (exactly: variables, conditional statements, loops, functions, pointers, arrays, vectors, classes, inheritance, dynamic memory, I'm learning about template programming now and will learn some other topics in the near future)

Now, I decided that I want to learn about web development. After some reasearch, I found out that Javascript would

probably be a good choice for that.

Now I have three questions:

The first and most important one: what are good resources (the best would be a book) to learn javascript for someone who already knows the basic concepts of programming.

The second: Is javascript and web development hard to learn if you know the basics of C++

The third, more an opinion question: Do you think Javascript is a good choice for me, if not: what would you choose?

I hope everything is clear, otherwise I would be glad to hear it,

in order to clarify some things.

Thanks in advance.

Advertisement

I can only offer a resource: https://www.codecademy.com

Look at the bottom where it says learn to code -> javascript

All lessons are interactive.

Also has python, ruby, and PHP.

-potential energy is easily made kinetic-

I've never done any real web-development beyond tinkering, but for that I did use Javascript, and it is extremely simple to learn if you're already an experienced programmer.

So far the three things I've learned from JavaScript are:

1. Everything is a key-value structure.

2. There are only 64 bit floats. Nothing else.

3. Semi colons aren't mandatory.

That means three things (in order):

1. You can add attributes to a function or more functions to a function, or functions to an attribute, or anything really. Pretty fun.

2. Math is costly. VMs can do optimistic typing for some stuff but its not magical.

3. Not using semi colons will bite you in the butt someday.

That's all I've learned from it.

Also I've read good recommendations about JavaScript: The Definitive Guide. It doesn't deals with ECMAScript 6 (aka 'let', 'const' and classes), but beyond that, it has everything covered it seems.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

I suggest Codewars.com and Eloquent Javascript if you're wanting to learn Javascript. And if you know the basics as you have described, then you'll be in good shape.

Oh as anyone who has really programmed in Javascript will tell you, be prepared to learn some functional programming. Javascript does use it quite a bit.

Beginner in Game Development?  Read here. And read here.

 

Yes and no. I was originally a C++ dev and ended up spending a lot of time looking at Java, JS and Python systems.

A lot of Javascript will feel familiar, just with different syntax. Some of it is even quite nice -- proper anonymous instances so you don't have to define a whole class and an instance just to pass it to a function.

On the other hand, a lot of Javascript is flaky, slow, oddly expensive in places and sometimes just plain counter-intuitive (comparisons don't always do what you think they do[1]). To make things worse some stuff (event handling in particular) varies between browsers.

It's easier if you have a library around to help with some of this stuff (like abstracting away some of the browser-varying parts). jQuery is widely used, there's a lot written about it and it's relatively easy to understand as long you know enough html/css.

Second the recc for JavaScript: The Definitive and there's also http://bdcampbell.net/javascript/book/javascript_the_good_parts.pdf

[1] Unlike in C++, things get type converted before being compared if you use == and it leads to counterintuitive results.

Yes and no. I was originally a C++ dev and ended up spending a lot of time looking at Java, JS and Python systems.

A lot of Javascript will feel familiar, just with different syntax. Some of it is even quite nice -- proper anonymous instances so you don't have to define a whole class and an instance just to pass it to a function.

On the other hand, a lot of Javascript is flaky, slow, oddly expensive in places and sometimes just plain counter-intuitive (comparisons don't always do what you think they do[1]). To make things worse some stuff (event handling in particular) varies between browsers.

It's easier if you have a library around to help with some of this stuff (like abstracting away some of the browser-varying parts). jQuery is widely used, there's a lot written about it and it's relatively easy to understand as long you know enough html/css.

Second the recc for JavaScript: The Definitive and there's also http://bdcampbell.net/javascript/book/javascript_the_good_parts.pdf

[1] Unlike in C++, things get type converted before being compared if you use == and it leads to counterintuitive results.

I am actually a huge fan of JavaScript: The Good Parts. It might be a bit dated but I think most of it still holds true (such as making it a point to never use '==' in favor of '==='). JavaScript Patterns is really good too. You can actually get plugins for most code editors that will lint you're code using the standards explained in "The Good Parts".

JavaScript is pretty much the language of the web and it does have it's really bad clunky parts to it but it has great things too. The biggest problem with web development is that you're working inside of a browser and generally you have to worry about supporting many different browsers which all have small (sometimes big) quirks that you have to learn to get around. Using libraries like jQuery, Underscore etc help a lot in that area.

There are some frameworks (nw.js, CEF etc...) that you can make applications using and you'd only have to focus on the browser tech that framework uses which can be really fun and very freeing if you're used to working in the browser.

This topic is closed to new replies.

Advertisement