A new programming approach Mar27 '06

Feedback

# (1 of 2): Jennifer Grucza » jennifergrucza.com

1 day, 18 hours after the fact. (Wed 29 Mar 2006, 10:47 AM CST)

Sometimes what I like to do is put in the comments first, before any code. This helps me pinpoint exactly what I want my code to be doing, and it sort of stubs out the code so I know where I am and how much left I still have to do (so I don’t forget any steps).

For example, I might write:

/** Saves a new review, and updates the product with the new review average. */
public static void saveReview(Review review) {
// save the review to the database

// calculate the review average for the product, including the new review score

// get the product from the database using the product ID in the review object

// save the product object to the database
}

# (2 of 2): Matthom

1 day, 18 hours after the fact. (Wed 29 Mar 2006, 10:52 AM CST)

Cool idea... I might try that.

Previous comment Return to entry

RSS feed for comments on this post

Leave feedback

Feedback

Input format: The editor controls below will assist with Markdown syntax.

Status

Sub-status

Your info

Return to entry.

matthom is published and produced by Matt Thommes - an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from Chicago. Never one to conform, Matt intends to promote the effect the web has on our lives, in an effort to intensify, instruct, and clarify all that is happening around us.

Contact Matt

I’ve recently begun a new programming approach, and I find it quite helpful.

You are at the feedback permalink page for: A new programming approach

Read more...