- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Nice, Thanks! I sux I forgot the a in variable twice
Admin
Sounds to me like you make an excellent case for refactoring. Why place bandages on a kludge? You just end up with a mass of incomprehensible, half-dead, bandaged code that way. If a function is so long that you can't remember the type assigned to a variable when you use it, then it is time to break that function down into more comprehensible chunks. If time-bombs are scattered throughout an application, then it's time to refactor the program to root them out.
Admin
Use Eclipse or any decent IDE. Select variable. This highlights all instances of the variable in the file. Then selected Refactor. Enter sensible variable name.
Two birds killed with a very large boulder. Asteroid. Planetoid. With one hand on the mouse instead of on the keyboard. Bum.
Dammit, why don't you make the damn captcha antidisestablishmentarianism if it's going to be so long?
Admin
Admin
Admin
seriously that is blowing my mind! it's like the programmer said to himself "time to go monk. cacawww cacawww"
Admin
Admin
That's a population error. There's simply great gobs of VB code out there, especially for random in-house programs businesses make for themselves and don't care that much about the maintainability of.
Admin
Props for the Objectivist reference:
If Session("Reprint") = "" Then Session("Reprint") = "" End If
remember... A is A :-)
Admin
all my perl scripts look like this. I use it at most once a month so it takes me a few hundred lines to remember all the bug--I mean how Larry Wall thinks.
Admin
When the hell did this happen? I would love to know the etymology of this use of "refactor".
This isn't a danger of "our language vs. theirs", it's a danger of using a word to mean something it can't possibly mean.
Admin
I wonder then if that means that we Objectivists should spurn nullable types? ;-)
Admin
What a dumbass.
Admin
With NetBeans, I can easily rename variables, procedures and classes. The upcoming NB 6 will allow even deeper forms of refactoring, that make structural changes to the way a method or class is used, not just the name.
Admin
Which reminds me; how do you escape "]]>" so that it can appear in CDATA? Please tell me it's not ]]]]><[CDATA[>. Please. Even if it is. Because what if I want ]]]><[CDATA[>? ]]]]]><[CDATA[><[CDATA[>?
Admin
Doesn't [1] or xls:text </xls:text> [2] work?
[1] http://www.biglist.com/lists/xsl-list/archives/200207/msg01137.html)
[2] http://lists.evolt.org/archive/Week-of-Mon-20010500/031481.html
Admin
Except we aren't talking .NET, but VBScript where every variable is a Variant. Passing Nothing in a strongly typed language to a method expecting a String will get you a Nothing of type String. Passing Nothing to a VBScript method "expecting" a string will get you a Nothing of type Variant. Nothing does NOT equal "" just as it doesn't equal Null, Empty, 0, False or FILE_NOT_FOUND.
Admin
I do hope that you search for " a " (with blanks before/after) or better "\s*a\s+" or similar (at least in editors supporting regexes...) in such cases, not for "a" ... ;o)
Admin
Admin
The evolution of variable names (I tried to come up with something simple, "locus variabilis" meaning literally "variable place", I'm not sure if there's an official translation for "(memory) variable" into latin ;o) "pernimius" means "way too big")
a: locus variabilis stupidus
an: loc. var. neanderthalensis
accNo: loc. var. sapiens
accountNumber: loc. var. sapiens sapiens
accountNumberForBankingAccountInBankingApplication: loc. var. pernimius insanus
Admin
Nobody minds that a function called CheckString doesn't check a string? And I love vlu. If your naming standard is to remove all the vowels it should be vl.
Admin
Demonstrating admirably why controlling of the mating process and evolutionary systems should be tightly controlled by qualified specialists.
Admin
May I suggest "mutandum," or "that which is to be changed?" The equivalent for a constant would be, unsurprisingly, "constatum," or "that which is fixed/agreed upon."
Admin
Basically you have a point, but I wanted to keep it simple (how many people do know what a gerund is? ;o) and the simple version "changing place" (as opposed to "place to be changed") maybe even catches the intent of a variable more appropriately... didn't want to dive into a linguistic discussion, though ;o)
Admin
However, it's interesting to note that the terms we (programmers) use are actually closer to gerundives than to gerunds ("variable" and "constant" being essentially adjectival forms of the verb). This would make Ancient Greek a more appropriate language for programming than Latin.
But I'm sure we don't want to go there...
However, since you bind variables to a value, I would still stand by that old supine favourite. Well, that or S&M.
Admin
absolutely no reason to apologize :o) I concur that adjectival forms are better suited than gerunds.
the supine that you'd prefer ("mutandum" or also "variabilium" if I didn't get the ending wrong) would translate as "to change", but if I remember correctly, supines demand a verb of motion (like "going" etc.) and can't just stand on their own, very much the same as in english really - it just looks like a plain infinitive when lurking around alone. correct me if I'm wrong...
I'd rather stick to "variabilis" or "mutabilis" and translate it as "changeable" (not "changing", as I did in my answer to your post slap ;o), which to me seems to be closest to the spirit of what variables are.
hey, don't tell me that you learned ancient greek in school? I did, but it's a crying shame how much I've already forgotten... the same holds true for latin, but I found greek much more fascinating :o)
Admin
======= Edit of my own above post =======
erm, sorry... copy&paste... the supine would be "mutatum" ("mutandum" is the gerund...)
Admin
I must admit, I have done some refactoring myself. I have once changed:
Warning = IntegerToBoolean(TextToInteger(FormatBoolean(FeedMsg<>"", 1, 0)))
to:
Warning = (FeedMsg <> "")
NB: This is in a 'language' used in a graphical GUI that I am being forced to use for development. FormatBoolean takes a Boolean and two Texts (in this case implicitly converted Integers) and returns one of them as Text. In other words, it acts like the ?: operator in C, except the return value is always Text (which cannot be implicitly converted back to Integer or anything else for that matter).
And yes, 1 and 0 are converted to Boolean as expected.
Admin
Type in 8 letters to find one :)
Admin
'Objectivist'
Now that's funny.
Admin