C#/ / .NET Observation
-
James R. Twine wrote:
I am not sure if it is the child with a hammer syndrome or not... What do you think?
My concern is more to do with the standard of developer let loose on the language. We keep seeing posts stating "How do I pass value from form 1 to form 2" and it's obvious that the developers aren't even bothering to think. Just because you can do something quickly in .NET it doesn't mean that you can ignore the basics of design. There's nothing inherently wrong with using a hashtable or a dictionary of some type, but there is something wrong with using it where a simple array would suffice.
Deja View - the feeling that you've seen this post before.
Sadly yes. This is the root of all evil; trying to tackle a problem without understanding what's needed first. Proper design comes after proper understanding and that comes from using your brain. These days, that's becoming as rare as hen's teeth.
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed. Lotus Notes is a conspiracy by the forces of Satan to drive us over the brink into madness. The CRC-32 for each file in the installation includes the numbers 666." Gary Wheeler "The secret to a long and healthy life is simple. Don't get ill and don't die." Pete O'Hanlon, courtesy of Rama Krishna Vavilala
-
Given that I do C++,not C#...when I use STL, I am pretty aware of the big-O characteristics of the different containers - they're specified in the standard, for crying out loud! C#...dunno - what are the big-O characteristics? I'd presume they are similar to the STL containers...but I really don't know. Also - C#..is it VB6 for the 00's? Not entirely, I'm sure, but I think the VB6 programmers have moved to C# :-)
Stuart Dootson wrote:
I think the VB6 programmers have moved to C#
No, they either learned what OO is and moved to VB.NET or they got promoted into a position where they say, "back in the old days."
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed. Lotus Notes is a conspiracy by the forces of Satan to drive us over the brink into madness. The CRC-32 for each file in the installation includes the numbers 666." Gary Wheeler "The secret to a long and healthy life is simple. Don't get ill and don't die." Pete O'Hanlon, courtesy of Rama Krishna Vavilala
-
As I now need to start getting into C# after a very happy and fruitful live with C++, I have noticed something and wanted to know if any other pre-C#/.NET developers have noticed the same thing. I have seen LOTS of uses of the
Hashtable
type - far more than I would expect. And in places where I would not normally expect. For example, I have seen keys like "1
", "2
", "3
", etc. (i.e. simple indexers), or seen them used for collections of less than 5 items or so. It just seems a bit weird to me - I mean,std::map
andstd::multimap
have been around for a number of years, and I have seen plenty of complex systems that rarely used them. But now I see the simplest systems _(ab)_useHashtable
. Is it just me, or does anyone else notice that as well? I am not sure if it is the child with a hammer syndrome or not... What do you think? Peace!-=- James
Please rate this message - let me know if I helped or not! * * *
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
See DeleteFXPFilesNow that we have LINQ, I can see the List<> types getting some heavy abuse. Too easy with LINQ to sort, group, calcuate, etc all from a simple List<>. Of course, LINQ works with other objects, but I got a felling some developers will think list about the needs of an app and head straight for simple, quick to implement solutions.
Rocky <>< Blog Post: Handy utility app that is always on my machines! Tech Blog Post: Moving on up with Windows Live stuff and Plus!
-
Sadly yes. This is the root of all evil; trying to tackle a problem without understanding what's needed first. Proper design comes after proper understanding and that comes from using your brain. These days, that's becoming as rare as hen's teeth.
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed. Lotus Notes is a conspiracy by the forces of Satan to drive us over the brink into madness. The CRC-32 for each file in the installation includes the numbers 666." Gary Wheeler "The secret to a long and healthy life is simple. Don't get ill and don't die." Pete O'Hanlon, courtesy of Rama Krishna Vavilala
Mustafa Ismail Mustafa wrote:
as rare as hen's teeth.
actually I think Hen's teeth are far more common.
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
Now that we have LINQ, I can see the List<> types getting some heavy abuse. Too easy with LINQ to sort, group, calcuate, etc all from a simple List<>. Of course, LINQ works with other objects, but I got a felling some developers will think list about the needs of an app and head straight for simple, quick to implement solutions.
Rocky <>< Blog Post: Handy utility app that is always on my machines! Tech Blog Post: Moving on up with Windows Live stuff and Plus!
I completely agree with everyone on this, but someone has put it very simply back in the day (forget who it was). "Professional programming isn't for the masses, MS is going against that. Same goes for similar Wrox titles." I disagree just a tad, because obviously .NET has pushed out the envelope and produced some good stuff, but it is producing big-heads far faster. In my mind, to consider oneself as a master of abstraction is very hard for me, and I wonder who would when they look at the number of times they refactor their code (if they can afford it), or say when they look Boost and go WTF (that is the leadership there, if you care about types. Sure it has its quirks in few areas , but if anything it demonstrates what kind of true abstract heads we are up against; Hibernate and Castle people, please stay clear as it is beyond ORM-loving childplay)
-
I completely agree with everyone on this, but someone has put it very simply back in the day (forget who it was). "Professional programming isn't for the masses, MS is going against that. Same goes for similar Wrox titles." I disagree just a tad, because obviously .NET has pushed out the envelope and produced some good stuff, but it is producing big-heads far faster. In my mind, to consider oneself as a master of abstraction is very hard for me, and I wonder who would when they look at the number of times they refactor their code (if they can afford it), or say when they look Boost and go WTF (that is the leadership there, if you care about types. Sure it has its quirks in few areas , but if anything it demonstrates what kind of true abstract heads we are up against; Hibernate and Castle people, please stay clear as it is beyond ORM-loving childplay)
User of Users Group wrote:
"Professional programming isn't for the masses, MS is going against that. Same goes for similar Wrox titles." I disagree just a tad, because obviously .NET has pushed out the envelope and produced some good stuff, but it is producing big-heads far faster.
I'm not sure it's quite that - what I think is true is that there is more of a take up by people who are inherently unsuited to developing. Good developers have a breadth of knowledge and an interest in expanding their knowledge in many different areas, by learning other languages or by trying different architectures/techniques. Then there are the others - the people who I would term The Google Cut and Paste Monkeys. They want answers spoon fed to them, and they look for the next quick coding hit/new technology without bothering to look into them at all. I blame MS for their statement in the early 90s that they wanted to create systems that would remove the need for developers.
Deja View - the feeling that you've seen this post before.
-
User of Users Group wrote:
"Professional programming isn't for the masses, MS is going against that. Same goes for similar Wrox titles." I disagree just a tad, because obviously .NET has pushed out the envelope and produced some good stuff, but it is producing big-heads far faster.
I'm not sure it's quite that - what I think is true is that there is more of a take up by people who are inherently unsuited to developing. Good developers have a breadth of knowledge and an interest in expanding their knowledge in many different areas, by learning other languages or by trying different architectures/techniques. Then there are the others - the people who I would term The Google Cut and Paste Monkeys. They want answers spoon fed to them, and they look for the next quick coding hit/new technology without bothering to look into them at all. I blame MS for their statement in the early 90s that they wanted to create systems that would remove the need for developers.
Deja View - the feeling that you've seen this post before.
> that would remove the need for developers. Rings some bells, and btw this is what I believe DB is talking about in his recent blog entry on 'overfactoring forewords', you know generics and that. After all, WCF is one of the pieces you see that is clearly showing less development effort and more configuration expertise( hey hate the word but that is what it is: IT!). WPF aims to take it into media and design space too. But I am supripsed at how repetative/similar it is to past tech, and especially as WS falters. So while it does look like a step forward in terms of factoring, at least in that ahm *research* attempt (bold to say but I don't think WinFX will really rock the world), apart from some awful looking code when dealing with communication endpoints. Hey if it produces a good idea where you pay slightly less in XML and runtime penalties down the road I am all up for it, but that is what is lacking out there.. implementation of environments that do not introduce any runtime penalty whatsoever. And that, ties into the topic, which is compiler work I believe (to 'ease'/force-to-think and warn very early; best of both worlds etc).. Pretty tough subject for me at the very least.
-
protected KeyedList<ViewListenerKey, List<SessionContainerListener>> viewListeners;
protected KeyedList<ViewListenerKey, ViewKeyData> viewKeyData;
protected KeyedList<SessionContainerViewListenerKey, List<DataTable>> sessionTransactions;Run. Don't walk, run. :-D Marc
If often using nested generics. Though recently I found this:
IEnumerable<KeyValuePair<LineSegment, List<TextWord>>>
I think 3 levels might be a bit too much... -
I have never knowingly used a hashtable in C#, and I stayed as far away as possible from STL when I was doing C++.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001John Simmons / outlaw programmer wrote:
and I stayed as far away as possible from STL when I was doing C++.
Same here, I never got used to STL...
- Anders
-
If often using nested generics. Though recently I found this:
IEnumerable<KeyValuePair<LineSegment, List<TextWord>>>
I think 3 levels might be a bit too much...Daniel Grunwald wrote:
I think 3 levels might be a bit too much...
Yeah, I'm not even happy with the code snippet I posted. When I was working in C++, I made it a steadfast rule to always wrap a nested collection in a class, becaue you never knew when something would go from "simple type" to "complex type" in the requirements. So, in your above code snippet, I would probably do something like may List into a TextWordList class, and the repeat the process until the collection made sense. Marc
-
Nemanja Trifunovic wrote:
but creating the complete UI out of some crazy XML files with reflection was simply wrong - it made the application less robust and it would take forever to start.
:~ :-D Marc
-
As I now need to start getting into C# after a very happy and fruitful live with C++, I have noticed something and wanted to know if any other pre-C#/.NET developers have noticed the same thing. I have seen LOTS of uses of the
Hashtable
type - far more than I would expect. And in places where I would not normally expect. For example, I have seen keys like "1
", "2
", "3
", etc. (i.e. simple indexers), or seen them used for collections of less than 5 items or so. It just seems a bit weird to me - I mean,std::map
andstd::multimap
have been around for a number of years, and I have seen plenty of complex systems that rarely used them. But now I see the simplest systems _(ab)_useHashtable
. Is it just me, or does anyone else notice that as well? I am not sure if it is the child with a hammer syndrome or not... What do you think? Peace!-=- James
Please rate this message - let me know if I helped or not! * * *
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
See DeleteFXPFilesJames R. Twine wrote:
I am not sure if it is the child with a hammer syndrome or not
Nah, teenager with his first girlfriend syndrome. Wants to spend a lot of time with it, shower it with attention, discover its properties, put things in it. I never did much with C++, just dabbled; I did mostly C. Switching to C# and .net was like the first day of high school in Malibu (I'm guessing). "I know little of these 60s sitcoms of which you speak." -- Slartibartfast
-
A lot of developers learn by copy-and-paste and have not been exposed to the other collection options in .NET. Personally, my predominate collection type is the generic List<>. In the .NET environment the efficiency is close so many choose the hash incorrectly thinking it does not matter. I have many discussions with Junior developers about the importance of order in certain sets. Most of which falls on deaf ears until something blows up in there face.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest HemingwayList rocks! I'm just sorry it doesn't expose it's methods as virtual. I have so many situations where I need to attach descriptive data to a list, and using composition is a PITA. I have to guess which List methods to redirect up front, such as Add, and Remove, and an iterator. Then, later on in code, I find I need more IList features, such as Contains etc. I also don't like exposing the contained List, as it's cumbersome to always first reference the List property.