Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-debug-dev] So many if() statements in CDT source code

Without seeing specific example of an area where you think there are an excessive number if if() statements, it's rather hard to formulate a meaningful answer to your question.  Refactoring code is an activity that always depends heavily upon the nature of the code being refactored.

Now, if you're seeing tons of:

If(myObject instanceof SomeType)

Then your polymorphism idea is probably valid.

___________________________________________
 
Chris Recoskie
Software Designer
IDE Frameworks Group
Texas Instruments, Toronto
 
 
> -----Original Message-----
> From: cdt-debug-dev-bounces@xxxxxxxxxxx [mailto:cdt-debug-dev-
> bounces@xxxxxxxxxxx] On Behalf Of Øyvind Harboe
> Sent: Monday, June 06, 2005 4:18 PM
> To: cdt-debug-dev@xxxxxxxxxxx
> Subject: [cdt-debug-dev] So many if() statements in CDT source code
> 
> Idle thoughts...
> 
> I'm always baffled by the sheer number of if() statements in CDT code.
> 
> As the number of if() statements skyrockets, testing becomes a near
> impossible problem.
> 
> This is a return to a subject I've raised earlier, but when I look at
> the sort of bugs I see in CDT, I can't help to think that this is an
> important issue.
> 
> Shooting from the hip here: could increased use of polymorphism help to
> reduce the number of if() statements?
> 
> E.g. create "empty" objects instead of comparing against null pointers.
> 
> Has any attempts been made at systematically categorizing the types of
> if() statements in CDT to figure out if there are any suitable
> strategies to reduce the number of if() statements?
> 
> 
> Oh. I'm hereby reversing the burdon of proof that there too many if()
> statements in CDT. Those that think that the number of if() statements
> in CDT is not a problem won't read this far anyway. :-)
> 
> 
> --
> Øyvind Harboe
> http://www.zylin.com
> 
> _______________________________________________
> cdt-debug-dev mailing list
> cdt-debug-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-debug-dev


Back to the top