Home > Uncategorized > Ayo buat code yg clean…

Ayo buat code yg clean…

Diambil dari buku refactoring to patterns (Joshua Kerievsky)

 
november(20, 2005)

kode tersebut memanggil method berikut ..

public void Date november(int day, int year)...

cool isn’t it? Kenapa kita tidak melakukan hal tersebut. Coba pikirkan apa yg terjadi jika code tersebut ditulis dengan implementation detail seperti ini..

java.util.Calendar c = java.util.Calendar.getInstance();
c.set(2005, java.util.Calendar.NOVEMBER, 20);
c.getTime();

YIKES….

Jadi mulai skarang buatlah code yg manis dan tidak menjijikkan..

Categories: Uncategorized
  1. ciscus
    August 28, 2009 at 7:16 am

    code yang manis itu gmn ya?

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: