|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Array Popper
![]() ![]() ![]() ![]() ![]() ![]() 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! |
|
|
|
|
|
#2 |
|
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 ). |
|
|
|
|
|
#3 |
|
Unobtrusively zen
![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
|
|
#4 |
|
SitePoint Member
Join Date: Nov 2005
Location: Vellore-Chennai-TN
Posts: 15
|
looks good about javascript
|
|
|
|
|
|
#5 |
|
SitePoint Zealot
![]() ![]() 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.
|
|
|
|
|
|
#6 |
|
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. |
|
|
|
#7 |
|
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. |
|
|
|
|
|
#8 |
|
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.
|
|
|
|
|
|
#9 |
|
SitePoint Zealot
![]() ![]() Join Date: Aug 2008
Posts: 124
|
Crockford is like a javascript GOD
I will agree on everything he says about javascript |
|
|
|
|
|
#10 |
|
Unobtrusively zen
![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 17:24.









Linear Mode
