|
I think everyone is right here. The var keyword was put in specifically for LINQ. Yes - it does introduce a chance to code sloppy. Its a trade off. I like to use LINQ to slice over CSV Files, and other such collection queries.
I don't like var though, outside on its own, without a leash.
Where there's smoke, there's a Blue Screen of death.
|
|
|
|
|
Well, I wouldn't say you're TOO grumpy though I always considered those three (i,j,k) to be reserved as loop variants (Ever since FORTRAN IV) and still only use 'em for that even in my C# code!
Yeah, variable names ought to be a bit more descriptive!
|
|
|
|
|
This isn't isolated to LINQ. You see the same behavior in for/foreach loops as well. The only time I use single letters is when the variable is for an index.
Scott E. Corbett
|
|
|
|
|
I agree with you on the first Select because there's a little complexity in that lambda, but for the OrderBy and second Select, its one line of code, and if it isn't obvious what the parameter represents and how its being used, then a longer variable name isn't going to help the reader much.
Personally, for those one-liners, I prefer the simple 'p' argument -- less for my eye to read and my brain to parse (and ignore), which means I reach understanding of the code a lot faster.
We can program with only 1's, but if all you've got are zeros, you've got nothing.
|
|
|
|
|
I have always attributed this to the "it's a sample" mentatility. In samples you variables named myObj and newVar and stuff. You should not name things like that in production code, and neither should you use single letter small scope variables.
While I have seen both in production code (really, you named the search parameters myString?), I discourage their use (even in linq) in favor of more descriptive names. Perhaps we should insist on better quality examples for teaching these technologies to help instill better habits in new and learning programmers.
|
|
|
|
|
Yes, you are but so am I. I guess that linq is all about lazyness, don't you think?
Instead of using single char variable names I mostly use a short descriptive name for the type like 'car' or 'person'.
In this case I'd use 'ivpair' instead of sortItem, since the OrderBy is clear enough for me. Also 'item' adds no more clarity than 'i' or 't' because the item type is irrelevant for sorting.
The lazyness is IMHO encouraged by the numerous examples available and course exercises; they tend to save on keystrokes and sacrifice maintainance. Can't change the world though...
|
|
|
|
|
I program 30+ years. 30+ years before I'd start programming, i,j,k,n were well known cycle counter variables for one page code.
|
|
|
|
|
Update: Maintenance done, and we're now just waiting and watching SQL spool back up. things may be slow for a a couple of hours but after that we should be good to go.
We're adding the final touches to our migration to a new hosting centre which requires a rebuild of our database server. To make this easy and painless for the poor souls involved we're going to go read-only for 2-3 hrs while the maintenance is completed. We're hoping it'll all be done by 9pm US Eastern tonight.
I'll update this as soon as we have progress.
cheers
Chris Maunder
modified 11-Aug-15 20:54pm.
|
|
|
|
|
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
|
Someone pass the barf bag.
That's awful and awesome at the same time.
cheers
Chris Maunder
|
|
|
|
|
|
For those who were worried about the bug in codegen[^], it's now been fixed in today's patches.
Quote: Update 8/11/2015: We released an updated version of RyuJIT today, which resolves this advisory. The update was released as Microsoft Security Bulletin MS15-092 and is available on Windows Update or via direct download as KB3086251. The update resolves: CoreCLR #1296, CoreCLR #1299, and VisualFSharp #536. Major thanks to the developers who reported these issues. Thanks to everyone for their patience.
TTFN - Kent
|
|
|
|
|
For anyone else on Windows 10 who's confused that neither 3086251[^] nor MS15-092[^] appear in Windows Update, there's a tiny foot-note in the security bulletin which explains:
The Windows 10 update is cumulative. In addition to containing non-security updates, it also contains all of the security fixes for all of the Windows 10-affected vulnerabilities shipping with this month’s security release. The update is available via the Windows Update Catalog only. See Microsoft Knowledge Base Article 3081436[^] for more information and download links.
So on Windows 10, this will appear as Cumulative Update for Windows 10 for x64-based Systems (KB3081436).
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Should've been posted to and emailed out as part of the Insider.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Yeah, but then people would have complained that the post was days old (even with the update on it).
TTFN - Kent
|
|
|
|
|
- You can't drag an address from Edge onto the desktop to create a shortcut. Dumb omission.
- Connecting to a VPN now requires 4 clicks (including having the "Settings" dialog open) instead of two clicks almost in-place)
- No
areaAero. I know it's in there, buried, but so far I've not had any luck enabling it.
...and if that's all I can find to complain about then something went right somewhere.
cheers
Chris Maunder
modified 11-Aug-15 21:02pm.
|
|
|
|
|
|
Cortana isn't available in Canada. It's available in the US and UK, but not Canada. This is par for the course - so much so that I no longer get angry - just sad.
Resolution? No issues my end.
cheers
Chris Maunder
|
|
|
|
|
|
Check you have the correct speech and language packs installed for your region. That's the usual issue if you can get Cortana in your country.
|
|
|
|
|
|
|
What did you Canucks do to deserve such mistreatment?
Oh yeah, you gave us Alanis Morissette.
She is enough to cancel out all that Rush and BTO gave to us.
|
|
|
|
|
And Justin Bieber
|
|
|
|