Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Three ways to define class in JavaScript

In object oriented programming, class is the template of object, it defines the properties and methods of a group of objects. Unfortunately, JavaScript doesn't support class, but we can have some workarounds to simulate class.1. Constructor functionThis is the classical approach, it is also the approach mentioned in many text books. It uses the constructor function to simulate class and it uses the keyword this to represent the object internally.function Cat() {  this.name = "Kelly";}when creating the instance, use the new keyword.var cat1=new Cat();alert(cat1.name); //KellyThe p...

11,792 0       JAVASCRIPT METHOD CLASS INHERITANCE PRIVATE


  How I Became a Programmer

I posted a very brief response to a post on HackerNews yesterday challenging the notion that 8 weeks of guided tutelage on Ruby on Rails is not going to produce someone who you might consider a "junior RoR developer." It did not garner many upvotes so I figured that like most conversation on the Internet it faded into the general ambient chatter. Imagine my surprise when I woke up to couple handfuls' worth of emails from around the world asking me what I did, how I did it, and how I got a job. I'm assuming, judging by the relatively small amount of mail I got from a random ...

8,901 0       METHOD PROGRAMMER ADVICE STUDY


  How to hide PHP Notice & Warning Messages

How to hide PHP Notice & Warning Messages. The PHP notice errors are frustrating and you are tired of seeing them when you are working on your scripts. They are showed at the beggining of your pages and may reveal confidential information to the visitor like the path to the file or the php file name in some cases.// Turn off all error reportingerror_reporting(0);// Report simple running errorserror_reporting(E_ERROR | E_WARNING | E_PARSE);// Reporting E_NOTICE can be good too (to report uninitialized// variables or catch variable name misspellings ...)error_reporting(E_ERROR | E_WARNING | ...

7,047 0       PHP METHOD ERROR WARNING DEPRECATED HIDING


  How NOT to teach a computer language

For the past year or so my wife has been taking online classes to get a computer science degree. For most of her classes she’s done great, she’s been flying through HTML and SQL, even up to the point where she can handle multilevel joins and optimizing through indexes. That was until she hit her vb.net class. I had no idea why she was having problems with a language has easy as vb.net so I started helping her out and find out why she was having so many problems. I’ve also added some recommendations in case you have the same problems, hopefully these will help you out. (Nam...

2,349 0       METHOD PROGRAMMING COMPUTER BOOK TEACH GRADE


  That’s Not TDD

A few months ago I was visiting a client who was having a lot of problems using TDD.“It takes over half an hour to run our unit tests,” he said.“You are not doing TDD,” I said. “In order for tests to be valuable all of them must run fast—within a few seconds, or developers will stop running tests frequently.”“But how to I make them run fast?” he asked, “Just connecting to the database takes 30 seconds”So I showed him a technique called Dependency Injections that allowed him to insert a mock object instead of the database. â€...

2,808 0       METHOD DRIVER TDD QA MODEL UNCONTROL


  A return to good code

Stop doing this:public boolean foo() { if (true) {   return true;   }  else {   return false;   }}It always amazes me when I dig into an open source project, and I see code written by supposed experts, and reviewed by seasoned professionals, and nobody slaps the wrists of the developer who shoves return statements right in the middle of a method.Tell me, how hard is it to do this:public boolean foo() {   boolean flag = true;   if (true) {    flag=true; }   else {   flag=...

2,322 0       JAVA CODE METHOD RETURN CONDITION