|
Actually you did, even if you didn't intend to.
|
|
|
|
|
harold aptroot wrote: Actually you did, even if you didn't intend to. Actually I didn't, intentionally or otherwise.
Use the best guess
|
|
|
|
|
No, you did. Look, you said "I would choose the first for readability and maintainability".
You can only make that choice for that reason if you believe the first to have better readability and maintainability. Thus by symmetry, the other thing must have worse readability and maintainability.
|
|
|
|
|
No, I did not. I know exactly what I said, and I cannot help it if you choose to believe that I said something else.
Use the best guess
|
|
|
|
|
I don't choose to believe you said something else, I quoted you exactly. Evidently I'm reading something into it that you didn't intend, but I just proved my point while you keep saying the equivalent of "lol nope".
|
|
|
|
|
harold aptroot wrote: I quoted you exactly. No, you are trying to tell me what my words meant. I am telling you that your assumptions are wrong. Why do you continue to insist that you know better than me what I meant? You are rapidly going down the troll road.
Use the best guess
|
|
|
|
|
Look I'm getting tired of this as well, so I'll just reword my question: could you explain why you feel that the first method has better readability and maintainability, please?
But really, accusing me of trolling was uncalled for. I did my best to be as civil as possible, explaining my point and all, and you're still just telling me "lol nope".
Richard MacCutchan wrote: Why do you continue to insist that you know better than me what I meant? I don't. I insist that the words you wrote do not unambiguously convey what you intended to convey.
|
|
|
|
|
harold aptroot wrote: could you explain why you feel that the first method has better readability and maintainability, please? I already explained, and my face is getting blue: that was my first choice; take it or leave it. I have no need to explain anything further.
Use the best guess
|
|
|
|
|
|
Keith Barrow wrote: Which do you think is better? "I don't care" when I read it.
Both are readable. You're even allowed to do #1 without the { }, as long as you properly indent. And please, omit the comment - it's useless. I've switched to yoda-conditions, but then you could argue that I'm "hurting" readability.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: You're even allowed to do #1 without the { }, as long as you properly indent.
that's really unreadable for me don't do this
For me form ?: is accurate if for some reason you have deep nesting, so you can avoid your code getting more complicated to read.
mm
|
|
|
|
|
Member 9957753 wrote: that's really unreadable for me
don't do this One learns to recognize them fast enough once you're in a project with a lot of developers that aren't all up-to-date on the coding-"rules".
Member 9957753 wrote: For me form ?: is accurate Might be totally unreadable to someone else. The compiler OTOH doesn't care.
I'm with the compiler - as long as it's correct and obvious, fine, do whatever you like. The inline-if is nice for choosing between variables, but not if you're going to put a lot of code in there. If there's a lot of going on, I'd rather see a complete if-else where I can jam some breakpoints in.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Option 1 was a cut'n'shut of the original code, I'm removing the braces. The comment was added by me for the purposes of the post, really to indicate there is logic going on after the bit I'm interested in.
I used to use Yoda conditions as a matter of course during the brief period I used c++. Obviously the c# compiler throws out a warning if you do this, and left to my own devices I keep these down to 0.
“Education is not the piling on of learning, information, data, facts, skills, or abilities - that's training or instruction - but is rather making visible what is hidden as a seed” “One of the greatest problems of our time is that many are schooled but few are educated”
Sir Thomas More (1478 – 1535)
|
|
|
|
|
Hi,
I am new to C# and trying to learn it by doing projects.
I have a situation where data from ms access is to be shown in datagridview combobox.
Suppose, I have table TYPEMASTER with the columns typeID and typeDESC. And I have Datagridview with 2 colums - One Combo Box and another text box. Datagridview combobox is to be populated with typeID, so that once typeID is selected, corresponding typeDESC will populate in the second column of datagridview.
|
|
|
|
|
srinibdvt wrote: I am new to C# and trying to learn it by doing projects. ..and what have you done to try this? Where are you stuck?
srinibdvt wrote: Suppose
Well, it's possible. Have you worked with a grid before? Do you know how to fetch data?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I don't see the need for a gridview there but regardlesss, for the TextBox to populate when the ComboBox selection changes you will need to write code for the ComboBox's SelectedIndexChanged[^] event.
Follow the example in that page, see what it does, and then see if that's what you want to do, if it is come back here and tell us, if its not, come back and ask further questions, showing what you've done
If you think you can do a thing or think you can't do a thing, you're right - Henry Ford
Emmanuel Medina Lopez
|
|
|
|
|
|
There are many reasons for differences in speed on different systems; it is not a valid comparison.
Use the best guess
|
|
|
|
|
The person who makes the comparison is working in a famous non profit server organization and sound like he knows what he is doing.
|
|
|
|
|
Then maybe you should go and talk to him. This sort of question is not really appropriate for these forums.
Use the best guess
|
|
|
|
|
This is an objective question if we comparing these with the same hardware. Latest Java+linux, latest windows+c# are two objective objectives that can be tested and compared with measurable speeds of specific tests.
|
|
|
|
|
That may be, but this is still the wrong forum for this type of discussion; try the Lounge[^].
Use the best guess
|
|
|
|
|
people from lounge saying they don't talk about this kind of serious programming topic over there, they prefer to talk something else like drinking. Check out the replies over there of one of my posts.
|
|
|
|
|
|
How can this has nothing to do with programming when we are discussing which is faster? Speed is extremely important for a programming language, if not c++ would not even exist.
|
|
|
|