Sunday, March 2, 2008

TestCase 2.0-alpha is out

As I mentioned the TestCase project is going to be framework independent and now it is.

I've just released the version 2.0-alpha of the project. Functionally it's the same TestCase v 1.0, but the project had some major internal changes so now it runs on its own.

The project is designed such a way that it won't affect any framework stuffs, so you can safely use it with any of your projects. Use it with the lovely mootools or with jQuery if you wish so.

That's it, have fun.

Friday, February 22, 2008

Testing, Refactoring, Patterns

I'm going to invent new abbreviation now. Testing, Refactoring, Patterns or TRP. The holly trinity of any good programmer and I'm going to talk about this things today, because many young programmers "those days" don't get the sake of the things right.

First things first. Testing.
I'm pretty much sure that you've heard this, but I'll repeat, that there's no excuse to not use tests. I know, many people think that it takes quite a big overhead and so it's boring, etc. I myself used to think like that, but believe me, once you start testing you won't stop. Think about it, do you know anyone who used to be a good TDD adept and then gave it up? I don't know any.

There's an edge which you should step over in order to become a good programmer and it's testing. The first time it will disturb you and you'll feel annoyed but then you will like it. Remember there are the things which you should get used to.

But keep in mind, many people do write tests, they madly covers each line of the code with tests, then write tests for tests and still produce a crap. And there's a reason, you should not concentrate on the tests themselves and make any kind of cult on it. Testing have it's own meaning and this is not an abstract safety, that's an ability to make your code better. Yes sir, you may write a good bunches of tests on your code and feel yourself safe but if you don't make your code better then, you was just wasting your time writing the tests.

Tests provides you an ability to improve your code safely. Once you have written some tests you may change your code, make some research, try this and that, find new tricks and do it safely. And once something went wrong you can easily see where and how it happened. Tests will teach you to write better code, and once you'll start to change your code you'll came to the second part of TRP.

Refactoring.
And this is the knowledge about how to change your code. Mr. Fowler had written an excellent book on this and invented a good system of "bad smells", the system which will point you at problematic parts in your code.

Yes, you may learn refactoring without tests, but then you will only suffer and won't ever open for yourself a truly power of the instrument. Refactoring needs practice, you should do it over and over until you instinctively will avoid problematic code pieces.

Once you will becoming better and better in refactoring you'll came to understanding of bigger parts of code and then you'll need the P of TRP.

Software Design Patterns.
It is said that patterns are for architects and team leaders only. But not in really. Patterns are trusted and many times rechecked software design solutions. They tell you how good people do it.

Once you started to practice refactoring you will need patterns, to not change your code blindly. Having patterns in your mind you'll do refactoring more consciously and more important you will try to make your code more standard, more understable for another readers and yourself first.

And yes again. You may start learn patterns separately of testing and refactoring but it won't give you much, case you won't be able to use it effectively without an experience in code refactoring.

Conclusion
TRP - Testing, Refactoring, Patterns. Those three things are wired tightly in reality and each one helps two another. You cannot be seriously good in any of those separately and should grow them up all together.

And do not be religious about the things, remember only the quantity separates venom out of cure. Teach yourself to feel the measure and you'll be gold.

Tuesday, February 19, 2008

Firefox 3 tries

Have installed FF 3-beta (Gecko/2008021416 Firefox/3.0b3), what can I say? Looks promising, they have revised many gui stuffs, now it looks quite nicer. And yes, as they had been promising, now it works with Cairo and renders native gtk widgets. That's cool.

But unfortunately, just as it was with FF 0.9 -> 1.0, FF 1.0 -> 1.5, FF 1.5 -> 2.0, all my plugins screwed up. No firebug, not firefox-webdevelop, etc. 8(

By itself FF 3, looks quite stable, had no problems so far, no crashes etc.

That's it. Will waiting.

Monday, February 18, 2008

Charged php-mode recharge

PHP is like a gangsta-rap. Everyone know that it's a bullshit, but from time to time do it for living.

So, as I had to support one of my customers with an old php-project recently, I've done some fixes in the charged php-mode. There are only minor fixes of highlighting issues, like the broken methods calls highlighting, $this_ calls lack, etc.

Get It Here

Thursday, February 14, 2008

discovery.com seems to have nice round hole in their security

I was trying to register on their forum and accidentally found myself logged in under another user.

How did I do so:

1) Hit the Login/Join button
2) Proceed to the registration form
3) Feel it as they wish to
4) Enter instead of the desired username a username of an existing user
5) Press submit.

That's it. I've received the confirmation email and found myself under the user which was registered several years ago and have some posts. I even managed to create a post and now having the discussion.

Tuesday, February 12, 2008

Epiphany updates look well

Have switched source tags from feisty to hardy on my laptop's ubuntu yesterday. And found that epiphany now, similar to knoqueror in kde, follows the gnome look'n'feel theme.





Looks quite nice. And note, it's on the gecko engine. Unfortunately Firefox, still renders the gray standard buttons.

Monday, February 11, 2008

Recursive Camelization

Felt myself not much well since wrote a non-recursive camelization example in the yesterday article. So, now I'm fixing the lack ;)


String.prototype._camelize = function() {
var _pos = this.lastIndexOf('_'), suffix = this.substr(_pos+1);
return _pos < 1 ? this : this.substr(0, _pos)._camelize()
+ suffix.charAt(0).toUpperCase() + suffix.substr(1);
};
alert('_camelize_me_pleaze'._camelize());


That's it.