tagged Refactoring

Unit test tutorial (1/3) Fundamentals

Unit test is basically protecting code from yourself (from people in general). Let me show some example in this language independent unit test tutorial. We all do mistakes, we all thinking focused around specific bulk of things at a time (even in this Unit test tutorial as you will see). We cannot keep eyes on […]

Advanced custom WordPress excerpt

Customizing WordPress excerpt is essential once content gets grow on a WordPress site. Unfortunately the usual inline HTML output echoed out straight from PHP makes maintaining such modules quiet cumbersome. Custom WordPress excerpt // Include this to your ‘function.php’ somehow. function excerpt_filter($excerpt) { return ‘Customized’.$excerpt; } add_filter(‘get_the_excerpt’, ‘excerpt_filter’); While creating a custom WordPress excerpt is […]

Brush up you code design skills

Once you decided to make extensible, reusable, more stable, maintainable codes in the future, simply read these books, and start thinking about you existing projects’ code design.
Once you decided to make extensible, reusable, more stable, maintainable codes in the future, simply read these books, and start thinking about you existing projects’ code design. Both were originally written for Java language, but patterns can be pretty easily applies for everyday Objective-C development just fine.

Objective-JavaScript

I’d like to write this kind of JavaScript code: // Display a game selector UX then return with the selected item. EPPZSelector.gameSelectorToSelectGameInView ( this.savedGames, this, function(selectedSavedGame) { this.loadGame(selectedSavedGame); } ); The logic just flows, the controller code reads like a fairy tale. No underscores, no DOM selection, no any annoying punctation but actual human readable […]

Refactoring, prefactoring, defactoring

I’m fond of Kent Beck books on refactoring issues (Refactoring: Improving the Design of Existing Code, Implementation Patterns). Reading these books makes me more critic when looking to my own code. Most of the time I can catch signs of need for factoring something into new structures. Refactoring A common tool of refactoring are the […]