Notes from Neal Ford’s Presentation on “How to Improve your code”

Visit http://www.nealford.com/downloads/conferences/canonical/DevWeek-10Ways.pdf for the entire text of the presentation

Some Highlights –

1. Test-Driven Design and Development – Be the first customer/consumer of your class

2. static analysis – A method that takes an argument of a base class reference should not make assumptions about the actual type of the object passed as argument.

3. Bad Smells –

– empty try/catch blocks

– dead code [unused local variables, parameters, private variables]

– suboptimal code [ wasteful string usage]

– over complicated expressions [affecting code readability/maintenance]

– duplicated code [reuse via copy/paste]

4. Constructors –

– Dont provide default constructors for domain objects.

[Manju] Makes sense – Its analogous to creating an “Order” in the Order_Hdr table with just an Order_id. Destroys the data-integrity of the system.

– build the simplest thing that we need right now.

Advertisements

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: