"with" almost killed me this morning. I copied 5 lines from a library demo and did not un-with it. I was going very deep into other stuff before i saw it. Someone wrote a source analysing tool recently. /Perhaps/ it's possible for a tool such as FixInsight to warn when variables have the same name inside a with as outside... (edited only spelling)

Comments

  1. That should abso-fucking-lutely be a warning!

    ReplyDelete
  2. Should be easily doable by Roman Yankovsky to warn about any use of with :D

    ReplyDelete
  3. Optimally, one warning for the dreaded keyword itself and one warning for unqualified names existing outside of the with (the levels above), in the namespace. Maybe it would be enough to check the methods class and local vars.

    ReplyDelete
  4. Friends don't let friends use "with".

    ReplyDelete
  5. Peganza Pascal Analyzer has a report "Ambiguous references in with-blocks". Saved my ass a thousand times inspecting old or foreign code.

    ReplyDelete
  6. With is the Spawn of Satan himself and should be utterly avoided.

    ReplyDelete

Post a Comment