PowerBASIC Peer Support Forums
 

Go Back   PowerBASIC Peer Support Forums > User to user Discussions > Programming

Programming User to user discussions of general programming topics such as algorithms, APIs, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old Apr 1st, 2012, 12:43 AM
Julian Small Julian Small is offline
Member
 
Join Date: Jun 2010
Posts: 4
PB10 and ASMDATA Statement variables

It would appear that the following: DB, DW, DD, and DQ variables in the new ASMDATA statement are reserved! This really is annoying. Sorry, this is really annoying! Really!!!

I think that it would make more sense to use less common variable names in the asmdata statement.

This kind of stuff reminds me of the things that Microsoft used to do, in the '80s, with VB. Which is why I dumped VB. Every new version of VB at that time changed the way the world rotated. I remember having to re-write gobs of code because of those changes.

I do hope that this isn't going to become a trend with PB. If it is I'm going to pack it in...go down to the beach, raise a tent and hold revival meetings!

Thanks for letting me vent!. But as I mentioned before this is really annoying.

Julian
Reply With Quote
  #2  
Old Apr 1st, 2012, 03:07 AM
Chris Holbrook Chris Holbrook is offline
Member
 
Join Date: Aug 2005
Location: in Hiding
Posts: 6,479
Your first post - Welcome Julian!

Quote:
Originally Posted by Julian Small View Post
This kind of stuff reminds me of the things that Microsoft used to do, in the '80s, with VB.
Now I begin to understand why there has been less fuss about the piracy of variable names than I expected. VBers (I'm not one) will have seen it all before and possibly considered it "part of the game".

In this particular case it's unfortunate that the limited scope of DW, etc (only meaningful between ASMDATA and END ASMDATA) should result in compilation errors when used in other contexts.

I would guess that the trade-off for the compiler writer is between the number of passes of the source code and the precision of error reporting.

The naming convention which I use when I have a choice is to employ more or less HN* except for ephemerals, where just the type, or even just a single letter, is used for a variable name.

By ephemerals I mean things like loop counters, temporary stores and variables whose only purpose is to assist in data conversion. These are always LOCALS. So dw denotes - sorry, used to denote, an ephemeral DWORD.

*Hungarian Notation
Reply With Quote
  #3  
Old Apr 1st, 2012, 03:25 AM
Rodney Hicks Rodney Hicks is offline
Member
 
Join Date: Apr 2007
Location: Winnipeg, Manitoba, Canada
Posts: 3,159
As much as I understand the angst about PB reserving new keywords, I can see no way that PB can make the product better without instituting new keywords, and because every one of us has our peccadilloes, and in that context, they are going to infringe upon someone's sensibilities.
Thus, it's the only sensible thing for them to do.
__________________
Rod
"To every unsung hero in the universe
To those who roam the skies and those who roam the earth
To all good men of reason may they never thirst " - from "Heaven Helpt the Devil" by G. Lightfoot
Reply With Quote
  #4  
Old Apr 1st, 2012, 10:45 AM
Gary Beene Gary Beene is online now
Administrator
 
Join Date: May 2008
Location: Dallas, Tx
Posts: 12,519
Hi Julian,
Welcome to the forums!

See this thread for other variable names, as well as other changes that may affect your previous code.

I'm 100% with you on the annoyance response. I can agree with Rodney that PowerBASIC needs some keywords of their own, but dw and dh? - when there are literally billions of possible variable names?

I've used, and seen used, those variables since the 1980's. I feel like I've been the recipient of an eminent domain action!

The good news is that the list of commonly used, usurped variable names doesn't actually seem to be that long - at least in my own coding experience and recent conversion of legacy code to PBWin10. It's just a bummer that the conflict you/I ran into was on two of our long-time favorite variable name choices.
__________________
Reply With Quote
  #5  
Old Apr 1st, 2012, 12:10 PM
Chris Holbrook Chris Holbrook is offline
Member
 
Join Date: Aug 2005
Location: in Hiding
Posts: 6,479
Quote:
Originally Posted by Rodney Hicks View Post
...I can see no way that PB can make the product better without instituting new keywords, and because every one of us has our peccadilloes, and in that context, they are going to infringe upon someone's sensibilities...
My personal peccadillo is to see such entities prefixed with something like "PB".

How kinky is that.
Reply With Quote
  #6  
Old Apr 1st, 2012, 12:14 PM
Bob Zale Bob Zale is offline
Administrator
 
Join Date: Sep 1998
Location: Venice, FL USA
Posts: 3,838
My personal preference is to see variables prefixed with PB or CH or GB, etc. <smile>
__________________
Reply With Quote
  #7  
Old Apr 1st, 2012, 01:38 PM
Julian Small Julian Small is offline
Member
 
Join Date: Jun 2010
Posts: 4
BZ would be a good one too
Reply With Quote
  #8  
Old Apr 1st, 2012, 01:55 PM
David Warner David Warner is offline
Member
 
Join Date: Jun 2002
Location: United Kingdom
Posts: 95
DW could be quite confusing for me.
Reply With Quote
  #9  
Old Apr 1st, 2012, 06:14 PM
Stuart McLachlan Stuart McLachlan is offline
Member
 
Join Date: Mar 2000
Location: Port Moresby, Papua New Guinea
Posts: 1,692
My personal preference is to use some form of Hungarian Notation for variables. This has many other advantages in addition to resolving the current issue.
Reply With Quote
  #10  
Old Apr 2nd, 2012, 09:14 AM
Michael Mattias Michael Mattias is offline
Member
 
Join Date: Aug 1998
Location: Racine WI USA
Posts: 36,491
DB, DW, DD, and DQ are only truly 'reserved' when they are the first non-whitespace 'words' of an ASM statement.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:24 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1999-2011 PowerBASIC, Inc. All Rights Reserved.
Error in my_thread_global_end(): 1 threads didn't exit