New member and I have a few questions about javascript

Hello sitepoint! I just registered and I have a few questions about javascript. Ive just recently started programming and I just finished codecademy’s course on javascript. The course was fairly helpful and I now have a notebook with about 20-30 pages of notes on syntax rules, operators and what not which is great except that I am not quite sure where to go from here. My goal in the short term at least is to program android apps and make a little money, Ive done some research on there is plenty of resources for people looking to do this but my problem is that I dont know which editor to use (I downloaded eclipse but am still trying to figure out how to use it) and I want to do at least a handful of simple programs to understand how to put a program together but there does not seem to be many resources for beginners on this topic. Lastly what is javascript best used for? can I make a whole app out of it or is it more of a support language?

erm, Android apps are programmed in Java, not JavaScript (those are totally different languages):

yes, i understand this. I simply started with javascript because 1.) I understand there are many similarities between java and javascript and 2.) because Im not sure where any good resources for learning java are.

You can use ANY editor for JavaScript, even NotePad! But, if you’re looking for something like Eclipse or DreamWeaver to help write JavaScript, don’t bother. Most apps like that don’t write clean JavaScript (that I’ve experienced, anyway.) Best bet is to use the internet, look for examples of code. Also, forums (like this one) are an excellent resource. Practice, practice, practice… look at someone else’s code and try to understand what they are doing… play around with it, just trying simple things… that’s what I did. HTH,

the letters “Java” and some basic control statements (which come from C). but everything about using it is different, prototypal vs. class-based inheritance, weak vs. strong typing, first-class functions, etc. to name only the most obvious.

Yeah, despite both having “JAVA” in the name, the two are completely different beasts, both based upon C, sharing very few similarities.

Thats interesting I was told that java and javascript were at least somewhat similar and that knowing one would help a good deal in learning the other. I am reading around trying to learn java as well.

Both based upon C? can you elaborate on this a bit please?

C has directly or indirectly influenced many later languages such as C#, D, Go, Java, JavaScript, Limbo, LPC, Perl, PHP, Python, and Unix’s C Shell. The most pervasive influence has been syntactical: all of the languages mentioned combine the statement and (more or less recognizably) expression syntax of C with type systems, data models and/or large-scale program structures that differ from those of C, sometimes radically.

quite the contrary. being used to Java makes using JavaScript very hard.

Really? My father is actually a programmer for General Motors but he doesnt use any of the languages that I am looking to learn and he doesnt create the type of programs I am looking to create so he has been giving me general guidance in learning this skill but it seems like I am largely on my own here. Anyway I understand that javascript is mainly used to add interactivity to websites and such but what more can it be used to do? My fathers colleague emailed him a page that had about 5 flash games that were supposedly created with javascript. I guess more than anything I am trying to understand how useful javascript will be to me.

It can be used for the backend of websites as well, the stuff that runs the web server and interacts with the database that helps render the page before it ever get’s to the user. This is done with something like Node.js. If you’ve heard of PHP, this is an alternative to that.

Wiki is an amazing place, especially for tech information, to get a broad quick overview of things. Uses outside web pages

Well… if it’s flash then it’s done in Adobe Flash, not Javascript. To tell the difference in Flash and Javascript, just right click and see what the menu is. If it’s Adobe Flash related, then it’s Flash otherwise it will be your standard Cut/Copy/Paste or possibly even a custom right click menu for that page. (but flash will always be a flash menu)

Here is a random Javascript game I just found on Google: http://codecombat.com/play/level/rescue-mission
Here is a random Flash game I just found on Google: http://armorgames.com/play/11411/doodle-god-2

Flash is mostly dying. It’s not worth learning at this point. Things could change in the future, but I honestly think that grave has been dug and it’s just ready to be covered up once HTML5 & Javascript are fully up to the task of replacing it. (there are still a few technical things that need to be worked out) Flash it is not at all supported on Mobile Devices and when it was, it would completely destroy battery life.

Java and Javascript have a lot of similarities when looking at them from your point of view as a new developer, which can probably add to some of the confusion. These are 2 of the best languages to know when starting a career and building up your skillset. They are both very widely used. And they are both kinda used as the building blocks of Software Development because they are both used in a very wide range of applications. But if you want to know why they are named the same, look at the beginning of the wiki I linked earlier. It has nothing to do with the language and everything to do with Marketing. Javascript’s original name was Livescript.

If you’re going to want to get into Web Development, then Javascript is pretty much a need to know. Java is just great to know because it has so many uses and is the leading language in the job market. I use Java for the on the backend (like Node.js I mentioned above). You probably won’t hear much about Java running backend web services but it’s one of the most prevalent languages to run large enterprise systems. I’m honestly not sure why because a lot of what you see and will find is done by enthusiasts or startups, these people want to get things up and running and shipped out the door as quickly and as easily as possible. So you’ll hear more about Ruby, Python, Node.js, and PHP than Java. Java’s not really good at that in web development. (But things are starting to change)

Here’s another good wiki article for you: https://en.wikipedia.org/wiki/Web_development#Typical_areas

Right so I now know that javascript deals with adding interactivity to websites, rendering webpages and making a few simple games. Also after a little more research I figured out that javascript is tied to the internet in many ways which I assume is why it is not used to make applications.

I guess I was mistaken the games I was shown were actually javascript games like the game in the link you sent me (I didnt know Flash was a language of its own). Thanks for the articles by the way very informative, I believe my first post made many of you believe my goals were web development when I am actually trying to learn to program apps. When I first posted this thread I didnt really understand that javascript was not a very useful language for what I am trying to do, I have learned alot in the past two days though that has helped lift the fog so to speak and I actually found a good resource on learning java so I will be learning this language next.

By the way nobody has seemed to take a crack at my question about some simple starter programs to make to help me understand the language. I have already written the hello world program which I suppose is a good place to start but is now to simple for me to gain anything from. If you have any ideas or if there are other programs that beginners should write I am all ears!

Well, no. Javascript is what makes the frontend of web apps. It’s used to make some pretty complex applications. If you’ve ever used Google Docs, Pandora (website), Spotify (website), or a number of other things… this was all done in Javascript. This field is growing more and more popular very quickly.

Here’s a neat little team drawing app that I use built in Javascript. It’s kinda like MS Paint but for multiple users.

I have a friend currently working on a game using three.js. Click the link then click on a few apps and see some of the things it’s capable of. Three.js is some pretty cool stuff.

There is very little difference between “apps” and “web apps”. The major difference is running in the browser, but increasingly this not even the case and a lot of the apps you download are just portals to view web apps.

Also “app” is kind of ambiguous. Are you talking about phone apps? If you want Android, then Java. If you want iOS then you need to learn Swift (and also own a Mac).

Lots. Simple console based dice games, blackjack, etc. Really, anything you feel like making helps. Try to use proper data structures and learn as much about the other factors of programming is key. Whatever it takes to train your brain to think like a programmer is good.

Programming is programming, it doesn’t really matter what language you learn.

Thats a neat paint program you made there, but somebody ruined my robot before I could finish it. I checked out the other link as well it was cool to see on the examples page at the top left where you could see the code they used to create the models they were displaying. It seems as though most of the apps I clicked on though were simply rendering a model although there was the race car app which seemed to malfunction when I tried to run it. So all these apps were made using javascript? All the example’s code that I peaked at were javascript nested inside html. I knew javascript was capable of making some simpler games but I didnt know it could make games like the ones you have shown me today.

“There is very little difference between “apps” and “web apps”. The major difference is running in the browser, but increasingly this not even the case and a lot of the apps you download are just portals to view web apps.”

If this is the case wouldnt it be true these apps you are referring to wouldn’t be able to run without internet access? I am looking to program for the android too by the way so I would be learning java. Tanks for all your help by the way!

I didn’t make that. I just use it for visual communication with people across the internet. It should have made a private meeting, so unless you gave your link to someone else nobody messed with it :slight_smile:

Yes, that library is for 3D Rendering in Javascript. Individual developers can do what they want with it. Just 3D Presentations, like what you mostly saw, or full fledged games. I have seen some game demos using it in the past, but I don’t know any names or links of the top of my head.

Yes, that’s all Javascript. HTML just provides structure for a page. Since you’re already doing CodeAcedemy stuff I highly suggest the HTML/CSS course whether you want to do web pages or not.

Javascript apps don’t require internet access at all, just most of the things built using it do. If that makes sense. You can build a Javascript app that runs completely from files on your computer, but most people host those files on a server so you can access them from the internet. A lot of javascript apps also tend to send and receive information from the remote server.

Interesting do you know of any articles or sources that discuss this? I get the jist of what you are saying I just feel like every time I hear anything about javascript it contradicts what others have told me.

No. I think you might have misunderstood me.

My suggestion is to just start making stuff. Here’s a quick 7minute video I found: https://www.youtube.com/watch?v=vjPIDX-itvc
Once you do this, you can disconnect from the internet and run the file completely from your local computer.

Maybe you would enjoy making a javascript based game?

http://www.sitepoint.com/javascript-game-programming-using-phaser/

Nice video! very helpful I was under the impression html was only used for assisting the browser in interpreting javascript but that was a great video thanks!