Is Javascript easy if you know basic C++

Started by
20 comments, last by Serapth 8 years, 8 months ago

Hello,

The last year, I learned (and am still learling) the basics of C++ in my spare free time.

(A rough sketch: from variables untill inheritance).

Now, for some weeks, I am thinking to start making a small app for mobile devices,

because after a year of only seeing console applications, you want to do something bigger

and more exciting. Now I came to the conslusion that Javascript might be a good language to

learn for me now. As you can make android applications and website's with it.

But before I start learning another language, I wanted to know: is

it hard to learn javascript once you know basic C++?

(And maybe too: what are good rescources to start learning it)

Thanks.

Advertisement

Short answer: Yes and no. wink.png

Once you know any single programming language, picking up a new one does become easier. There are a lot of basic concepts that are shared across just about every programming language out there.

However, there are different paradigms among programming languages, and it is naturally easier to learn a second language within the same paradigm of a language you already know. Learning a language from a paradigm that you haven't encountered before can be a challenge. And in some ways, knowing languages that use other paradigms can be a bit of a handicap, as it takes a while to train yourself to think in the new way.

JavaScript superficially looks kind of similar to C++, but they are very different beasts, so this definitely falls into the paradigm-jumping category. The biggest difference, in my mind, is that C++ is statically typed, while JavaScript is dynamically typed. This required a huge shift in thinking for me before I actually felt comfortable using JavaScript, because I too came from a statically typed world first.

That said, learning different programming paradigms is a valuable and important process to go through for developing your professional skills. And honestly, it might be useful to learn a variety of paradigms early on. That way, you don't get too set in your ways before trying to break out of the single-paradigm box.

As for resources for learning JavaScript, aside from random tutorials on the internet, I would recommend MDN as a reference (and they do have tutorials, it appears), and JSFiddle as a simple way to quickly test small code snippets. (Also, note that if you don't already know HTML and CSS, you'll almost definitely be learning the basics of these data-representation/layout languages alongside JavaScript.)

"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas only, and not for things themselves." - John Locke

Once you know a language (and 'know' is subjective) you can learn another similar language without too much trouble. However, javascript handles classes, inheritance, and few other things very differently than C++. Javascript is actually a "Prototypical" language. Non-trivial language features revolve around functions and prototypes. Also, references to parent or base classes (functions) are handled differently in Javascript than in C++.

In short, you can learn Javascript after learning C++. But learn Javascript and don't try to compare it to C++. If you do, you'll be causing yourself more trouble than needed.

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

 

Thanks,

one additional question: would it be better for me or easier (althought I'm not

aiming for it to be easy) to learn C#. Because when I chose which language I would

learn to use to make apps, I was doubting between JS en C#?

thanks again

Before we go down the rabbit hole, what exactly are you trying to do? Find more challenging projects, be a web developer, or be a mobile app developer?

Answering this question concisely will help us help you :)

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

 

As I said in my first post, my goal for now is to

make an android (and maybe IOS) application.

(not a game, but more a gui application)

*Addition:

The reason why I doubt between JS and C#: C# can be cross platform, when using 3rd party software.

JS: comes in handy for web development in the future.

You need to ask yourself what kind of applications you want to make. Depending on that, changes a lot. If you want to make a web based application that connects to a DB you are going to need to know a lot more then just Javascript. Consider web-frameworks and the languages they use. Sure you could use something like NodeJS but that is the closest you are going to get to just learning Javascript and thinking that is all for your web based application. C# and JS are not even comparable by any means nor' in the same realm.

Now you could say should I learn Java or C# for application development. JS also comes with security limitations there is only so much a browser will let you do using JS since it can be potentially harmful if they didn't do that. If you are looking to make an iOS application you should be looking into Swift language. If you want it to be solely web based that it really isn't an iOS application but a web application that can be accessed on any OS with a browser.

Is Javascript easy if you know basic C++


Yes.

If the average Web programmer can use it then any quasi-sentient life form should be able to pick it up pretty quickly.

Sean Middleditch – Game Systems Engineer – Join my team!


As I said in my first post, my goal for now is to

make an android (and maybe IOS) application.

(not a game, but more a gui application)

Although you can use any general purpose programming language for most tasks nowadays with the correct tools, JavaScript is not really used for Android applications. Are you getting mixed up with Java?

- Kirk

This topic is closed to new replies.

Advertisement