|
|
|
|
Thread title: Why is JavaScript so confusing? |
|
|
|
|
|
Thread tools
Search this thread
Display Modes
|
|
06-27-2008, 07:22 AM
|
#1
|
Status: Member
Join date: Aug 2007
Location: SF
Expertise: Coder
Software: Sublime Text, Google Chrome
Posts: 211
|
Why is JavaScript so confusing?
Title says it all, I buy books and get about a third through and I am completely lost. XHTML and CSS is a breeze, but taking on this language just seems so confusing to me. Does anyone have anything that could point me in the right direction?
I'm pretty sure I'm not the only one...
|
|
06-27-2008, 07:30 AM
|
#2
|
Status: Request a custom title
Join date: Dec 2005
Location: Arizona
Expertise:
Software:
Posts: 5,200
|
You just have to get used to it. Don't even try to begin comparing JS and XHTML/CSS. JS is a programming language (to put it simply, even though it's not exactly), while XHTML/CSS is markup. You just have to get into the mindset and learn the syntax.
For me, JS isn't hard, it's just getting used to the DOM and debugging. JS has a horrible reputation, for me, for being very difficult to debug since a lot of the errors by plugins and programs such as Firebug are sometimes really vague and don't give you ful information.
|
|
06-27-2008, 06:11 PM
|
#3
|
Status: I'm new around here
Join date: Jun 2008
Location:
Expertise:
Software:
Posts: 1
|
Debugging JavaScript can be a huge pain. I have used Firebug and that helps. IE 8 Beta has a JS debugger that is not so great... I believe VS 2008 will have a good one but I have to give that a try.
For a lot of JS work I do now a days I use JQuery. It really cuts down on how many lines it takes to do stuff.
Good luck
|
|
06-27-2008, 06:24 PM
|
#4
|
Status: Junior Member
Join date: May 2007
Location:
Expertise:
Software:
Posts: 26
|
i hope when your reading these books that you practice what you are being taught, i learnt javascript in college a good few months back and the main success to my learning was practice using the stuff and problem solving, how you would go about writing a certain program and what javascript elements would you need.
I personally think you should try get stuck into plain Java before javascript, reason being is that javascript is mainly used in conjunction with XHTML/CSS and therefore could be overwhelming at a first glance.
Hope things go well for you! Good luck!
|
|
06-27-2008, 06:28 PM
|
#5
|
Status: Member
Join date: Dec 2007
Location: Liverpool, UK
Expertise:
Software:
Posts: 287
|
Originally Posted by Seanneo
i hope when your reading these books that you practice what you are being taught, i learnt javascript in college a good few months back and the main success to my learning was practice using the stuff and problem solving, how you would go about writing a certain program and what javascript elements would you need.
I personally think you should try get stuck into plain Java before javascript, reason being is that javascript is mainly used in conjunction with XHTML/CSS and therefore could be overwhelming at a first glance.
Hope things go well for you! Good luck!
|
and how the hell would writing Java be easier?
It's a much more advanced language and it's usage is completely different to JS.
|
|
06-27-2008, 07:44 PM
|
#6
|
Status: Junior Member
Join date: May 2007
Location:
Expertise:
Software:
Posts: 26
|
Originally Posted by Liam
and how the hell would writing Java be easier?
It's a much more advanced language and it's usage is completely different to JS.
|
This is very true it is more advanced, but it is a great language to learn when you are starting out programming as it gives you a very good basis on how programming works.
The reason I said this was because most javascript books will talk about XHTML/CSS as well, where as Java would be completely separate, and therefore wouldn't be as daunting as trying to apply a new language immediatly into the old one(which are completely different).
I speak from experience, this worked for me(not saying it will work for everyone), once I had learnt Java, Javascript was a doddle, I just had to learn how to apply it to xhtml/css.
|
|
06-27-2008, 08:24 PM
|
#7
|
Status: Request a custom title
Join date: Dec 2005
Location: Arizona
Expertise:
Software:
Posts: 5,200
|
If you are starting programming, don't use Java. It's one of the more complex languages, and I would suggest using PHP, as the syntax in relation to JS is VERY similar, and it's an easier language to learn. However, seeing as JS is not even close to being similar to any of those languages, just learn JS on your own first. Then, if you want, learn a real programming language.
|
|
07-07-2008, 06:40 AM
|
#8
|
Status: Waving
Join date: Aug 2005
Location:
Expertise:
Software:
Posts: 2,694
|
Jake, if only you asked me, I would have came over and helped you out. Although now that your in Seattle, we'll have to wait.
In my opinion, JavaScript is hard at first because well, like any language, the syntax is different and you don't know any of the functions. JavaScript is very different from all the different programming languages. It's not a backend, nor is it a front end (in terms of programming.)
|
|
07-07-2008, 10:53 PM
|
#9
|
Status: Member
Join date: Apr 2006
Location:
Expertise:
Software:
Posts: 249
|
Ok, I can understand both Seanneo and Andrews way of thinking. However, if it were me. I'd go with what Seanneo said if you ever plan on expanding your knowledge into other (more advanced) programming languages. While learning PHP's syntax may be the easiest, it will get you into some bad habits and you won't learn much about data types. However, if it's simply the syntax your stuck on, it may or may not help anyway.
If you want to learn JavaScript, you're best bet is to think of some small projects and break it down into steps; then Google.
Lets say you want to build a calculator where you type in "x+x" and JavaScript solves it.
You would need first need to get the text input's value.
Separate the two numbers.
Make sure the two numbers are integers and is not a string.
Add the two numbers.
Display the results.
xHTML/CSS (as said) is more of a markup while JavaScript is also Client Side, it's more of a programming language. PHP, on the other hand, is a server side programming language.
Hope this helps,
- Phaaze
|
|
07-20-2008, 08:51 PM
|
#10
|
Status: Junior Member
Join date: Jul 2008
Location: Abilene TX
Expertise: Design, PHP, JS, HTML5, CSS3
Software:
Posts: 37
|
I agree that PHP is pretty similar in syntax to Javascript, which in some ways makes things easier. On the other hand, it can be easy to forget which you're working in and use the wrong syntax (even though one is user-end and one is server-end... call me dumb if you want). And, as Phaaze pointed out, PHP lets you do some things so easily that you can develop bad habits.
My first exposure to real programming (ie: not QBASIC) was C++, and I remember that for the first couple of weeks in that class, we didn't write an ounce of actual code. We just wrote pseudo-code (like Phaaze did in his example above) and learned the concepts of if/then/else statements, for and while loops, arrays, etc. That was probably the single most valuable part of my college experience (at least as far as education is concerned...).
If you can find a good book on general programming concepts or get someone who is a programmer (matters not what language) to explain some basic concepts, I think it will help you a lot. Javascript can be confusing enough anyway, so at least understanding some basic vocabulary and concepts will go a long way.
--Josh
|
|
|
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|