|
I beg to differ, please read my post:
"It's awesome when you figure its power"
"To alcohol! The cause of, and solution to, all of life's problems" - Homer Simpson
|
|
|
|
|
Agreed, and attributes may not even be needed for XML serialisation.
|
|
|
|
|
With the amount of participants this poll can give some nice pointers on what and how technology is used.
Now, what decisive role do Attributes have to deserve this poll?
At the end of this week, what can we take from whatever result this may end up with?
I can foresee a "None!" response here
Sorry guys, I like to contribute but this one felt too useless.
|
|
|
|
|
...just thought I'd raise subject before Nagy!
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Damned you and your sheep fetish!
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
Jealous?
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Nope. I still have half a gallon of gin, so I should be able to manage until 5pm
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
Griff !
The poll next month should be:
Codeproject buzz words and phrases you have used for obtaining an automatic 5:
[ ] Bacon
[ ] Liquid Nitrogen
[ ] CListCtrl
[ ] Why ProductX sucks today
[ ] Other
Best Wishes,
-David Delaune
|
|
|
|
|
[] Hamsters
[] Mankini
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Actually I started creating some Attributes[^] this weekend. Was not really familiar with them, except that I knew how to use them.
Creating them is actually pretty fun and gives some insight into how .NET does stuff under the covers.
If you're a .NET developer and not yet familiar with Attributes I can really recommend creating and reading over your custom Attributes[^]. Just for fun and knowledge
It's an OO world.
public class Naerling : Lazy<Person>{}
|
|
|
|
|
Just don't get carried away and use them too much. Reflection is not among the fastest things. The good old assembly and C++ days have made me a scrooge what memory and CPU are concerned
And from the clouds a mighty voice spoke: "Smile and be happy, for it could come worse!"
And I smiled and was happy And it came worse.
|
|
|
|
|
The environment in which I use it can easily take a few milliseconds longer to do stuff. It's good knowing when not to use certain things and I am sure Reflection and Attributes are two of them. But I also like to know why not to use them. And how would you know better than by knowing how it works?
It's an OO world.
public class Naerling : Lazy<Person>{}
|
|
|
|
|
To begin with, I don't like the cargo cult programming and mindlessly following rules without even knowing why. Things which are harmful for one purpose may be useful for another. That's why I break every rule in the book when it helps me. The problem is, that teaching this is much harder than simply preaching rules. The last thing I would tell you is not to try to understand what is going on.
And from the clouds a mighty voice spoke: "Smile and be happy, for it could come worse!"
And I smiled and was happy And it came worse.
|
|
|
|
|
Well, I know someone who is just like that. And he's forcing his ways upon others... If he reads in a book somewhere "don't use attributes" he wouldn't dare touch them if his life depended on it. If he reads "attributes can be really handy" he'd look for at least one attribute he could use on his Classes, Properties etc. as much as possible.
To make things worse, he doesn't want to know about stuff he thinks he'll never need.
I certainly don't want to be like that. So if it takes me to apply 100 attributes in a single Class to find out it's not all that great, then so be it
Of course some books and lots of CP articles can sometimes prevent me from reinventing the wheel
It's an OO world.
public class Naerling : Lazy<Person>{}
|
|
|
|
|
... but overusing them may make your code hard to understand and somewhat slow, due to having to use reflection to read them. Then again, in web applications this little extra effort is unnoticable as you spend more time waiting for a response from the database and I would not use managed code for anything that must be super fast anyway.
And there are also my friends, the Java cultists, who think their annotations (essentially the same as attributes) are the best thing since white chocolate. I just love to rub it under their noses that the 'imitation' already has had attributes from the beginning and uses them far more consequentely. What do you mean, you can't 'annotate' classes for serialisation? But what do you expect when the 'imitation' also is a bit ahead what constructors, disposing and finalisation or properties are concerned?
And from the clouds a mighty voice spoke: "Smile and be happy, for it could come worse!"
And I smiled and was happy And it came worse.
|
|
|
|