KWPro.net

Very Productive At Work
By: conark
Published On: 2-14-2008

Man, you should've seen the amount of code I spat out today.  Tons of AJAX/JQuery stuff.  Most of it is CRUD with AJAX, but I'm about to build a kind of webtop application that utilizes a great deal of interactive elements with javascript, CSS, and AJAX for handling some administrative tasks.  I'm quite happy with the code I've got at work.  For instance, my average JQuery function call is around 4 lines while the organization of the code is working out quite well.  Stylistically, I've got things done in such a way that my code is EXTREMELY clean cut.  Not sure if it's the most optimal, but my application doesn't have extreme performance requirements.

Another aspect I got to work with recently is the Reflection API in PHP.  I do some quirky things where I have my authorization piece defined as a combination of the controller name and the action name (where the action part is handled via convention in the Zend Framework).  From a search prompt, you can enter the name of an application and it will examine for the controller directories of the application.  Then using Reflection, I am able to query the controller for public methods.  From there, I reconstruct the authorization permission name and am able to display it.  It's quite cool actually because I don't have to manually run all these insert SQL commands to put the permissions into the database.

Also, in the future, I'm hoping to write some web services for Bugzilla, PhpMyAdmin and MediaWiki to create permissions and user accounts from my system.  User management is a royal pain in the butt when you have disparate applications containing their own proprietary form of entitlements.  I hope to unify these aspects through my administration application and make granting access easier to these applications.

Then my boss and I did a little interesting experiment where we compared the performance of different slurp methods with Perl.  We tried using one of the slurp modules as well as this little Perl idiom:

open (<$fh>, "somefile.txt") || die $!;
my $txt = do { local $; <$fh>; };
close <$fh>;

Found out that this piece of code runs REALLY fast.  The way he was doing it was building an array using map.  However, my theory is that when you're reading a file in line-by-line, it's more memory/IO intensive, compared to storing the whole content into a scalar value.  I think in the former case, because you're building a data structure, it's also slower.  We tried each scenario with a file around 143 MB.  The code above ran at 2 seconds compared to the other routines, which all ran slower.

I swear, it's a totally different world than being at the Anti-Productive company (i.e. HLIKK).  I get so much done at work these days.  Heck, I have to force myself to leave because my work can be so interesting at times.  Considering I've been here only a little over 4 months, I've accomplished a lot and learned a tremendous amount.  It makes me wonder how much more I can produce in a year's time?

AddThis Social Bookmark Button Sphere: Related Content

Trackbacks: (Trackback URL)

No Comments Posted Yet
July [August] September
Sun Mon Tue Wed Thu Fri Sat
31 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31 1 2 3