• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Javascript in times to come

 
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
While Stoyan is with us to answer our queries, I would like to ask this question. Not directly related to his book but a general question

In this forums someone wrote not many people know JavaScript and they just pretend or assume that they know JavaScript. Someone said people are just horrified about JavaScript but in fact they are horrified by something else like DOM or CSS or something. But JavaScript in itself is a very good and robust language.
My question is - What is the reason you think that in all these years people have not learned this language?
I can think of two things. Please give your opinions on this and more reasons you can think of
1) Even now, I think that Javascript is used just for doing some validations, handle some events(mostly limited to onLoad,Onclick, onUnload, onFocus,Onblur, onSubmit etc,) and do some look and feel stuff like CSS manipulation etc. Normally we don�t create many objects with any relationship between them etc. We hardly code any business logic there. If it goes to the level of too much coding then we try to refactor the code and move it to Java classes. The guiding principle is this � �Not much coding in JavaScript�

Do you think in the times to come this will change? Will we be writing voluminous code in Javascript?

2) Debugging is very difficult. Now a days firebug is there but most of the people today don�t know how to use it. In my case our users are just IE6 users, so we don�t even bother about cross browser compatibility. And for debugging we use pop-up alerts.

I think books like yours� will help people learning this tool.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that the principle reason that people have avoided JavaScript is fear.

A lot of page authors are not technical and come from a design or artistic background. Coding of any kind is new to them and so they rely upon cut-and-paste without really understanding the code, or allow tools such as DreamWeaver to generate it for them.

Another class of page author is technical with a C#, C++ and/or Java background. JavaScript gets them into trouble because they have no background in functional languages and so they try to treat JavaScript like Java and get frustrated when it doesn't do what they expect. I mean, how many people started out by learning Erlang or Haskell?

And then there are the php authors with similar challenges.

The vagaries of the DOM, cross-browser issues, and the debugging debacle (getting better and better every day) also add to the fear.

The barrier to entry for JavaScript is low. All you need is a text editor and a browser. So many people never step beyond their comfort level in order to learn the in and outs of the language.
[ August 28, 2008: Message edited by: Bear Bibeault ]
 
Paras Jain
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bear I agree with what you said. But won't you agree that people don't even needed to learn this language?
What ever little event handling, validation etc they needed they got by some means or others.
In the AJAX and Web2.0 era people people are realising the importance of the language but still I don't think we are going to write any thing major in JavaScript.

We are using JQuery in our current proj. But in all the projects I worked so far we use to have a handful of .js files which we include on the top of our JSPs and use the existing functions for validation, formatting and stuff.

Are we going to code anything more complicated than this? Like creating domain or business objects and doing stuff with them.
While I understand the that you can't foretell future but at least guess the upcoming trends

[ August 28, 2008: Message edited by: Paras Jain ]
[ August 28, 2008: Message edited by: Paras Jain ]
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I posted in another topic, even when using jQuery or any other library, I think that it's essential to understand JavaScript. Especially with jQuery, if you don't have a good handle on function contexts, closures, and other JavaScript concepts, your code is not going to use jQuery to its fullest extent.

And what about when things go wrong? How do you debug code you don't understand?

When the cut-and-pasters and DreamWeaver enthusiasts hit such debacles, all they can do is throw up their hands in horror and try to seek someone else to solve their problems. That's not "development" to me.

The same goes for the server side. Some users of tools like JSF (shudder), Struts, Spring and the like think that they can get away without having to understand basic Java and Servlet and JSP concepts. Not so.

Understanding the underlying technology is essential to effectively using the tools that are built upon them.

Otherwise, you're just a mechanic, not a developer/engineer.
[ August 28, 2008: Message edited by: Bear Bibeault ]
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Bear Bibeault:
A lot of page authors are not technical and come from a design or artistic background. Coding of any kind is new to them and so they rely upon cut-and-paste without really understanding the code, or allow tools such as DreamWeaver to generate it for them.

And if you google your question "How do I do X in Javascript?" you can see the results of ten or twelve years of that sort of thing. You'll get links to all kinds of things. Many of them are hacks which help you to make your code work in Netscape 4 or Internet Explorer 4. The unwary beginner could easily waste a lot of time by using those things.

I was a Javascript beginner not that long ago, but not an unwary one. It didn't take me long before I realized that Google was leading me into a swamp. So I bought the Rhino book and worked my way through it.

For a lot of web pages, Javascript is an after-thought. It's just something like salt and pepper, you just need a little bit of it to make your page work right, so you just grab the shaker and sprinkle a little bit on. I think that's why people don't take it seriously, and that's why they just go hunting code snippets on the Internet.
 
author
Posts: 85
5
PHP
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Paul - this is so true about web hunting for "how do I do X", there is just so much bad code out there. I hope with time it will pass. I'm an optimist, because it used to be true about the JavaScript books too, most of them were exceptionally bad, today it's even embarrassing to look at their code. But the new generation of JavaScript books is much, much better. So things change for the better. Google (and other search engines) are driven by inertia, the older the site, the more established it looks and has acquired a lot of inlinks, which is the currency search engines use to judge quality. All we have to do now is outrank the old sites, just blog and push quality content out there for the next 10 years

@Paras, while it's true that there is a limit of how much logic you can have public (JS is plain text on the client), it's not true that there aren't big JS applications. Just the opposite, there are many examples of client-heavy, or fat client applications and this is a trend. I think I even saw some stats about the shear size (in KB) of the JS code in popular sites, and it's going up.

Plus I find the JS language is a sweet deal, because you can code a bunch of different programs with it. Other than the browser you can do shell scripting, server-side scripting, software extensions, I mean take Firebug - it's all written in JavaScript as all Firefox extensions are. Like "learn once, write everywhere"

If you haven't seen this essay by Douglas Crockford, it's worth reading: JavaScript: The World's Most Misunderstood Programming Language.
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[Edit: thread hijack removed. Please ask your own questions in a new topic]
[ August 29, 2008: Message edited by: Bear Bibeault ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic