texasalynn
Well-known Member
- Joined
- May 19, 2002
- Messages
- 8,458
Even better is to put lots of comments in but never change them when you change the code - gets really confusing, really fast!
been there - LOL
Even better is to put lots of comments in but never change them when you change the code - gets really confusing, really fast!
Because once upon a time, back in the dark ages when I first started programming, memory mattered [the computer's RAM was 8K (yes K)]. So I'll still use frequently use integers. Because I will, on the rare occasion, use BYTE variables for items I know won't exceed values of 255. Because, for quick and dirty little routines I still use the ancient stuff likeWhy would you ever use integers (as opposed to Longs) for anything??
DIM s$, i%, l&, f!, d#
I have become something of an evangelist for using the Hungarian/Simonyi naming conventions and commenting more thoroughly.
Wow, now I'm having a senior moment. Part of me is surprised to read this. And part of me is going -- "you know, now that you mention it, I think I might have heard that once and forgotten."I think Rory's point was that Integer type is converted to Long "under the hood" thus there is no real value in using it...
Yes, that might indeed still be a good application for using integers -- to keep an erroneous loop from executing much longer than it would using longs.unless as some sort of sanity check that a given variable should not exceed those boundaries ie to generate overflow.
Can you explain the ancient stuff ?
I more or less use Reddick's take on implementing Simonyi's conventions.Please evangelize me and tell me about the naming conventions - how does naming variables in Hungarian improve readability?
Date1 = Now: Date2 = Now: Date3 = Now: Date4 = Now
On Error GoTo ErrorHandler
MsgBox Day(Date1 + 1) & vbCr & Hour(Date1), vbInformation, "One"
MsgBox Day(Date2 + 1) & vbCr & Hour(Date2), vbInformation, "Two"
MsgBox Day(Date3 + 1) & vbCr & Hour(Date3), vbInformation, "Three"
MsgBox Day(Date4 + 1) & vbCr & Hour(Date4), vbInformation, "Four"
Exit Sub
ErrorHandler:
Debug.Print Err.Description
Resume Next
End Sub
dtmDate = Now
strDate = Now
lngDate = Now
dblDate = Now
On Error GoTo ErrorHandler
MsgBox Day(dtmDate + 1) & vbCr & Hour(dtmDate), vbInformation, "Eins"
MsgBox Day(strDate + 1) & vbCr & Hour(strDate), vbInformation, "Zwei"
MsgBox Day(lngDate + 1) & vbCr & Hour(lngDate), vbInformation, "Drei"
MsgBox Day(dblDate + 1) & vbCr & Hour(dblDate), vbInformation, "Vier"
Exit Sub
ErrorHandler:
Debug.Print Err.Description
Resume Next
End Sub
While the limitations certainly aren't coerced to that of a Long, I can't get a certain Access MVP to agree with me that Integers are processed as Longs:I think Rory's point was that Integer type is converted to Long "under the hood" thus there is no real value in using it... unless as some sort of sanity check that a given variable should not exceed those boundaries ie to generate overflow.