|
1. The lounge is for the CodeProject community to discuss things of interest to the community, and as a place for the whole community to participate. It is, first and foremost, a respectful meeting and discussion area for those wishing to discuss the life of a Software developer.
The #1 rule is: Be respectful of others, of the site, and of the community as a whole.
2. Technical discussions are welcome, but if you need specific programming question answered please use Quick Answers[^], or to discussion your programming problem in depth use the programming forums[^]. We encourage technical discussion, but this is a general discussion forum, not a programming Q&A forum. Posts will be moved or deleted if they fit better elsewhere.
3. No sys-admin, networking, "how do I setup XYZ" questions. For those use the SysAdmin[^] or Hardware and Devices[^] forums.
4. No politics (including enviro-politics[^]), no sex, no religion. This is a community for software development. There are plenty of other sites that are far more appropriate for these discussions.
5. Nothing Not Safe For Work, nothing you would not want your wife/husband, your girlfriend/boyfriend, your mother or your kid sister seeing on your screen.
6. Any personal attacks, any spam, any advertising, any trolling, or any abuse of the rules will result in your account being removed.
7. Not everyone's first language is English. Be understanding.
Please respect the community and respect each other. We are of many cultures so remember that. Don't assume others understand you are joking, don't belittle anyone for taking offense or being thin skinned.
We are a community for software developers. Leave the egos at the door.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
modified 16-Sep-19 9:31am.
|
|
|
|
|
Most people like their music bass-boosted, but it just seems like too much treble.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I'll note that this thought may strike a chord with some key people, others may waltz around believing that it falls flat, and doesn't scale new heights.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
You people are sick, sick in the head. The tenor of your alto egos is too much.
|
|
|
|
|
Give it a rest!
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
rnbergren's recent post about variable names was good.
Lots of helpful advice poured in.
I didn't respond but I think that I should have done so.
rnbergren's post was about using frivolous or silly names for Variables and other things in proof of concept code and then using this as in copy and pasting in the real code. Sometimes changing it and sometimes not. Enjoying it or not.
Most responses were like, do it properly in the first place and it won't end up in your production code.
I agree. I have done it in the past but not anymore.
However I do like to be creative and sometimes I look at a previously named function, sub or Var name and marvel in it's relevance. I often comment/remark on the name as well so that it makes sense to others.
Sander Wrote:Quote: So no, I've made doing it "right" a habit and would not even think about naming something "astr" or "ewww" Smile |
OK ewww is a bit weird unless the table has field names like ewww and ahhh. (I love and respect Sander.)
I used to always use nresponse as the throw away variable name for things like the result of an input box within a sub.
I remember using ansStr once which was commented as 'answer string'. So close to astr.
Personally I don't see the problem especially with a throwaway Variable.
It is only there for a few micro seconds.
Every other name is important.
So I am interested in what others use for a throw away variable names used to hold a response from something like an inputbox or similar.
Do you always use the same name and if so what is it?
Or do you change it to suit the situation?
"Rock journalism is people who can't write interviewing people who can't talk for people who can't read." Frank Zappa 1980
|
|
|
|
|
I already voted. Once I am past like 2 stupid variable names or I am past 15 lines of code. Well the whole thing needs to be cleaned up for the masses.
I pretty much only use astr for strings and some other silly ones.
Fun discussion. can't wait to see the posts.
To err is human to really elephant it up you need a computer
|
|
|
|
|
Quote: Fun discussion. can't wait to see the posts.
Yeah same here.
It is something that isn't normally spoken about.
Thanks for steering this one as well.
"Rock journalism is people who can't write interviewing people who can't talk for people who can't read." Frank Zappa 1980
|
|
|
|
|
C# has "institutionalized" throw-away variable names: Discards - C# Guide | Microsoft Docs[^] but they aren't quite what you are talking about.
If you mean that an input box returns a value and you'll use it just once, then don't store it in a variable: use it inline, or give it a sensible name if that'll make your "single line of code" unreadable. "result" is a good one - it at least tells you that it's probably short term, but give you a clue what it contains if extra code is added at a later point.
DialogResult result = MessageBox.Show(prompt, caption, MessageBoxButtons.YesNoCancel);
if (result == DialogResult.Cancel) return;
if (result == DialogResult.Yes)
{
... If later code makes the "Cancel" branch bigger (logging, "Are you sure?" that kinda thing maybe) then the sense of the code is retained.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: then don't store it in a variable: use it inline
Except when it kills readability, like Commandstrings.
<edit>Didn't even read the full sentence properly.
|
|
|
|
|
Jörgen Andersson wrote: <edit>Didn't even read the full sentence properly
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I'll blame an unfortunate linefeed.
|
|
|
|
|
Yes Sensible. I like it.
Thanks.
"Rock journalism is people who can't write interviewing people who can't talk for people who can't read." Frank Zappa 1980
|
|
|
|
|
Guilty. I tend to reuse "CommandString". Only change it if I use more than one at the same time.
|
|
|
|
|
Some say that consistency is a virtue.
I think that your tendency is OK and readable.
Somethings just become habits.
Thanks, it is interesting.
"Rock journalism is people who can't write interviewing people who can't talk for people who can't read." Frank Zappa 1980
|
|
|
|
|
I've never used silly variable names, even for throw away variables, but I do use result and response quite often. I try to use generic variable names in specific types of methods, such as methods used in the data access layer, so I can make templates from them. I try to balance readability, simplicity, and functionality when writing code. That's why I found it quite difficult transitioning from the old way of writing variable names (a$ as an example) to writing out full length variable names such as errorLogEntity.
"When you are dead, you won't even know that you are dead. It's a pain only felt by others; same thing when you are stupid."
Ignorant - An individual without knowledge, but is willing to learn.
Stupid - An individual without knowledge and is incapable of learning.
Idiot - An individual without knowledge and allows social media to do the thinking for them.
|
|
|
|
|
Does Nicola Sturgeon[^] like like a younger version of Angela Merkel[^].
Maybe it's a Lady-Prime-Minister thing . . . or a cloning experiment gone wrong?
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
I think she looks more like a grown-up Jimmy Krankie.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard Deeming wrote: like a grown-up Jimmy Krankie But not as pretty. 
|
|
|
|
|
"I didn't mention the bats - he'd see them soon enough" - Hunter S Thompson - RIP
|
|
|
|
|
I just found myself Ctrl-Tabbing between the two images.
What on earth am I doing?!?!?
I need or possibly ![Beer | [beer]](https://codeproject.global.ssl.fastly.net/script/Forums/Images/beer.gif)
|
|
|
|
|
It is just the haircut.
She is a lawyer not a scientist.
"Rock journalism is people who can't write interviewing people who can't talk for people who can't read." Frank Zappa 1980
|
|
|
|
|
Data format inserted in charged particle (11)
// TODO: Insert something here Top ten reasons why I'm lazy
1.
|
|
|
|
|
Information ?
"I didn't mention the bats - he'd see them soon enough" - Hunter S Thompson - RIP
|
|
|
|
|
Too easy. You're up tomorrow.
// TODO: Insert something here Top ten reasons why I'm lazy
1.
|
|
|
|