Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WITH/END WITH?
#21
(01-27-2026, 02:04 AM)SMcNeill Wrote: For me, I'm a horrific user of copy/paste so WITH/END WITH has never been part of my personal coding process.

I type something like ThisIsMyVar.Extension = foo
Then I highlight the ThisIsMyVar.
Then it's CTRL-C to copy it.
Then for the next several lines I just CTRL-V and paste it in where I want it and type in the rest of the namespace manually.

Like mad, I find it easier to track and reference in my mind if I'm looking at the full variable name, rather than having to track which WITH my code might currently be associated with at any given moment.  Wink

It's just what works for me personally.

Yup, you do what's right for you. Personally, I sort of equate a With/End With block and a Do/Loop block. As I said, it's all a personal preference, but it would be handy to have With/End With available.
It's not the having, it's the doing.
Reply
#22
(01-27-2026, 01:55 AM)bobalooie Wrote: I get that, everyone has a workflow that works best for them. I sometimes have UDTs with a lot of members, so for me the WITH/END WITH construct is really handy (especially when initializing the UDT). If somebody chooses not to use it, then they should what's right for them.

What would be really helpful, and possible now in this age of "ai", would be the ability to turn features like this on and off as just another option in the IDE, like changing a font. If you like WiTH, you can enable the option, and the IDE renders the code with variables inside WITH where it makes sense (or according to whatever your preferences are). If I don't like WITH, I disable the option, and it just shows the full variables in the dot notation. And what would be even cooler would be for the IDE to be smart enough to render the code at compile time in whatever form compiles to the most efficient executable, regardless of how you prefer to read it. 

But for now, we all get exposed to each other's different coding styles when we check out each other's programs here, which is probably good for breaking us out of our habits and being exposed to other approaches. It's all good!
Reply
#23
I agree. There is a lot modern computing could do today, but I think it's being overlooked to build these gigantic data centers. So maybe sometime in the future, but until then your good ideas will just gather dust. Alexa... Oh forget it. Stupid device couldn't raise the temperature in the house even if it was on fire!

Oh, and Steve's in my camp. variable names are hardly ever a source of bug problems for me, either.

Pete
Reply
#24
Variable names... Except for the one Pascal course on the Apple II, pretty much all the programming I did before college was on computers that only let you use 2 characters max to name your variables. So when I'm feeling frustrated, I only have to remember back to those days, to realize that every day's like Christmas with these newfangled future languages and wonder machines we have!  Tongue
Reply
#25
WITH does seem rather unpleasant, surely an ALIAS construct would be nicer:

Code: (Select All)
ALIAS ent TO database(id).entity
ent.name = "Foo"
ent.kind = "Thing"

Where "ent" is effectively replaced by database(id).entity
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question What happened to end year holiday season code? mnrvovrfc 5 1,069 12-27-2023, 02:39 PM
Last Post: GareBear
  So... I *think* I found the cheese at the end of the maze? MrCreemy 11 2,065 12-30-2022, 11:24 AM
Last Post: JRace

Forum Jump:


Users browsing this thread: 1 Guest(s)