• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Good code
 

Good code

on

  • 219 views

Before we land up programming lets understand the "Good Practices of Coding"

Before we land up programming lets understand the "Good Practices of Coding"

Statistics

Views

Total Views
219
Views on SlideShare
219
Embed Views
0

Actions

Likes
0
Downloads
1
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Good code Good code Presentation Transcript

    • Writing good code
    • Purpose 1: Software development is a group effort1. Lots of people are involved2. Code is revisited very often3. Cost of maintenance
    • Purpose 2: Code has to last longCodebase is discarded when1. It is not understood2. It is not robust3. It is not extensible4. It is not efficient
    • What writing good code has got to do with sitting inconference room?1. To make you sensible to the topic2. To set you on right path
    • So lets get started with the session!
    • Be sensible1. Readability: clarity over cleverness2. Consistency3. Cyclomatic complexity4. Responsible while changing code
    • Be robust1. Least astonishmenta. No side effectsb. Re factor2. Use correct data typesa. Makes code more maintainableb. re-factoring is easy3. Scope variables carefullya. Dont spoil global name spaceb. Dont reuse convenient variables/constants
    • Be Pragmatic1. See the big picturea. composition/cohesion – Design by contract2. Understand the platforma. memory model: String builder, boxing/unboxingb. memory leaksc. thread safety
    • Points to ponder1. Error – To catch or not to catch2. Exception model - http://c2.com/cgi/wiki?UseExceptionsInsteadOfErrorValues3. overloading - dont overload it4. Out of band info5. Boy scout principle6. Dont re-invent, evolve
    • Suggested reading1. Art of Unix programming - http://www.faqs.org/docs/artu/2. Unmaintainable code - http://mindprod.com/jgloss/unmain.html3. http://c2.com/cgi/fullSearch?search=4. Pragmatic programmer5. 97 things every programmer should know6. Clean code