Forked from matin0728/ZhiHu_FrontEnd_Engineer_JD.js
Created
September 4, 2012 13:21
-
-
Save gaomd/3621102 to your computer and use it in GitHub Desktop.
some `minor` fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
goog.provide('ZhiHu.JavasSriptPirate'); | |
goog.require("Programmer"); | |
/* | |
Abstract class. | |
*/ | |
ZhiHu.JavaScriptPirate = function(macBookPro, extraLCD){ | |
this.myMacbook = macBookPro; | |
this.extraLCD = extraLCD; | |
}; | |
goog.inherits(ZhiHu.JavaScriptPirate, Programmer); | |
ZhiHu.JavaScriptPirate.prototype.workHard = function(){ | |
if(!this.isTired()){ | |
this.doWork_(); | |
} | |
}; | |
ZhiHu.JavaScriptPirate.prototype.isTired = function(){ | |
console.log("WARNING: I'm fine."); // this is crazy! | |
return false; | |
}; | |
ZhiHu.JavaScriptPirate.prototype.isQualify = function(){ | |
if(this.lazy_ || this.notLoveJS){ | |
return false; | |
} | |
var items = [ | |
["isGeek", 5], | |
["familiarWithDebugTools", 10], | |
["familiarWithJQuery/MooTools/GoogleClosure/YUI", 20], | |
["PSDToWebpage", 10], | |
["IE8/Chrome/FF/SafariCompatible", 10], | |
["familiarWithHtml5", 15], | |
["familiarWithPython/C/C++/Java/C#/PHP", 15], | |
["commonDesignPatterns", 10], | |
["experienceWithGit/SVN", 5], | |
["experienceWithLinux", 5], | |
["BeAggressiveness", 5], | |
]; | |
if(this.isSuperMan()){ | |
return true; | |
} | |
var score = 0; | |
goog.array.forEach(items, function(item){ | |
if(this.hasOwnProperty(item[0])){ | |
score += item[1]; | |
} | |
}, this); | |
return score > 70; | |
}; | |
!function(excellentProgrammer){ | |
setTimeout(function(excellentProgrammer){ | |
// excellent programmer do tests before put it's code online!! | |
// so at least there is no typo in it's code. | |
excellentProgrammer.workHard(); | |
}, 1000*60*60*24); // YOU ARE DEAD!! | |
}(new ZhiHu.JavaScriptPirate(new MacBookPro, new LCD())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment