Tuesday

JavaScript Timing Errors, Generics, PHP Login System

 
 Programming
 
From Scott Orgera, your About Programming Editor
 
 
So you've written the perfect snippet of JavaScript code, yet you're still getting errors at execution time. As with many things in life, the problem could lie in the timing. In this week's newsletter we show you how to ensure that your JavaScript is running at the right time. We also delve into forming command line arguments in Ruby, discuss how to prevent inheritance in Java, walk through creating a simple login script using PHP, and much more...
 
Follow us on:
 
Sign up for more free newsletters:
 
Java: How to Prevent Inheritance
There can be times when designing a class where it's desirable to prevent inheritance by another class. These situations arise when a class is likely to be used by other programmers, and any subclasses created could cause problems. The main reason to prevent inheritance is to make sure the way a class behaves is not corrupted by a subclass.  READ NOW

JavaScript Testing: Timing Errors
One common cause of errors in JavaScript is timing, where the code would do the right thing if it were run at the right time.  This particular sort of error does not exist for server-side languages, since there the script isn't interacting directly with the Web page. Most JavaScript does interact with the Web page, however.  Therefore, what parts of the Web page are or are not loaded at the time your code runs will make a big difference in whether or not it will work. Timing issues with JavaScript have always existed, but the most common are scripts running too soon to be able to accomplish what is required.  READ NOW

Forming Command Line Arguments in Ruby
Many Ruby scripts have no text or graphical interfaces. They simply run, do their job and then exit. To communicate with these scripts in order to change their behavior, command line arguments must be used. This is the standard mode of operation for UNIX commands and since Ruby is used widely on UNIX and UNIX-like systems (such as Linux and OS X), it's pretty standard to encounter this type of program.  READ NOW

Generics:  Cleaner Data, Faster Code
Generics didn't exist at all in the first version of VB.NET, but they're the starting point for sophisticated features in later versions. This is another concept, like Try-Catch structures, that has been borrowed after proving itself in languages like C++. This article starts at the beginning and explains what generics are all about. 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