Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Clean Code

  1. #1

    Default Clean Code


    I am currently reading this book: Clean Code - A Handbook for Agile Software Craftsmanship by Robert Martin. I find it very interesting.

    Yes, you might be a good programmer, but it is very hard to maintain a clean code. It needs to be practiced by heart.

    We are the "authors" of our codes, and as authors, we will definitely have readers.

    In your own idea, what are the characteristics of a "clean" code?

    All ideas are welcome!

  2. #2
    As a programmer TS dapat clean code para pud masabtan sa magbasa/mag debug sa imo code..

    Importante ang classes naming and placing sa code para dili pud mo bug-at pag maau ang code..

  3. #3
    for starters... arrange the dammed code properly... comment if necessary and stop using one liner..

  4. #4
    dapat naay manga comments/notes para reference para dili lisod inig naay i debug. ang indent/tabbing para dali ra mabasa imo code kay bisan pa ug naa ka debugger lisod sabton kung ang codes wala nag indent. ug organize gyudka dapat tanan functions/procedure/stylesheets/javascripts imo gyudna lahion ug group.

  5. #5
    if imo judna e follow ang naa sa book, 50% nlng imong coding, ang importante dra mg code ka, dapat after a year masabtan pa nimo

  6. #6

    Default Clean Code

    Quote Originally Posted by salbahis View Post
    for starters... arrange the dammed code properly... comment if necessary and stop using one liner..
    Based on what I've read and understood from the book, comments are just one way of hiding clean coding failures. Your codes must speak for the name and functionality by itself, no need of comments.

    Normally, we comment a code because our code itself hides its intent.

    Any reactions?

  7. #7
    no no no no, comments main purpose is to define what.....not for you(the coder) but for other coders who will maintain....dili sa bati imong code but in a large application nga constant ang changes,ma hurot judna imong buhok cge katol ug sabot sa code.

  8. #8
    Quote Originally Posted by jeraldjames View Post
    Based on what I've read and understood from the book, comments are just one way of hiding clean coding failures. Your codes must speak for the name and functionality by itself, no need of comments.

    Normally, we comment a code because our code itself hides its intent.

    Any reactions?
    depende unsaon nimo pag comment if ang pagcomment binata.. well para jud na sa bata... but if comment for documentation then that is not hiding something... i always use documentation tool and adding a comment makes it easier... beside documentation... its better naay kahayag sa usa ka function kay sa ngit2 nga mag sige paka ug kut2 sa ulo nga panot...

    i think you have a wrong understanding on how the comment should be used, its like you are using a pen on a pencil-only exam... who ever told you that comment is useless.. that person deserved a infinite FACEPALM


    ok ra di mag comment if ikaw ra ang mag work but if your into a team, then your'e one selffish-son-of-a-horse that its intention are self gratification... *j2mc*

    Note: have you manage a group of developers working on a one project sir?
    Last edited by salbahis; 12-05-2014 at 03:49 PM.

  9. #9
    Junior Member
    Join Date
    Jun 2009
    Gender
    Male
    Posts
    478
    Your code is your documentation. C'mon we are not writing assembly language!

    I'll give you an example. Instead of writing:

    interest = principal * .07 * numbeOfYears; // then here you need to explain what's that magic number .07 by writing silly comments

    write this instead.

    interest = principal * numberOfyears * ANNUAL_INTEREST_RATE;

    It's so obvious you dont need a comment.

    PS. Writing an API is a different story. You need to put a document what does an API doing. At least the input/parameter, output expected, and the execeptions.

  10. #10
    Junior Member
    Join Date
    Jun 2009
    Gender
    Male
    Posts
    478
    Read this very concise book. It's very short and you can read it for 1 or 2 days. It's java but should be applicable to other language. Of course

    Amazon.com: The Elements of Java(TM) Style (SIGS Reference Library) eBook: Jim Shur, Cao Tieou: Kindle Store

  11.    Advertisement

Page 1 of 2 12 LastLast

Similar Threads

 
  1. How's your canteen or carenderia? Is it clean and sanitary?
    By tnbntng in forum General Discussions
    Replies: 30
    Last Post: 10-14-2015, 03:14 PM
  2. labor code..employee proby status ug regular status
    By zengatsu in forum Politics & Current Events
    Replies: 73
    Last Post: 09-23-2009, 03:09 PM
  3. Free Wordpress Theme with Clean Coding - Life Cycle
    By themespreview in forum Websites & Multimedia
    Replies: 1
    Last Post: 01-12-2009, 06:24 PM
  4. Dan Brown's The Da Vinci Code
    By JuRa^ in forum Arts & Literature
    Replies: 266
    Last Post: 09-09-2006, 02:32 AM
  5. PM max limit -> clean ur inboxes pls..
    By blitz in forum Support Center
    Replies: 16
    Last Post: 10-26-2005, 05:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top