"Frank's skill in asking the right questions is un-mistakable, and is at the core of his leadership philosophy.

The power of these questions cannot be underestimated, especially if you want to lead and not manage."
—John Cave
Westhaven Worldwide Logistics

If not otherwise stated—all postings © Frank D. Kanu. All rights reserved.

You are on page 3 of 5

12 3 45

Posts

Archive for the 'Code review' Category

Source Code Formatting - Answer

I am not going to start a flame war here how the proper formatting of source code has to look like.

But there shouldn’t be a mix-up of styles—like multiple command in one line or no indenting at all.

Every development team should have their style and follow it religiously.


Tags:
 

This blog-entry is protected by a digital fingerprint:785273ed81985582c8a1be62f78c9459

Source Code Formatting

procedure TForm1.aClick(Sender: TObject);
var idx : Integer;
strs : TStringList;
begin
  if Screen.Cursor <> crDefault then
  begin
  exit;
  end;
  Screen.Cursor := crHourGlass; try
  if (aGroups.Selected <> nil) then
  try
  if Not N.Connected
  then
  begin
  …

You get the point …


Tags:
 

This blog-entry is protected by a digital fingerprint:785273ed81985582c8a1be62f78c9459

Record=Class? - Answer

Way too often there are no naming conventions and every team member has their own style—leading to confusion and hardly readable code. Using a different type in the declaration of a new type is just plain wrong.


Tags:
 

This blog-entry is protected by a digital fingerprint:785273ed81985582c8a1be62f78c9459

Record=Class?

type
  TBARecord=class

named Record—but is a class


This blog-entry is protected by a digital fingerprint:785273ed81985582c8a1be62f78c9459

Oh Lord! - Answer

This is one badly to read piece of coding. It also begs the question of the GUI: The user will get told field by field that there has to be a text…

To simplify the coding—b_valid should have been set to False at the beginning of the coding. The fields and their state—filled or not—should be part of a class. Have the class members return the feedback if filled out properly or not.


Tags:
 

This blog-entry is protected by a digital fingerprint:785273ed81985582c8a1be62f78c9459

Oh Lord!

   end else if( Trim(STATE.Text) = '' )then begin
      s_error := 'State cannot be blank.';
      b_valid := False;
   end else if( Trim(ZIP.Text) = '' )then begin
      s_error := 'Zip cannot be blank.';
      b_valid := False;
   end else if( Trim(Phone.Text) = '' )then begin
      s_error := 'Phone cannot be blank.';
      b_valid := False;
   end else if( Trim(Fax.Text) = '' )then begin
      s_error := 'Fax cannot be blank.';
      b_valid := False;


and this goes on for around 200 lines…


Tags:
 

This blog-entry is protected by a digital fingerprint:785273ed81985582c8a1be62f78c9459

Classic! - Answer

Way too often coding contains hard-coded values or the remains (like here) of it. Most amazing to me is how often code like this is produced, reviewed and changed—but not to the better…


Tags:
 

This blog-entry is protected by a digital fingerprint:785273ed81985582c8a1be62f78c9459

Classic!

IntToStr(0);

That’s scary, isn’t it?



This blog-entry is protected by a digital fingerprint:785273ed81985582c8a1be62f78c9459
You are on page 3 of 5

12 3 45

This blog is designed to provide accurate and authoritative information in regard to the subject matter covered. If legal advice or other expert assistance is required, the services of a competent professional should be sought.