|
|
I need to watch out for these in my teams code. Can you suggest a C# book that focus on LINQ performance? I have to learn them first!
Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy Falcon.
|
|
|
|
|
Not a recent book.
There's Pro LINQ by Apress, but that's from 2010 already
However, you don't really need a book.
If you're working with LINQ-to-Entities I'd use a profiler and check out every SQL query that gets send to the database (I think they're printed in the output window as well, but that's a bit of a search).
For LINQ-to-Objects I wouldn't worry about performance too much, just make sure you keep the non-deferred LINQ operators for last
Tools like Visual Studio and Resharper can also give you tips, like revert coll.Where(...).First(); to coll.First(...);
|
|
|
|
|
oh wow LINQ is old. OR, there's so much already packed in, that people are still learning. hehe
thanks!
Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy Falcon.
|
|
|
|
|
You can't be serious? That's both hilarious and infuriating.
|
|
|
|
|
Yeah really.
The good thing about this guy was that he knew his shortcomings and acted accordingly (did not invent anything new and when he did he asked a second opinion).
Then I've worked with people who were completely incompetent, but still thought they could tell shout me how to write my code
|
|
|
|
|
charlieg wrote: I'm living in a static global world
My World is pretty dynamic.
charlieg wrote: control c / control v must be banned
No! I don't want to type that same basic template for model classes again and again. This and other goodies are there in my repository of common things I need in almost every project I work on. And I will copy and paste them. Wow, I am gansta!
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[ ^]
|
|
|
|
|
the control c / control v comment was mostly in jest... mostly.
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
I'm glad I'm not the only one thinking this way
|
|
|
|
|
charlieg wrote: Inheritance results in hemorrhoids and other digestive issues Only if applied cluelessly (which I have done in several occasions and hopefully I learned from them though I wouldn't bet on it).
charlieg wrote: I have a file that contains data. I have several of them.
charlieg wrote: I'm thinking that to advance software development to the next level, control c / control v must be banned. You'd have fixed 90% of the bugs in our codebase and driven to the mental hospital one of my less favourite coworkers. Motion approved!
When I begin a new project I encapsulate everything, and I do the same when I'm tasked to modify something that exists. The only problem in my environment is that we don't have a single product but about five hundreds of them and growing, all with more or less the same code at different points in time over 20 years but no shared file. Each version has its own copy and the source control is a plain .zip file. This means that I may have to fix the same thing over a dozen of times before it becomes the new baseline for the future - the existing products are still to be maintained with the old code and architecture.
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
|
|
|
|
|
I would have agreed with you even still 2 years ago.
Now I am really facing the market reality, and I am less evangelistic about holy code. Actually, getting things done faster and cheaper has superseded the need of quality - alas - and people do not care about quality anymore. Security issues in Facebook due to poor coding ? After a bit of show from Zuckerberg, everybody has already forgotten. Thousands and thousands of bugs in Microsoft products ? People earn money by blogging and youtubing about workarounds.
So if the demand is "please get me this done for yesterday and for no money", then copy & paste code is plain OK.
In my current position, which gets a bit above the boundaries of SW development, management made the choice to get products done and tested in low-cost locations, with a ratio of 3 people designing for 2 people fixing the design mistakes as they pop up in series production. Altogether, these 5 people are still 1/3 the cost of one solid and experienced engineer here and they are processing about 2 to 3 times as much projects, so ... The trend in the industry is to get low-cost locations do rapid-prototyping as product design and rapid-fixing on a case to case demand, since - unless very bis issues - nobody cares about quality. The experience of the designers in low -cost locations grow faster than their cost, so in about 2 to 3 years, we can expect an equivalent design skill as in high-cost locations, but for still half of the price, and the 2 fixing guys can probably be reduced to 1.
The only sacrificed element in all this is a bit of quality, but foremost innovation - future will tell if the business model can survive.
|
|
|
|
|
As a guy that wears a cybersecurity hat, I thank you for ensuring my future employment
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
charlieg wrote: control c / control v
Hey, isnt cloning mans answer to evolution?
|
|
|
|
|
charlieg wrote: I'm thinking that to advance software development to the next level, control c / control v must be banned.
I wouldn't dream of using control c / control v...
...now that I've coded them into a couple of redundant gaming keys.
|
|
|
|
|
Polymorphism is DAMN useful. MS broke inheritance in .net when they coded themselves into a corner resulting in the seemingly arbitrary restriction that a programmer could only inherit from a single class, but multiple interfaces. What a crock.
None of these OOP constructs would be confusing if instructors actually knew how to, oh, I don't know - INSTRUCT.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
modified 4-Jun-18 8:42am.
|
|
|
|
|
Well, it as not something Microsoft came up with. Languages like Java had that way before C# did. People moving from C++ usually find it an annoying restriction but after a few years of coding in C# or Java, most people usually find it to not be much of a limiting factor at all. And compiler authors don't have to deal with the diamond problem and all the complexities it adds to the compiler definitions.
|
|
|
|
|
Nish Nishant wrote: People moving from C++ usually find it an annoying restriction
That's me - in spades...
Nish Nishant wrote: but after a few years of coding in C# or Java, most people usually find it to not be much of a limiting factor at all
Nope. Still annoying, even after 11 years of coding in C#. I'm honestly not interested or concerned with the burdens experienced by compiler authors. The only reason C# even exists is because Microslop was bitch-slapped for trying to take over the java domain.
It's okay, though. I'm old, and soon I'll be dead, allowing Microsoft to continue on unmolested, because soy-boys willingly accept their assault on programming languages, and all the real programmers that raged against their absurdities will have passed away.
Eventually, you'll be able to write complete programs with a series of words like "flopgloop" and "pardultary". No matter what order you place them in, the app will still compile, but the functionality will change.
EDIT ==============
Microslop has proven once again they don't have any original thoughts left, by purchasing GitHub.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
modified 4-Jun-18 9:52am.
|
|
|
|
|
charlieg wrote: Why would you not write a class to handle it?
It's called "dumbing down."
|
|
|
|
|
Some people think that they are programming, simply by blindly copying/pasting working blocks of code and "search" the internet for other snippets to copy. Ask for a minor change, and they'll replace the entire block by another that has been "found".
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
charlieg wrote: why encapsulation is ignored Because history repeats.
|
|
|
|
|
In my experience (~= 15 years of research about minimalistic design approaches) OOD is a flawed concept.
In theory, there's nothing wrong with it and it should lead to a better than average design, consistently.
In practice, abstraction is horrible, because people are really awful at defining, sharing and accepting the initial purpose of abstracted objects.
In part, this is because making the abstraction is rewarding in and of itself, while accepting an existing one is horrendously tedious.
The only form of OOD that seems to work consistently, is when you severely limit it to communication interfaces, DBO's and DTO's and drop polymorphism and inheritance all together.
Anything else, and people will misinterpret the abstracts made and muck it up beyond comprehension.
Also, reusability at object level is a maintenance nightmare. Reusability at API level is where it's at.
|
|
|
|
|
charlieg wrote: control c / control v must be banned No problem with that.
I use shift-delete / shift-insert.
|
|
|
|
|
I think you mean
control+insert / shift+insert
shift+delete is the same as control+X
as further evidence about MS lack of originality per a previous post.
Control + C, V, X were copied from Apple's Macintosh.
|
|
|
|
|
Actually no, I do mean shift-delete + shift-insert. (I find it easier to cut and immediately paste, then paste the copy). No need to move the right hand then. ) Also means that VS marks the "copied from" line as changed, which is a useful reminder when scrolling back to copy other code from the same area.
|
|
|
|
|
gotcha. I have a coworker that uses that pattern.
[shift+delete shift+insert] [navigate] [shift+insert]
Since I am writing this response later, I am scratching my head and wondering how we started talking about copy+paste when the subject has "OO design" in it! lol [but I am not going to go back and figure it out].
|
|
|
|