|
generation helps with that. the more code you write by hand the more bugs you can introduce.
it's better to use machine generated code when that code is suitable for the task. it costs less, and code coverage isn't as mission critical in tests (which in the real world in most shops never approach full coverage if they even track testing at all)
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
codewitch honey crisis wrote: it's better to use machine generated code when that code is suitable for the task. That could be said, but, for me, every generated statement has to be checked by developers with the same diligence as every other statement in the program.
It don't matter none whut wrote it, it has to be checked with pure human bum-in-seat diligence.
I've rarely found it to save time, in shops that demand real precision.
Cause confusion, sure; save time, no.
We're still not at the point, in almost everything, were absolute precision can be generated, and even generating "little and obvious" stuff leads to lots of human double and triple checking.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
i check the generation. it gets checked once. if you're checking generated code more than cursorily after that you're duplicating effort, and in this case that's a huge time waster.
i've been coding for about 32 years, professionally i did for about 20. In that time I've generated a lot of code.
In fact, I don't think I've ever worked on a 3-tier app I didn't have control over that didn't use at least 15% of the middleware code being generated, if not more. At companies like Acrosonic it was a lot more, because we didn't have very many devs, and we had a lot of diverse clients with diverse needs.
If you want to build "vertical applications" for small businesses for example, generated code is your way to do so profitably.
And if you want to architect enterprise apps, generated code is often going to be a part of it, at least if you're dealing with anything redundant.
Edit: I should add that this is going to probably be an intractable philosophical difference between you and I, and I am okay to agree to disagree.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
codewitch honey crisis wrote: Edit: I should add that this is going to probably be an intractable philosophical difference between you and I, and I am okay to agree to disagree. Agreed.
Or do I mean "disagreed"?
Damn! My Response Generator can't handle this!
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
you've been replying to mine the entire time
welcome to my AliceBot, codeproject edition.
just kidding
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Err368
alicebot implied
discontinue
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
I'd use typedef if C# had one as powerful as C++'s. Using just doesn't cut it.
in the meantime it's VAR ALL DAY LONG.
Haters gonna hate.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Even VS 2019 asks to create a strongly type variable rather than a var in a lot of cases. So yes, take your VAR and shove... (SMACK)
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
i will take hostages if i must in order to avoid typing long as days generic and tuple declarations.
you have my list of demands. it is simply. I require typedef.
otherwise, VAR VAR VAR!!! =D
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
and the minute i take coding advice from Microsoft's Clippy, just go ahead and shoot me in the face. With a .45. I don't deserve an open casket.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Ah Clippy, despised even more than VB. I consider siri, cortana and all their ilk the bastard children of Clippy.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
visual studio's nagging reminds me of it.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Mycroft Holmes wrote: I consider siri, cortana and all their ilk the bastard children of Clippy That's an eloquent way to put it, and I cannot explain why that made me think of the "Chucky" movies
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
Var is for programmers with a lack of a sense of commitment.
".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 29-Jul-19 5:17am.
|
|
|
|
|
for(var guilty=now;guilty<endOfDays;++guilty) ;
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
|
what's wrong / not good enough with (at the top of the file):
using IntList = System.Collections.Generic.List<int>;
|
|
|
|
|
For simple things it may work, and I use that.
But now try to make a Dictionary of those the same way.
|
|
|
|
|
Mm...
do you mean while this work...
using IntList = System.Collections.Generic.List<int>;
using DictIntList = System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<int>>;
this short cut is sadly incorrect
using IntList = System.Collections.Generic.List<int>;
using DictIntList = System.Collections.Generic.Dictionary<string, IntList>;
However either way you can still write:
var d = new DictIntList();
var l1 = new IntList();
d["doo"] = l1;
|
|
|
|
|
Super Lloyd wrote: d["doo"] = l1; I give in, and I know it's going to annoy me all day.
What song's it from?
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
|
I always had this idea one day to start to add some F# utility library to my home utility libraries....
But this project has still gone nowhere in a long time :/
|
|
|
|
|
Super Lloyd wrote: this short cut is sadly incorrect
Annoyingly, it works if you put the using statements in different scopes:
using IntList = System.Collections.Generic.List<int>;
namespace TestIt
{
using DictIntList = System.Collections.Generic.Dictionary<string, IntList>;
...
Type Alias | C# Online Compiler | .NET Fiddle[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
hahah good find!
|
|
|
|
|
doesn't work in the real world.
Most of the time I need more than static typedefing. I will need to fill in a T parameter somewhere.
If using let you do like - using Fat<t> = IDictionary<t,fa<t>>; then i would use var less.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|