Author Topic: Can we do away with proc for calling procedures?  (Read 457 times)

darkhog

  • Newbie
  • *
  • Posts: 40
    • View Profile
IMO this is too much verbosity for the language. User procedures should be called like regular ones, without proc. If procedure name isn't a reserved keyword, it should be considered that user tries to call his or her own procedure, instead of internal one (no proc required on the coder's side, internally it can be converted to a proc call if runtime demands it).

Marcus

  • Administrator
  • Hero Member
  • *****
  • Posts: 541
    • View Profile
Re: Can we do away with proc for calling procedures?
« Reply #1 on: June 28, 2016 »
I like having something there to show that it's a subroutine call for readabillity. If you'd just have to write the procedure name it could be mistaken, by another programmer, for a variable "declaration" or clearing. Also, you don't need to write "proc", you can use underscore instead:

Code: [Select]
procedure DoStuff()
endproc

_DoStuff

However, I am taking note of all suggestions (like for .. to .. step) you make and wil certainlyl concider them for the next release/patch So thanks a lot! My first goal is to finish the p2p library though.
« Last Edit: June 28, 2016 by Marcus »
.\\\opz

darkhog

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: Can we do away with proc for calling procedures?
« Reply #2 on: June 28, 2016 »
I see. I have actually few "big" suggestions as well, but don't want to overwhelm you with them just yet, since I know netcode can be a bitch.

As for mistaking for variable declaration... most Naalaa code I've seen usually assigns default value to variables they declare, so I think you worry too much IMO. No "=" sign, not a variable declaration and even if someone would declare a variable without assigning a default value to it, one quick look into subroutine list can clear confusion. And if whatever you're using has library prefix, it's most likely a procedure call also, especially if it has parameters list as well.

I think programmers that could be even remotely interested in "game BASIC" such as Naalaa (I know it's not fully BASIC-compliant, but syntax is so similar it might just as well be BASIC) are people who already got experience in one or two languages (whether dialects of BASIC for different computers of old or more advanced languages) so I think "target audience" wouldn't have any problems differencing between procedure call or variable declaration anyway.

IMO it should stay there, for compatibility and muscle memory reasons, but shouldn't be required.