Go Back   SitePoint Forums > Forum Index > Program Your Site > JavaScript
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
Reply
 
Thread Tools Display Modes
Old Oct 7, 2008, 09:39   #1
JimmyP
Array Popper
 
JimmyP's Avatar
 
Join Date: Aug 2007
Location: Hampton, UK
Posts: 1,973
Notice: This is a discussion thread for comments about the SitePoint article, Douglas Crockford: JavaScript Doesn’t Suck.
__________

Very nice interview! Mr. Crockford is one of the people in this industry who I really respect!
JimmyP is offline   Reply With Quote
Old Oct 7, 2008, 11:04   #2
fsav
SitePoint Enthusiast
 
Join Date: Oct 2008
Posts: 32
"JavaScript doesn't suck": Well it's not so terrible once you make some choices, but there are just so many ways one can skin the OOP cat in JavaScript, so many base libraries etc., it's a bit frustrating/confusing for someone coming from other languages.

My own vague negative feeling also has to do with the general perception of "good coding practices": I've not done so for long, but hanging out in JS forums the topic seems much less interesting to other coders than in other languages (it's kind of an obsession for me. Heck I've developed my own JS syntactic sugar to check types and interfaces :P ).
fsav is offline   Reply With Quote
Old Oct 7, 2008, 15:29   #3
pmw57
Unobtrusively zen
 
pmw57's Avatar
 
Join Date: Jan 2007
Location: Christchurch
Posts: 4,987
Good coding practices are important, but the sad thing is that some of the forum visitors just don't want to know about it. THey just want their bad code that was obtained from elsewhere, to just work.

In such cases there isn't much that you can do to improve things, other than help them to get it working and then perhaps later on cover how it can be improved.

One of the directions I want to move more towards is in writing more easily readable code. One of the conventions that Douglas Crockford pushes for is that functions must be defined before they're used, but that makes it harder to read the code. When the code starts with the main function and below it hang the smaller supplementary functions, it's much easier to follow the flow of the code in that manner.

There is a book review of Clean Code that you might want to look at. As I work my way through the book I'm finding a lot of things that I fully agree with, and want to implement what it has to say in my daily coding.
pmw57 is online now   Reply With Quote
Old Oct 7, 2008, 23:44   #4
loganathan
SitePoint Member
 
loganathan's Avatar
 
Join Date: Nov 2005
Location: Vellore-Chennai-TN
Posts: 15
looks good about javascript
loganathan is offline   Reply With Quote
Old Oct 7, 2008, 23:54   #5
skunkbad
SitePoint Zealot
 
skunkbad's Avatar
 
Join Date: Apr 2008
Location: Temecula, CA
Posts: 164
Nice article. I think javascript is fun, especially since it is very php-like in terms of syntax, making it easy to learn for me (because I learned php first). I learned from Thau's 'The Book of Javascript'. I'd like to know more about javascript, so I'll take a look at Crockford's new book the next I go to the bookstore.
skunkbad is offline   Reply With Quote
Old Oct 8, 2008, 05:35   #6
Andrei Railean
SitePoint Community Guest
 
Posts: n/a
Douglas Crockford gave a short talk about JavaScript at the Australian Yahoo! office (Yahoo!7) while on his visit for Web Directions. That talk and Dmitry's Raphael library have ignited my desire to dive deeper into JS.

The most important thing that I realised from Douglas' talk at Y! was that we've done so much progress exactly because JS has not changed. Good or Bad features, people have worked with them to create beautiful solutions. That would have been impossible if the language were always changing. When asked about JSON, Douglas said that it will never change. JSON doesn't have a version number exactly for longevity reasons. I guess if it's changed, it's no longer JSON, although allowing a comma after the last item of the array would be nice. :)

Universities should teach JavaScript as a first programming language because it's the most popular language in the world.
  Reply With Quote
Old Oct 8, 2008, 13:56   #7
fsav
SitePoint Enthusiast
 
Join Date: Oct 2008
Posts: 32
@pmw57: I agree about most people wanting their code to just work, at least that's what I see. The fact is, the real benefit of good coding practice come when the codebase grows larger, not when the script is 10-100 lines long.

So, I guess coming from a background in Web design where JavaScript seems complementary rather than the main tool, most coders don't care. Only a minority end up developing Gmail-sized apps :P

And thanks for the link. There are indeed some interesting ideas in there.
fsav is offline   Reply With Quote
Old Oct 23, 2008, 17:09   #8
OmenKing
SitePoint Member
 
Join Date: Jun 2007
Posts: 3
I dreaded javascript, but once Firebug and the Prototype JS Framework came out it wasn't as painful anymore. Javascript is still a large hurdle for people.
OmenKing is offline   Reply With Quote
Old Oct 24, 2008, 03:00   #9
sherl0ck
SitePoint Zealot
 
sherl0ck's Avatar
 
Join Date: Aug 2008
Posts: 124
Crockford is like a javascript GOD
I will agree on everything he says about javascript
sherl0ck is offline   Reply With Quote
Old Oct 24, 2008, 15:53   #10
pmw57
Unobtrusively zen
 
pmw57's Avatar
 
Join Date: Jan 2007
Location: Christchurch
Posts: 4,987
I am close to agreeing with you there.
There is only one thing that I am dubious about with Doug and that's on the ordering of functions. He wants functions ordered so that the functions that are required by other functions appear first above the other functions that require them.

The difficulty that I have with this is that it make it harder to read and understand the code, because it is difficult to gain any context until you are further down through the code.

I do realise that it's supposed to help javascript in some way, but I feel that there is a conflict between helping the compiler and helping the next person who comes along to use your code.
pmw57 is online now   Reply With Quote
Reply

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 17:24.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved