Posts: 2,177
Threads: 222
Joined: Apr 2022
Reputation:
104
So when it comes to subs and functions, which convention do you employ?
CALL MySub(Parameters)
or...
MySub Paramenters
Certainly the later is less typing. It also looks neater. That stated, I almost always write apps with 20 to 30 sub routines and maybe 40+ calls. For the simple reason of ease of search, I use the CALL convention. F3, type "CALL" and check match case and whole word. Easy peasy.
I have a feeling I'm going to be in the minority on this one, but let's find out.
So which convention do you prefer?
Pete
- You can CALL me Betty, and Betty when you CALL me you can CALL me Al, CALL me Al...
Posts: 3,979
Threads: 177
Joined: Apr 2022
Reputation:
220
12-01-2022, 05:05 PM
(This post was last modified: 12-01-2022, 05:11 PM by bplus.)
I use no call no () for reason you stated less typing.
I am not buying your reason or not understanding?
I can get a view of subs and functions with F2, mostly I do it off View Menu with mouse.
Don't call us, we'll call you (when it's ready). That's what Walgreen's says but do they call when it is ready, no. Sure am getting run around with mother's BP meds, I will be needing BP meds just to deal with the big 3: doctors, insurance companies and pharmacies,
doctors, insurance companies and pharmacies, oh my!
b = b + ...
Posts: 2,177
Threads: 222
Joined: Apr 2022
Reputation:
104
Best cure for lowering high blood pressure, go kicks the neighbor's dog... preferably, while the neighbor is holding it. Ah, back to 200 over 150. That's low for me!
F2, sure. I use that, too, but F3 and type CALL. That allows me to quickly go to every line in the program that calls the sub by just repeatedly pressing F3. I like that search method. Without it, how are you going to easily find all the sub calls in a 5000 to 80,000 line program? OH, I suppose you could use alt arrow left to pete them... I mean mark them.
Pete
Shoot first and shoot people who ask questions, later.
Posts: 3,979
Threads: 177
Joined: Apr 2022
Reputation:
220
Well a good laugh works too! Thank you very much!
Yeah I would F3 the sub name F3 is probably the one key I use the most!
b = b + ...
Posts: 597
Threads: 110
Joined: Apr 2022
Reputation:
34
12-01-2022, 05:58 PM
(This post was last modified: 12-01-2022, 06:04 PM by CharlieJV.)
(12-01-2022, 04:37 PM)Pete Wrote: So when it comes to subs and functions, which convention do you employ?
CALL MySub(Parameters)
or...
MySub Paramenters
Certainly the later is less typing. It also looks neater. That stated, I almost always write apps with 20 to 30 sub routines and maybe 40+ calls. For the simple reason of ease of search, I use the CALL convention. F3, type "CALL" and check match case and whole word. Easy peasy.
I have a feeling I'm going to be in the minority on this one, but let's find out.
So which convention do you prefer?
Pete
- You can CALL me Betty, and Betty when you CALL me you can CALL me Al, CALL me Al...
Not about preference over here. It is about necessity: the difference in functional vs dysfunctional.
It is about overcoming cognitive disabilities.
The short of it: yes, CALL (in uppercase) almost exclusively (because there is always the once-in-a-blue-moon exception, in which "CALL" is a distraction), along with wrapping parenthesis on parameters.
The long of it:
Imagine that absolutely everything is a shiny object grabbing at your attention. Often the most benign attempt to find/locate something is like a game of "Where's Waldo", in which you are seeing every little detail in the image except for effing Waldo.
Structure/organisation (in the extreme, which would easily be misinterpreted as OCPD) and easily/quickly identifiable "bread crumbs" and clear markers help filter out the "noise".
Although I find uppercase text impossible to read, well-placed uppercase words, and certain usages of mixed case, help immensely.
For many things, I'm kind of like the canary in the coal mine. The very thing that kills me in no time, may not kill anyone else ever. Often enough, though, the thing that kills me is ever-so-slowly but assuredly (maybe hardly perceptible, if at all) sucking the life out of some other folk.
Posts: 660
Threads: 142
Joined: Apr 2022
Reputation:
58
CALL is an artifact of multi-module programming isn't it? Technically our programs aren't multi-module anymore. I suppose it would make sense if we were using some sort of DLL and we thus had to CALL the functions/routines in the linked library.
It's almost as old-fashioned as using LET.
Posts: 597
Threads: 110
Joined: Apr 2022
Reputation:
34
(12-01-2022, 07:54 PM)James D Jarvis Wrote: ...snip...
It's almost as old-fashioned as using LET.
Although not needed, LET can be useful. I wouldn't encourage folk to use it, but I also would not discourage it if found useful.
Posts: 2,177
Threads: 222
Joined: Apr 2022
Reputation:
104
(12-01-2022, 07:54 PM)James D Jarvis Wrote: CALL is an artifact of multi-module programming isn't it? Technically our programs aren't multi-module anymore. I suppose it would make sense if we were using some sort of DLL and we thus had to CALL the functions/routines in the linked library.
It's almost as old-fashioned as using LET.
Well now I feel old and no longer want pudding. All I can say is, don't LET the CD-Tray hit you in the ASCII on the way _OFFSET!
When I don't use CALL as an identifier, I sometimes place a blank space between a sub or function call, or a gosub statement. When I see a break in the lines of code, I know the flow is branching off to another routine. It's sort of a vertical identifier, much as indentation helps to identify conditional statements and loops.
Pete
CALL OBSOLETE (Wasn't that an MS-DOS routine?)
Posts: 660
Threads: 142
Joined: Apr 2022
Reputation:
58
CD-tray? You lose your punch-reader?
Posts: 2,177
Threads: 222
Joined: Apr 2022
Reputation:
104
(12-01-2022, 09:11 PM)James D Jarvis Wrote: CD-tray? You lose your punch-reader?
Not at all. I made my first game program with it: Hanging Chad. Chad wasn't too happy about it...
Pete
|