Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > BOOK: Beginning JavaScript and CSS Development with jQuery
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning JavaScript and CSS Development with jQuery
This is the forum to discuss the Wrox book Beginning JavaScript and CSS Development with jQuery by Richard York; ISBN: 9780470227794
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaScript and CSS Development with jQuery section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old July 1st, 2009, 08:10 PM
Authorized User
Points: 133, Level: 2
Points: 133, Level: 2 Points: 133, Level: 2 Points: 133, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2009
Posts: 26
Thanks: 0
Thanked 1 Time in 1 Post
Default javascript variable and file name rules in you sample codes

I am going to make jquery my javascript framework. So if I can, I want to get everything in good practice from day 1. And this book should be my reference by hands etc. Very good one.

Here are some questions

First, I noticed that in download codes, these javascript file names are with empty space and with upper case. I know it is from the book examples. But would that be better to use _ to replace empty space and make them all lower cases just like in real life projects?

Second, I notices that you name your javascript variables starting with dollar sign $, I didn't think about that before, and not saw many other programmers use this, but I think it is a good practice, specially for us php programmers. I am thinking about use that too in my javascript programming. Any other opinions you heard against using $ sign in the javascript variables?
Reply With Quote
  #2 (permalink)  
Old July 6th, 2009, 11:34 AM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts

The naming conventions used for files in the book are the ones I like to use in my live projects. So, if you don't like spaces or capitalization, use whatever makes sense to you. As for whether it's good practice, well, that's subjective to your own personal opinion.

As for using dollar signs in your JavaScript variables, some people like dollar signs in JavaScript variables, some don't. There isn't really any technical advantage either way.

I've heard that some people have gravitated toward using dollar signs to name global variables, and not using a dollar sign for variables created in local scope (i.e., within a function or class method). I think that probably makes more sense. But, like I said in the book, my own habits came from PHP.

I'm sorry for the late reply, BTW, I noticed your post, but forgot to reply.
Reply With Quote

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the license for the shopping cart sample codes? blackhorse66 BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8 8 November 12th, 2009 04:16 PM
Unable to download sample codes Beginning ASP Data ckm2003 Wrox Book Feedback 1 November 2nd, 2007 07:56 AM
Need some more sample codes t.m.sundaram Visual Basic 2005 Basics 0 July 16th, 2006 08:16 AM
beginning php4 sample codes viksapar Beginning PHP 1 September 16th, 2003 05:26 PM

All times are GMT -4. The time now is 11:42 AM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.