It seems some scratchers use variable named t1, t2 for thier mod.
Originaly, this kind of name (temporary one, two) is given as an alternative by Smalltalk decompiler when the source code is missing. If you set .sources and .changes file correctly, your browser displays meaningful names.
So, I suggest to give a meaningful name for your variable. It enhances readability of your code for other scratchers.
Offline
Global variable names, and some block variable names already do that, but there are over 1000 methods in Scratch, and it would take a few whole years to set the name of all the variables.
Offline
I don't think so. All of temporary variables already have meaningful names when you open ScratchSourceCode1.4.image with ScratchSourceCode1.4.changes and SqueakV2.sources. So you need to give meaningful names for only the variables in mods.
Offline
Arguments left in blocks are automatically assigned to t variables. I agree that it is helpful if variables are named appropriately when they are declared. I think it's down to each user's programming style and the most we can do is encourage smalltalkers to do this as common practice, in the same way the camel case in variable names is not needed but encouraged.
Offline
sparks wrote:
...common practice, in the same way the camel case in variable names is not needed but encouraged.
Don't forget pascal case for classes and global variables
Besides, camel case isn't needed but the first letter must be lowercase in local variables, and must be uppercase in global variables. That's only Smalltalk though.
Last edited by LS97 (2011-09-11 08:43:18)
Offline
LS97 wrote:
sparks wrote:
...common practice, in the same way the camel case in variable names is not needed but encouraged.
Don't forget pascal case for classes and global variables
![]()
Besides, camel case isn't needed but the first letter must be lowercase in local variables, and must be uppercase in global variables. That's only Smalltalk though.
Yup!
Offline
LS97 wrote:
sparks wrote:
...common practice, in the same way the camel case in variable names is not needed but encouraged.
Don't forget pascal case for classes and global variables
![]()
Besides, camel case isn't needed but the first letter must be lowercase in local variables, and must be uppercase in global variables. That's only Smalltalk though.
What's pascal case? :?
Offline
scimonster wrote:
LS97 wrote:
sparks wrote:
...common practice, in the same way the camel case in variable names is not needed but encouraged.
Don't forget pascal case for classes and global variables
![]()
Besides, camel case isn't needed but the first letter must be lowercase in local variables, and must be uppercase in global variables. That's only Smalltalk though.What's pascal case? :?
PascalCaseIsWhenWordsAreConcatenatedUsingAllUppercaseLettersIncludingTheFirstOne
Offline
LS97 wrote:
scimonster wrote:
LS97 wrote:
Don't forget pascal case for classes and global variables
![]()
Besides, camel case isn't needed but the first letter must be lowercase in local variables, and must be uppercase in global variables. That's only Smalltalk though.What's pascal case? :?
PascalCaseIsWhenWordsAreConcatenatedUsingAllUppercaseLettersIncludingTheFirstOne
![]()
LOL I thought it said "Pascal Casels".
So it's camelCase with the first letter Capitalized.
Last edited by scimonster (2011-09-11 09:26:19)
Offline
sparks wrote:
the first latter? That's a paradoxical sentence if ever I heard one
But yes, it's first-letter-capitalised-camel-case.
>_<
So I made too mistakes. D: (thats on porpis
)
Offline
The world has truly gone two pot if Scimonster has caught the dreaded mispeling vyrus.
You changed your sig. Now I can't see you as I scroll through the fora! I thought I was talking to some random Scratcher all the way through this topic!
Offline
sparks wrote:
The world has truly gone two pot if Scimonster has caught the dreaded mispeling vyrus.
You changed your sig. Now I can't see you as I scroll through the fora! I thought I was talking to some random Scratcher all the way through this topic!![]()
Same! I liked the old one
And don't you dare change yours sparks
Last edited by LS97 (2011-09-11 09:57:12)
Offline
Haha, I never read usernames really, I know people by their sigs which is why the sig switching day a while back totally threw me!
And my sig changes itself, sorry about that!
Offline
sparks wrote:
Haha, I never read usernames really, I know people by their sigs which is why the sig switching day a while back totally threw me!
And my sig changes itself, sorry about that!
oh yeah, that day was a terrible mess
What I mean by your sig changing is the text inside it is fine, but keep the skin.
Offline
LS97 wrote:
sparks wrote:
The world has truly gone two pot if Scimonster has caught the dreaded mispeling vyrus.
You changed your sig. Now I can't see you as I scroll through the fora! I thought I was talking to some random Scratcher all the way through this topic!![]()
Same! I liked the old one
![]()
![]()
And don't you dare change yours sparks![]()
This one is just for 9/11. I'll put it back in a day or two.
sparks wrote:
Haha, I never read usernames really, I know people by their sigs which is why the sig switching day a while back totally threw me!
And my sig changes itself, sorry about that!
I don't read usernames either.
Offline