Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Syntax Censor – WITH, GOTO, and LABEL – Delphi Developer Debate

Where To Start Windows App Development With A C++ IDE

See also Ian’s post which has copies of the slides and also will include a link to the YouTube webinar replay when it is available.

Be sure to join us for the next Delphi Developer Debate

Syntax Censor – WITH, GOTO, and LABEL
Wed, Jul 27, 2022 11:00 AM – 12:00 PM CDT

  [Registration]

Here are the results from the MVP Survey, be sure to join the webinar for the in-depth conversation.

   

The following are some of my thoughts to consider for this developer debate. I’ve also included a couple of links to additional resources.

WITH statement

My take: “Deprecate and raise a warning”. Why? There is a lot of existing source code that uses the WITH statement. Warning would help developers identify possible problems for any WITH statements.

Some possible reasons for using or avoiding the WITH statement:

Note: I could be convinced to change my opinion about the WITH statement if the IDE had a tighter (better?) integration between the project, editor, debugger and a change management system that alerted developers to a WITH statement use being impacted by a change.

GOTO statement and LABEL

My take: Deprecate and raise a warning. Why? There may be some legacy code that still includes GOTO and LABEL. Warning would help identify the code and allow developers to consider possible structured alternatives.

Some possible reasons for using GOTO and Label:

Additional References

Letters to the editor: go to statement considered harmful by Edsger W. Dijkstra
Communications of the ACM
Volume 11 Issue 3
March 1968 pp 147–148

https://dl.acm.org/doi/pdf/10.1145/362929.362947

“For a number of years I have been familiar with the observation that the quality of programmers is a decreasing function of the density of go to statements in the programs they produce. More recently I discovered why the use of the go to statement has such disastrous effects, and I became convinced that the go to statement should be abolished from all higher level programming languages (i.e. everything except, perhaps, plain machine Code) … The unbridled use of the go to statement has an immediate consequence that it becomes terribly hard to find a meaningful set of coordinates in which to describe the process progress … The go to statement as it stands is just too primitive; it is too much an invitation to make a mess of one’s program.”

Edsger W Dijkstra Archive – https://www.cs.utexas.edu/users/EWD/

C2 Wiki – https://wiki.c2.com/?GotoConsideredHarmful

Why Pascal is Not My Favorite Programming Language by Brian W. Kernighan, April 2, 1981 – AT&T Bell Laboratories
https://www.cs.virginia.edu/~evans/cs655/readings/bwk-on-pascal.html

GOTO statement Wikipedia article – https://en.wikipedia.org/wiki/Goto

C language GOTO Statement – https://en.cppreference.com/w/c/language/goto

C++ language GOTO Statemtent – https://en.cppreference.com/w/cpp/language/goto

 

Exit mobile version