Thứ Ba, 28 tháng 10, 2014

Constants, Global Variables, PHP Visitor Tracking

 
 Programming
 
From Scott Orgera, your About Programming Editor
 
 
No matter your level of expertise or the size of your project, programming is time consuming. There is no way around that fact. October's final newsletter is all about saving time -- whether it be by using constants in Java, arrays in Ruby or the quote word function in Perl.
 
Follow us on:
 
Sign up for more free newsletters:
 
Using Constants
There are several values in the real world which will never change. A square will always have four sides, PI to three decimal places will always be 3.142, and a day will always have 24 hours. These values remain constant. When writing a program it makes sense to represent them in the same way - as values that will not be modified once they have been assigned to a variable. These variables are known as constants.  READ NOW

Using Quote Word in Perl
Perl has a lot of handy, built-in shorthand for some of the more common expressions and structures. For example, a list is often made up of single words or elements, and writing all that data out in the normal fashion can quickly become cumbersome and difficult to read. The longer the list, the more you find yourself typing out commas and quotes to separate each element. Fortunately, Perl has a built-in quote word function that makes those single word lists easier to read and write.  READ NOW

How to Create Arrays in Ruby
Storing variables within variables is a common thing in Ruby and is often referred to as a data structure. There are many varieties of data structures, the most simple of which is the array. Programs often have to manage collections of variables. For example, a program that manages your calendar must have a list of the days of the week. Each day must be stored in a variable, and a list of them can be stored together in an array variable. Through that one array variable, you can access each of the days.  READ NOW

PHP: Visitor Tracking with Cookies
Cookies allow the Webmaster to store information about the site visitor on their computer, to be accessed again the next time they visit. One common use of cookies is to store your username and password so that you don't need to log in again each time you visit a website. Cookies can also store other things such as your name, last visit, shopping cart contents, etc. READ NOW

 
ADVERTISEMENT
Featured Articles
More from About.com
Sign up for Shareables!
An every-morning rundown of the day in history, with headlines and trends produced by your pals at About.com. Click here to sign up! It's free (of course) and we think you'll like it!
Want More From About.com?
Check out our social channels tailored to every interest!
Sign up for more free newsletters on your favorite topics

You are receiving this newsletter because you subscribed to the About.com Programming newsletter. If you wish to unsubscribe, please click here.

If you would like to unsubscribe from all newsletters sent from About.com, please send an email to optout@about.com with "Unsubscribe" as the subject line.

Contact Information:
1500 Broadway, 6th Floor
New York, NY, 10036

Privacy Policy © 2014 About.com

Không có nhận xét nào:

Đăng nhận xét