|
i think i can see why. =) At points I had all the freedom I could stand.
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.
|
|
|
|
|
it recognizes the keyword delete.
If you put delete someVar; at the end of a routine you'll get a bunch of compile errors above that in your routine saying someVar was not defined, even though it was.
just a weird thing i noticed.
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.
|
|
|
|
|
Isn't C# garbage-collected? Maybe some low level file includes "#define delete #undef"
|
|
|
|
|
usually all of the weird undocumented keywords in C# are preceded by double underscore like __stackalloc
it might have something to do with LINQ? not sure if linq supports delete, but I'd doubt it. I don't use linq much.
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.
|
|
|
|
|
|
VS2017
It doesn't recognize it as a keyword per se. Doesn't highlight it in the editor nor does the compiler flag it as a keyword.
No, what it does is change the error reporting.
If you try to "delete" a variable you declared at the top of a routine, the editor will give you errors saying that said variable was not defined.
not just on the delete line, but everywhere you use it, as if you never declared the variable in the first place.
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.
|
|
|
|
|
honey the codewitch wrote: If you try to "delete" a variable ... the editor will give you errors saying that said variable was not defined ... not just on the delete line, but everywhere you use it, as if you never declared the variable in the first place.
Of course. That's cuz you 'deleted' it! The editor knows all!
|
|
|
|
|
JavaScript has the delete keyword (it removes a property from an object).
Perhaps VS can't decide whether you're writing C# or JavaScript?
|
|
|
|
|
Another wierdness:
The editor grays out "unneccessary" parentheses and qualifications and whathaveyou.
But sometimes it is too eager: "Object" is always grayed out when given as the class in a variable declaration.
For some static system functions / intrinsics, such as Char.IsDigit(), the class qualification ("Char.") is grayed out.
But you cannot delete them, neither "Object" nor "Char.".
So what is the logic behind grayint them out? (I believe it has been that way for several major VS versions; I currently use 2017.)
|
|
|
|
|
It's suggesting that they can be simplified to the C# built-in type keywords: object instead of Object , and char instead of Char .
Built-in types table - C# Reference | Microsoft Docs[^]
It doesn't make a huge difference for these two types. But it's worth noting that it's possible to define your own Object and Char classes, whereas you can't define a class called object or char without prefixing it with @ . (Could be useful if you wanted to really annoy your colleagues.)
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks! I had never noticed that use of graying before - only as a sign of something not needed.
I name all my own classes starting with an uppercase, so every now and then an uppercase initial sneaks in even for the system defined classes, by a "slip of the keyboard", without me taking much notice. Actually, I never wrote any code where explicit use of the class types were required. The implicit boxing always took care of it. So for my use, both Object and Char (with uppercase initial) might go away!
(There probably are cases were explicit use is required. I had been progamming C# for several months before I came into a situation where explicit use of "this" was required.)
|
|
|
|
|
They way their text editor highlights code it doesn't surprise me. It doesn't use Roslyn or anything like that.
It basically uses a technique a lot like contextual regex matching.
So it's bound to be dodgy at points. Frankly, I'm surprised it works as well as it does.
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.
|
|
|
|
|
0) I refactored the app so that the main window is a wizard form (I was originally displaying a separate wizard form).
1) All of the basic model/viewmodel generation is done.
2) Today, I managed got pretty far into the "mapping" wizard page, that allows you to select a stored proc that ostensiblty puts data into the database, and then map properties to the stored procs parameters. This is done via a combo box that only displays model properties that are of a compatible type with the selected parameter.
My brain is kinda fried...
".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
|
|
|
|
|
I don't know if you already know this, or how much you care, but
Microsoft UI guidelines (i don't have a link handy, is from memory) indicate that for every wizard way to do something there should be a non-wizard way to do it too.
Although a lot of apps bend or break this guideline.
Just FYI
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.
|
|
|
|
|
Look where Microsoft's guidelines have GOTTEN them...
Besides, "guidelines" are just that... guidelines. This app needs to step the user through the model generation process, because, well, user.
".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
|
|
|
|
|
i hear you. Like I said, I was just letting you know in case you cared. =)
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.
|
|
|
|
|
So in Microsoft's KwData package they implement a B+ tree.
However, roughly:
class Node {
Node Parent;
IList<KeyValuePair<int,Node>> ChildEntries;
}
instead of
class Node {
WeakReference<Node> Parent;
IList<KeyValuePair<int,Node>> ChildEntries;
}
Meanwhile, they've implemented custom enumerators for a 5%-10% gain in performance.
While putting all this undue strain on the garbage collector via mutually entangled references (Parent)
So it's not so much that they didn't optimize, but they didn't optimize consistently and in this case they're being pennywise and pound-foolish.
This isn't the only area for improvement. Problems like this exist all over the code.
And here I was wondering why such an ostensibly optimized class was behaving so poorly.
Needless to say, I'm starting over from scratch, rolling my own now that I know how they work.
I can't believe they'd do this. It's ridiculous.
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.
modified 17-Sep-19 13:59pm.
|
|
|
|
|
honey the codewitch wrote: I can't believe they'd do this.
As smart and wise and philosophical as you are, your innocence still shines through!
|
|
|
|
|
I'm not completely jaded yet.
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 is KwData? (and how old is it?)
|
|
|
|
|
Kw.Data - CodePlex Archive[^]
I think it was built originally using VS2010
EDIT: Don't bother using it. It's slow.
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.
|
|
|
|
|
honey the codewitch wrote: EDIT: Don't bother using it. It's slow.
That's not why I asked.
WeakReference<T> was introduced with .Net 4.5. Before that there was only the nongeneric version. So they couldn't have used it 2010.
How useful the nongeneric version would be in this scenario I can't say.
|
|
|
|
|
Interesting. I could have sworn WeakReference was added in .NET 2.0
oh well.
Edit: I was wrong
WeakReference Class (System) | Microsoft Docs[^]
The nongeneric has been available in DNF since 1.1
i thought the generic one would have been added in 2.0. Still it would have paid to use the non-generic one in this case either way.
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.
|
|
|
|
|
|
I seem to remember hearing about a website for programmers where there are problems posted for you to solve, and you can bid on being the one who gets to do it - a sort of contracting hiring site, I guess. A friend of mine is looking for "work I can do at home in my PJs on my own time because f*** working for a boss" - and this seems to me to be the sort of thing which would fit the bill. Anyone have any idea what the website might be? Cursory searches on Google seem to return a lot of information about who's willing to separate you from your money in order to teach you to program, but not a lot else.
Thanks.
|
|
|
|