Javascript: A Primer for C++ April 10, 2008
Posted by mitchfrizzell in C++, Web Programming.trackback
Javascript really is the place to start if you’re looking to get into programming. You get a little taste of what you’ll get with C++, but in a lot easier package. In JS, you can choose how far you want to go. Want to get some HTML DOM in? Or would you like to skip over AJAX? Javascript can be as basic or as complicated as you wish. But there’s the problem. You won’t make a big splash in the PC world if you only know basic JS. Everyone knows basic JS. It’s when you start mixing it with other languages and functions that you really break out of the beginner’s mold. Using JS and HTML together (which is still rather basic), JS and XML (Asynchronous JavaScript and XML), JS with XUL, and many more - is where it really counts.
Javascript and C++ syntax are basically the same. Functions, classes, variables, calling variables or functions from an object: it’s all basically the same. The only big difference is JS being a little lax in ;s at the end of statements. In terms of basic functionality, you’ll also grab it in JS. Loops, conditions, switches, arrays, variables: it’s all there in JS, and just as important in C++.
But, that’s as far as JS will really take you. It’s here where JS moves onto other technologies to fulfill its purpose, but C++ moves on to its own, more complicated set of functionality. First off we’ve got pointers. Pointers can really throw you for a loop when you read about them the first time. Especially trying to read the reference operators and dereference operators. It can get pretty hard. But once you get the hang of it, you’re ready to move onto structures, unions and classes. I’m not sure what’s beyond that, as that’s as far as I’ve gotten
All in all, JS has served as a great primer for the somwhat harder C++. If you’re looking for a test run in the programming world, you should check out Javascript.
Comments»
No comments yet — be the first.