Boundaries in code

Categories: blog



Messy code, and eating spaghetti

Ah, first comment in years. I’m glad I got criticised about my code. Opened up my eyes (barely, it’s hard to open with pseudomembrane in it) to it and put some thought into it.

Time after time, hacking away at the source code, I got disillusioned and went off on my search for the almost perfect way to build stuff.  I tried using rapyd, didn’t work. Too much constraint or I’m too lazy to customise it. Either way, I build and build until I’ve blurred the boundaries between view and controller (application logic) in my code. I kept putting HTMLs in controller and by the time I realised it, the file is bloated beyond belief.

"The CSS were horrendous", said my boss. "Yeah". I keep building stuff and hack away to find compatibility and consistency between browsers, and that is the result, HORRENDOUS CSS (or maybe its because I didn’t take some time out and take an overview on stuffs). It’s hard, with all of the adjust it now, here and there. Ah, so much stuff to do (and yet I’m blogging).

There’s one time, on a very small project (memo system). The dude keep pushing me to finish it, my eyes can barely open (I was sick at that time), and errors keep popping out after it is finished. Script tags without php (<?) in it raises errors all over the place on easyphp, oddly enough xampp doesn’t raise any errors (maybe it’s a bit forgiving, by setting the error level a bit low).

Note to self: When engulfed, take a step back and take a look at it, an overview of things and Unwind the spaghetti!

Of work, syntax highlighting and It’s good to be back!

Categories: blog

I’m back in the office! Oh yeah, feels good to be on my feet, back in action. As The Big Noob would say, "Hello, it’s good to be back".

I start off with doing some work, gotta catch up the pace (TWO weeks worth of work). I did some minor javascript adjustment to suit IE6 (I have IE7 on another Windows XP through VMware), apparently I cant use variable on the fly, I have to declare it first var variable_name = ”; after declaring it then will I only will be able to use it. *shrugs* Probably some uber web developer out there says "Hah! Noob!", but I’m sort of a language dilettantes. Jack of Trade, Master of None. I would like to be a master, but my focus is always distorted by fast moving technologies and bandwagon that hit me straight on.

Other than that, I use SWFObject, instead of correctly using XHTML to display flash. Hrmm.

This blog is using GeSHi. As posted previously. That might change soon. I found a nice syntax highlighter on google code based on javascript. BUT, there’s a catch, it can’t display long line of codes (i.e. 10kb worth of text). It’s ok with me. I’m not in a habit of posting that much of code here anyway.

Syntax Highlighter

Looks good eh? Sure does to me. Before anyone frown and says, "just highlight syntax, WTF am I gonna do with it?". Simple, highlight your syntax. Combine small stuff like this to make bigger stuff. Just like the linux commands, awk, grep and other kind of commands combine it to make it much more powerful.

For me this is cool, this kind of thing might become bigger than we expect, any of us expect, to the way we do things. This is one of those stuff that will put most things on the web. For example Codepress, like Googledocs (formerly known as writely, yes, I’ve used writely when it is in its early stages), spreadsheets and other kind of stuffs. When I look at Codepress, I immediatly think about basecamp.

Do work anywhere kind of stuff, you dont have to install big chunky desktop application on every pc you want to work. Browsers are becoming more advanced and will be able to handle lots of stuff.

Form Layout with DLs!

Categories: blog

I still haven’t finish reading Designing with Web Standards by Jeffrey Zeldman due to my eyes being sick. But I’ve had alot of eye opener on structural markup and presentational markup, pragmatic way of doing things and such from the book.

There are still alot of people using table for forms. Table uses alot of bandwidth (thats what teh book says, heh, no really, it does). I use it for tabular data, displaying list of items and avoid using  it on forms or menu.

Enter DL (Definition List). It is the right job for it! 

Clagnut’s entry on form layout should give some idea about it. A List Apart, one of my main resource, also have an article on it, Practical CSS Layout.

Javascript, oh the choices!

Categories: blog

It seems my insight and choice were right. I moved from using mootools to jQuery. I just find jQuery elegant, easy. The docs were easy on the eyes, easy to understand and solves my problems quicker. It plays nicely with other framework (scriptaculous and mootools doesn’t playc nicely with each other).

To top it all, Digg is now using jQuery.

Of all the choices below, jQuery is going up the ladder. Sure YUI! has lots more stuff, but it is heavy. Dojo which some people put it in high regard also is heavy. GWT, oh man, i’ve gone through great lengths avoiding Java (except for processing, neat stuff) and I’m not gonna stop now.

SQLite’s creator, Dr Richard Hipp

Categories: blog

As usual, http://programming.reddit.com is one of my main source of news. Programming News!
After reading through the article (Size isn’t everything for the modest creator of SQLite), I have so much more respect for this guy, Dr Hipp. 

"It’s very clear to me that if I’d had any business sense whatsoever I
could have made a lot of money, but I don’t," he says. "I like to tell
people that we make enough to live fine in Charlotte, North Carolina.
We don’t make nearly enough money to live in London or San Francisco,
but we don’t live there so that’s OK," he adds - with a touch, just a
touch, of wistfulness.

This kind of thinking, and attitude is admirable. Hard to find.

I used SQLite for a small application that I did for UPM (University Putra Malaysia) for a certain faculty. I used visual basic and SQLite. Since it was a very small project I used SQLite for R&D. I can’t remember which version though, 2 or 3.

Firefox 3 will be using SQLite, Apple Mail uses it for indexing messages, Google Gears, Symbian OS 9.5. Single user implementation will most probably be using  alot of SQLite (for example the Apple Mail).

Interesting indeed. For me that is.

New Development Methods!

Categories: blog

After my eyes were healthy again, my vision have increased. I started to open back http://programming.reddit.com

Asshold Driven Development and other list of methods, anti-methods I guess, discussed by the reddit community. Thankfully I’m in a small company, even though the pay is a bit little, but decisions are taken together and not alone.

TWO weeks of suffering

Categories: blog

Yes, I’m finally back. My eyes are healthy but not as healthy as it can be, but still, my right eye is still blurry. My left eye were diagnosed with allergic reaction, bacterial infection and dry-eyes. 3 in 1 like instant nescafe packets.

After a week or so, it goes to my right eye, but not all three, just the infection. Its common, thats what the doc says. I’ll have to take on my boss’s offer next time he wants to sent me to a private specialist. The ordeal should be over in 3-4 days if it were a private medical center, why? They should be able to clean the eyes all the time and take care of it. Fast recovery, like DotA’s new hero, Huskar the Sacred Warrior.

In the first week of suffering, I have imagined the worst. Braced for the impact. That there’s a possibility that I’ll go blind. I was thinking, damn, this’ll take me back a few month or a year. I’ll have to go to Braille school or something.
 

Thankfully its over. I’ll be ever vigilant ever careful with my eyes. Tissues only! no fingertips!

Damn, can’t make it to #myoss meetup, and some jQuery stuffs

Categories: Troubleshoot, blog

I can’t remember what I searched for in the CI’s (Codeigniter) forum, but I the result let me to a BlueFlame project (which turns out to be Kohana Framework, a fork of CI). I haven’t gone into Kohana yet, maybe later this weekend. So anyway, I went to the Kohana link and found an interesting video, How Open Source Projects Survive Poisonous People (And You Can Too).

I mentioned about it in #myoss on freenode, and the result. Yeay, +1 reputation for me (D&D style). I got a bad rep (-5 rep) because I was hanging around in the channel and doing nothing "serious" like replicating database for scalable means, whatever it is. Oh yeah, and I mentioned a spoiler for heroes FINALE (and I thought everyone have watched it), my bad :(

There’s a myoss meetup coming up. It is far, it’s held on Thursday and at 7.30pm. Being a traditional kind of guy, I cant make it at that time, since its tradition(myoss meetup), best not change things the way there are eh? You know these buses, sometime they come early sometime late. Traveling to KL will take me 2 hour min at 6pm or 5pm with all the traffic. Hrm, I’ll have to pass, even though I’m interested in the discussion  Wavelet.biz - Leverage On Open Source Technology to Win Projects by Vincent Lee.

I hope, i’m not out of context here, but I stumbled upon an article, interesting nonetheless, Why Software Vendors should consider Open Source, while reading up on 10 things to consider when choosing an Ajax Framework.

Oh yeah, as I was working on some project at work, I wanted to cancel an animation (or stop an animation, whichever you prefer to call it) after it started (the animation duration is 10 seconds) in jQuery. I searched through the discussion and forums. Most points to a bug report. After digging a little bit after that, I was lead to jQuery’s 1.2 roadmap page. There it is, on the list, stop animation. I did a workaround, instead of piling up the item and fade it all out, I just put each item and fade each one.

Ah.. all in a days work. Tomorrow an applicant for junior programmer will show up. I’m eager to see what the result is.

I must retreat to my inner sanctum. Farewell.

*note: dashing not producing enough interesting picture, must find something else.

Powered by WordPress with GimpStyle Theme design by Horacio Bella.
Entries and comments feeds. Valid XHTML and CSS.