Pages

Monday 30 January 2012

Learning Git - Basic Command

I think most of the programmers or IT geeks know about GitHub.  Created an account at GitHub recently (it's kinda late and have nothing to share yet) and started to learn Git.

Learned basic git command today.

1. Create git repository.
    $ git init (a .git subdirectory is created)

2. View status of files in working directory and staging area.
    $ git status (descriptive output)
    or 
    $ git status -s (short output)

3. Add files to staging area.
    $ git add [file_name] 
    or 
    $git add . (add all files under the directory we give)

4. Snapshot the staged content
    $ git commit (open a text editor to write commit message)
    or
    $ git commit -m "commit message" (write commit message at the same line)

That's all for my learning today. Keep it on.

References:

Friday 27 January 2012

Mini Project - Income Tax Calculation

"Hey, It's time to update"...i told myself (I'm still in Chinese New Year mood). 

Started a mini project 2 weeks ago by using CodeIgniter, Twitter Bootstrap and some JQuery plugins to create a web page to calculate monthly income tax of Malaysia.  Main purpose of doing this is to learn CodeIgniter framework.  Being trapped in many times when setting up the project as i'm new to CodeIgniter framework (luckily documentation of CodeIgniter is good and there is Google).


There are tonnes of things that I have to learn in order to know CodeIgniter deeper.  Refactor code and layout arrangement is the next step.

Happy Chinese New Year.

References:
http://codeigniter.com/user_guide/toc.html
http://twitter.github.com/bootstrap/
http://jquerypriceformat.com/


Thursday 12 January 2012

Android Application Development - 1st Step

It's has been a long time ago since i said i want to learn and develop native mobile application and this time i have no excuses for myself as i have tons of time now.  Hopefully can learn something new while waiting for job offer.  Last year, i use PhoneGap to develop a mobile application for Android platform for my Final year Project.

For this time, i also want to start my very first step with Android platform as well.  The first step that newbies (may be not all) would take is read and follow step-by-step tutorial to create a "Hello World" application, so do i.  It's quite clear and easy to understand if follow the tutorial.



Reference:



Tuesday 3 January 2012

Refactoring

Look back at my previous projects done in university and found that i can't even understand some of my codes.  Duplicated code, too much loops in a function...Realize that i'm also one of those who write unmaintainable code.

Refactoring is a new term that i have learned from my industrial training supervisor. Being assigned to read through the book - Refactoring by Martin Fowler and found that it's very useful in writing maintainable code.

"Refactoring is a technique to restructure an existing body of code without changing its behavior" - Martin Fowler

Every programmer can write code, but not every programmer can write maintainable code.  It's very suffer to maintain a messy code as we can't make sure changes we made to it will not change it's behavior or affect others.

Be in mind that " Always code as if the person who will maintain your code is a maniac serial killer that knows where you live." (one of my favorite programming quotes).  So, learn Refactoring. 

**It was a little bit upset that Refactoring is not being taught in my university.  Should it be taught in university? Absolutely YES!