JavaScript for C# developers: some refactoring
I just published a blog post on my DevExpress ctodx blog about taking some non-idiomatic JavaScript code (actually from a DevExpress CodeCentral example program) and refactoring it to follow JavaScript best practices.
Topics covered include:
- Minimizing the global namespace pollution
- Using triple-equals instead of double-equals for comparisons
- Function scoping
- Passing JSLint tests by using declaration-first
Take a look!
Now playing:
Nightmares On Wax - Morse
(from Carboot Soul)





2 Responses
Marcel Doru Popescu said...
Good article, but I spent far too little time reading it and far too much being annoyed that the text is wider than the page (and thus the last words on each row, except for the first paragraph, are not visible). I tested it on three browser, so I doubt it was on my side.
julian m bucknall said...
Marcel: Yeah, it was all screwed up. I noticed it late last night and spent some time fixing it. It's now looking as I wanted it to in the first place.
Cheers, Julian
Leave a Response