• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

What is good code?

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi GUys,

In an interview, if you are asked "what is good code" what would you say?

Regards
Saliya
 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In short: Something that implement(fullfil) user requirements
[ June 26, 2005: Message edited by: Shahid Afridi ]
 
Ranch Hand
Posts: 997
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Saliya Jinadasa:
In an interview, if you are asked "what is good code" what would you say?


Unless you hire me,I won't reveal the secret.
 
Ranch Hand
Posts: 538
Hibernate Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shahid !

In short: Something that implement(fullfil) user requirements

I would say no, absolutely not on a strategical point of view.
Your answer would be very true for an architect who may drift easily from this main purpose, but the developper does this by nature under team leader's supervision so it is not something remarkable.

I would absolutely say in the scope of an interview : "good code is code easy to maintain and refactorize, and well commented".

Best regards.
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Something - easy to understand by others.
 
author
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good code is (or has)...

  • Very easy to read (even at the expense of some performance)
  • Reasonable performance (fast enough)
  • Robust (doesn't crash during normal use)
  • Modular (encapsulation, object oriented, etc)
  • Works (does what the customer needs)


  • How's that?
     
    Ranch Hand
    Posts: 469
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Jared Richardson:
    Good code is (or has)...

  • Very easy to read (even at the expense of some performance)
  • Reasonable performance (fast enough)
  • Robust (doesn't crash during normal use)
  • Modular (encapsulation, object oriented, etc)
  • Works (does what the customer needs)


  • How's that?


    Agree,
    I would add : Properly commented, OOP, API, predefined libraries used wisely (There are many developers who would use these inappropriately).

    Code that fulfills user requirements can be disgustingly written, which happens about 70% of the time(my personal experience)
     
    Ranch Hand
    Posts: 1683
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I would expect the organisation's coding standards to be adhered to. If these don't exist, then some recognised standards must be followed.

    I reviewed some code (written by an outsource company but I'm sure that it happens with inhouse code as well) which had package names like ABCD_UC (ABCD being the name of the application). I soon got that corrected ..
     
    Greenhorn
    Posts: 9
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I wish I had kept a copy of a program I once had to mod.

    It had method names like 'snowfalling' and 'sunnyday'.

    The programmer who wrote it was of course still a legend many years after leaving the company.
     
    Saloon Keeper
    Posts: 24810
    172
    Android Eclipse IDE Tomcat Server Redhat Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Good code is what I write.

    My standard of good is short, clean, efficient (usually a natural side effect of the first two) and commented well enough that you don't have to tie your mind in knots trying to figure out A) what it's supposed to be doing and B) how it's doing it.

    Note that good code != good program. A program can be full of absolutely beautiful code and not do what the users want/need. Conversely, most of the systems I know of that have been truly popular are full of really ugly programming.

    Djikstra wrote a short book on what was excellence and beauty in code. Can't remember the title offhand.
     
    You showed up just in time for the waffles! And this tiny ad:
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    reply
      Bookmark Topic Watch Topic
    • New Topic