Coding horrors? Absolute and goto! Who uses it? Who refuses it? Why?

Coding horrors? Absolute and goto! Who uses it? Who refuses it? Why?

Personally, I love absolute and goto, I use them with a lot of restraint of course, but they can be really useful tools at times. And in case of absolute, of course I make sure I do typechecking.

Comments

  1. I use them too, but only in extreme cases, where not using them would reduce readability. I have seen too many cases of abuse to use them lightly.

    (And I don't give a sh*t whether they are considered harmful or not.)

    Of course similar restraint is required with Exit, Break and Continue.

    ReplyDelete
  2. I use them whenever I feel like it's the best option, I don't care what "gurus" say, there are many cases for "goto", sure you can go around, but why not use them?
    with respect to absolute, I find very rarely use cases, but using them.

    ReplyDelete
  3. I use absolute from time to time. It's no worse than any other unsafe cast.  Goto - not if I can help it.

    ReplyDelete
  4. I have always avoided goto. I rarely use absolute now, though I did when I was often interfacing to 3rd party DLLs. C coders seem to love their unions.

    ReplyDelete
  5. I haven't used goto since translating some old YACC C code to Pascal two or three decades ago. A totally useless command - unless you are writing complicated parsers.  I do use absolute from time to time.

    ReplyDelete
  6. Absolute is useful, goto is an anachronism. The worst keyword in delphi is with.

    ReplyDelete
  7. with is dangerous, indeed.
    Still - I sometimes use that as well.

    ReplyDelete
  8. @Vitali I completely agree.  Anyone working for me that uses "with" in their code gets to take a trip to the woodshed to pick the stick I will beat them with.  goto is only useful for state machines - usually inadvertent ones.  :-)

    ReplyDelete
  9. with could use an upgrade to it's syntax:

    with somelist[index].item.reference as a, someotherparam as b
    do begin
      a.value := b.value;
      if b.state
       then a.dosomething;
    end;

    ReplyDelete
  10. Any with clause which contains a comma is a code stink. It brings to mind all the reasons not to pursue multiple inheritance. I stopped writing with clauses a long time ago. I have inherited some, and whenever maintenance takes me in their direction, I remove them, as a high-value refactoring.

    ReplyDelete

Post a Comment