And the customer almost always wants a change.
i cut most of my teeth in a modular synthesis environ with an sdk for custom modules. each module displayed cpu consumption and i spent years watching the little numbers drift around in different applications.
course, i also used borland's 5 meg fclt for twenty years because it's faster than the modules compiled with vc++. and i don't think any professional will advise use of fclt.
the nice thing about fclt tho was a ~0.5s compile time. bam. bam. bam. bam. bam.
i've been programming since 1983. this is the first place i've seen anyone speak against "magic numbers" which, elsewhere, as simply referred to as "numbers". i'd laugh if i wasn't sick of this kind of pointless discussion/style queen tea party. if you need to be right, make your own observations.
All I can say to this, is that you are missing the point. Perhaps in your working environment programmers were simply too well behaved to throw around undocumented values.
i think that would be accurate.
think i reached 60k lines on two occasions writing procedural music generators, using terse variable names like "a" and "b".
on a screen 600 pixels high, i like to see as much code at once as possible. descriptive_variable_names... mystifying. all that screen real estate to encourage people not to focus.
what if you have to use those variable names in a complex calculation? simple linear interpolation would run off the right side of the screen with variables like cutoff_frequency.. i need to see the context, not see the same descriptive name hundreds of times in my code.
b += w * (a - b);
filter_buffer += cutoff_frequency * (input - filter_buffer);
similarly, some people find that writing notes on paper helps them remember. if i had to write things down to remember them, i'd see it as a condemnation of my memory. i was raised to trust myself (and to descriptively annotate my headers).
I think, sometimes long winded expressions happen because the code isn't factored enough. If things get wrapped in smaller modules, you don't see so many 200 character lines...
b += w * (a - b) just sounds like you're trying to keep yourself employed by hiding the keys to the kingdom.
Yeah, yeah, you're obviously some kind of coding super-hero who lives on a higher plane than the rest of us. Good for you. Bad luck for anyone who has to maintain your code, though.
By the way, why do super-heroes use screens only 600 pixels high?
Well, nobody's insisting that you join in. In fact I'm surprised that you have - it's clearly beneath a person of your status.
guys, guys.
i'll add to it. i've actually been pretty well regarded for my software, won one of the DCs at kvraudio for vst development.
no one else ever has to look at my code. i'm not a professional. i'm an amateur. i do it because i love it. i make free software, because i think it's disgusting that people ask $400 for a cepstral transform and a filter.
i don't work with anyone else, the indy devs of the '00s tended to support each other because we love human beings, but not for dinner.
i chop down trees with a chainsaw for a living, because eg. professional software developers generally despise me. amazing how much difficulty i can be for them because i paid attention in geometry.
but no, a + b is keeping things simple so i can keep track of them. seeing the expression makes the identities visible when you do that.
i can understand why this may challenge your thinking. but no, i'm obviously an inferior. you wouldn't believe how much chainsawing can mess up your ears, but it's nice outside, and it keeps other software developers at a distance.
so remember, someone's always messenger up!
You never question yourself because you're always right?
Do you realize where that BS tautology goes, or comes from?
Please, post examples to educate those less gifted than your egotistic self. Or maybe you're not really that good...
Oh, in what way? So what are p and q in p+q? How does the addition make the identity any clearer? I do see the expression... but... the difference between a+b and p+q doesn't just jump out at me!
You are gaslighting.
If you are saying that variables can be identified by context, that is true but there are many things in coding that are sufficient to perform the task but not the best.
In fact, such an expression can be perfectly clear in a local context. It is when its scope is extended beyond a few lines that it becomes an obfuscation. Good example, although artificial:
int sum( int a, int b) {
return a+b;
}
or the classic:
for (int i; i < 8; i++) {
... // just a few lines
}
Because the semantics are contained in a small "bubble".
In Forth we use a data stack and the functions (in Forth, Words) and each function interprets the stack according to its definition.
The Word + takes 2 values off the stack, adds them a puts the sum on top of the stack.
Forth words are defined by what's expected on the stack, the word name and what's left on the stack. It's possible to spec a whole program without actually writing new code (you start with your Forth and extend it. That spec can be given to competent programmers who can split the job of filling it all in.
All that and it's OOP too!
Also in Forth as well as C, programmers are encouraged to keep definitions small so the semantics are more self contained...
It also makes the code tighter but the programmer can inline to suit since Forth has no guardrails to get in your way.
Actually, thinking back to 1985, Forth was a kind of variable name jailbreak for me at the time, because the 64 character identifier limit allowed me to start using readable names for things vs. the BASIC interpreter limitation of, I think, 8 characters at the time.
The functional approach was equally a jailbreak, as well as the possibility of using integer math.
The 6502 assembler I was using was a real challenge, with a limit of 6 character identifiers.
I hand typed in, yes, typed in the 6502 Forth kernel on paper that I mail ordered. Then saved it to cassette tape. Those were the days! ![]()
It might just be me, but that simple linear interpolation doesn't run off my right side of the screen?
You're forgetting that this dude is looking at the whole matrix in one go. He can see the lady in the red dress wherever she goes.
Try writing like that and coming back to it after a year...
Isn't needing to see the whole context just an insult to your superior memory? Surely you can just peep a few snippets of code and remember the full context anyway?
I'm not sure exactly why you've decided to jump on a thread you disagree with, just to look down your nose at those of us trying to better ourselves. Maybe your ego needed a boost, or maybe you thought that we'd all convert to your way of coding by throwing the code structure out the window and replacing every variable and function name with a single letter.
I do wonder what happens after you get past 26 variables? Do we go to x_a or x2 perhaps?
Maybe I'll give up trying to learn how to code like you and chop trees instead.
Reminds me of an app I helped to support. It was a GUI front end written in tcl/tk. About 20,000 lines of code using variable names like 'vx3' and so on. One or two massive files, IIRC. No comments or documentation at all. No oversight, it was assigned to only one engineer, who developed and managed it for about a year and then moved on. That created quite a snafu, but they found another person to take it on. It was a real bit of job security for both of them.
A second tier of support techs was then required, since the programmer had no time left from maintaining and grappling with it, to actually tailor it to its production demands. Finally, a team in a different part of the company independently wrote almost the same app but completely in Java. The whole tcl/tk mess went in the garbage can within a few days of transitioning. The second support engineer went on to a real job. The Java app was rolled out globally to dozens of factories.
That was the conclusion of an investigation in which the two apps were compared and the Java one came out the clear winner, even though the human interface wasn't as spiffy. Understandably, a high premium was placed on maintainability.