|
I'm a little surprised query syntax isn't more popular. I recognize there are some things only possible with fluent syntax but I find query syntax so much more readable. Fluent syntax can get really ugly really fast with some queries. Interesting results
|
|
|
|
|
I don't use the query syntax ever. Just personal preference.
|
|
|
|
|
I prefer not to (use linq), if possible. You can over complicate the work and make it difficult for the reader (next person to maintain the code) to comprehend. If it takes a few more lines of code to make it quickly understandable, then I am all for it and will not use linq. I will let Resharper format code to linq statements, but, I will also comment the old code (before Resharper's changes) to let the reader know what is intended. If it takes more time to understand what is going on, then saving lines (or fewer lines) of code is not worth it. If the writer of the code feels that it is more expensive or less elegant to write more understandable code (even if it is a few more lines), compare it to the cost of another engineer's time who has to read and decipher that code.
Some say that code should be self documenting. But, it should also be quickly (and easily as possible) understandable. Few software people understand your thought process (or your shiny new toy and how to use it). And if it takes more time for them to understand what you handed down, then you did not do your job as an engineer. As a result, it costs the project more in terms of time and money. Part of the job of engineering (even software) is to allow your work to be maintainable. That is because the customer will eventually want to changes.
Some of you who reply may say that "if another software engineer cannot read the linq that I wrote, he should not be a software engineer". There are limits to that. Remember, as in math, keep your solutions simple, or the audience may not understand. But, your job, as an engineer, should exceed those standards to help reduce the project's costs and maintain its engineering quality.
|
|
|
|
|
Quote: I find the fact that Single is more used than SingleOrDefault a good sign since it means that the code using it is not riddled by endless null checks
Just riddled with unhandled exceptions and user crashes.
Quote: although I’m left wondering why FirstOrDefault comes before First
Why is someone who has obviously never written a program in his life analysing the code of others?
|
|
|
|
|
Agreed. I find it is almost always cleaner and clearer to call xxxOrDefault followed by a null check than to nest the whole thing in a try-catch block and catch exceptions in the event it fails.
|
|
|
|
|
I guess there are situations where a null return value is an error and should thus throw. The null check hides it - unless you are logging an error or throwing your own custom exception.
|
|
|
|
|
Having SQL in my head, LINQ's Query syntax make me mad!
|
|
|
|
|
Next will be the GitHub "Hall of Shame".
(I think I'll keep my code to myself for now; thank you very much).
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
|
I tried the early Google Cardboard - cool, but similar experience to yourself.... it served to whet my appetite however, and so I just dropped a *silly* load of cash on a new *development machine* <cough cough="">, that includes (for development purposes of course!) a spanking 1080 graphics card, a HTC-Vive kit, and <wait for="" it=""> the max ram the board could handle ... 128gb :P .... in fairness, I'm doing a lot of machine learning at the moment and that *eats* resources given the chance ... anyway - once its received I shall do a review and let you know the outcome!
|
|
|
|
|
|
Yup, got the HTC Vive VR..Room scale it seems!
HTC vive[^]
|
|
|
|
|
|
I'll report back once I'm up and running
|
|
|
|
|
Right! ... back from travels and got some chance to hook it all up and have a play around over the weekend.
First, here is the thing I got: HTC Vive[^]
Yes, a serious piece of kit and mad money .... but it was recently Christmas, hence....
Overall, it took about an hour to setup. Comprises headset, two hand-controls, and two boxes you setup on stands (or fix to the wall) that are called 'base stations' ... they basically track where you are in the room *very well*
Downloading the initial setup files and a few games took another couple of hours (best start this thing early in the day!)
The headset is a bit heavy after a while... not only heavy, but front-heavy, so can be tiring after a while.... they will improve over time as the the tech gets smaller etc. It has a long cable to hook back to the graphics card ... my understanding is there is already a wireless one int he works.
then I tried it ... wow
just
wow....
really, seriously, wow....
I didn't experience any eye strain ...or dizzyness, and this is in the full stand-up,'room scale' immersive experience.... you walk around (in a restricted space) and it tracks your movement perfectly... if you have someone in the room with you (useful, to watch the cables dragging on the floor etc, at least while you are getting used to the thing) they can see what you are doing on your monitor.
The couple of initial games I got were really good ... I then got a space-sim and wow - dizzy central! ... very hard to orientate myself in space, and this was sitting down at the desk, not standing ... not sure if that's anything to do with it.
Content overall excellent, but I did go for the best rated games first. Highly recommended if you have the cash to spare (or a gift day coming up and have lots of brownie points in your favor!!!)
|
|
|
|
|
I got Catherine the Samsung Gear VR 2 and am rather impressed by it - well, all except for the rubbish search for apps facility. As a test, loaded the Jurassic World VR - it's really very good.
This space for rent
|
|
|
|
|
No, not that I'll have to talk to Herself and watch TV tonight, though that's pretty bad.
Not that I can't get at emails once my PC is off - I can do that on the phone.
It's that I'm careful with my kit: this tablet is four+ years old, goes everywhere with me, has no case or screen protector. And it's scratch free. Chip free. The battery still holds a full days charge.
And I'm going to have to take an axe to it because it has all my bank account details and contactless payment, and I can't reset it to factory defaults unless it turns on.
For comparison, Herself's tablet is on its second screen and it's only just over a year old...
How well do you treat your kit, out of interest?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
OriginalGriff wrote: treat your kit
I do not have a tablet but I treat all of my equipment as well as I can. My Kindle is 5+ years old and still works as well as it did when brand new. My monitors are both 5+ years old and work just as well. If I replaced the scratch guard on my phone, it would look brand new also. The only thing I currently own that does not act brand new is one TV has developed an annoying habit of turning itself on.
Speed of sound - 1100 ft/sec
Speed of light - 186,000 mi/sec
Speed of stupid - instantaneous.
|
|
|
|
|
NotPolitcallyCorrect wrote: one TV has developed an annoying habit of turning itself on
That's just the ghosts. The afterlife isn't very entertaining.
|
|
|
|
|
Jon McKee wrote: the ghosts
That explains it. I avoid exercise religiously so there is nothing keeping them away.
Speed of sound - 1100 ft/sec
Speed of light - 186,000 mi/sec
Speed of stupid - instantaneous.
|
|
|
|
|
I don't have a tablet.
But I treat my phones very well. I never had scratches on the glass or elsewhere on the housing even not using some kind of cover. My boss brakes the glass of his phones at least two times a year.
It happened a few times that the phone slipped out of my hands. But that was luckily always outdoor when on grass.
My actual phone will hopefully last long. It has been replaced under warranty in November just before the two year warranty period was over.
|
|
|
|
|
Badly. To be correct: I treat them carefully and after two weeks they look a year old. My GF treats them carefully and after a year they look new.
DURA LEX, SED LEX
GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
If you think 'goto' is evil, try writing an Assembly program without JMP. -- TNCaver
When I was six, there were no ones and zeroes - only zeroes. And not all of them worked. -- Ravi Bhavnani
|
|
|
|
|
Since you have to kill it anyway why not open it up and see if you can fix it yourself. Almost certainly a circuit protection fuse blown..?
|
|
|
|
|
Partly I can't find my tablet opening tools, without which I'll just break the display trying to open it, and partly ... have you seen the inside of these things?
OK, it's all SMT for space reasons, but the level of integration is amazing! And even if a fuse is responsible, the PCB is so thin and delicate that my ham-fisted soldering techniques would only make things worse.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
OriginalGriff wrote: I can't find my tablet opening tools
Just look in the file of where to find things that is on your tablet. Oh....
Mongo: Mongo only pawn... in game of life.
|
|
|
|