Code of Contention: To what intelligence level do you code to?
Tuesday, March 17, 2009 9:19 PM
Do you code to the "lowest common denominator" on your team or do you code to another standard? Read on for something to make you go hhhhmmmmm....
I read today with great interest about 10 C# Shorthands that improve productivity (by Martijn Dijksterhuis). The article MUST be good cause it also caught SBs eye so much he ping'd it to me this afternoon! Great minds think alike?! :> LOL Ya, I was laughing when I typed that out too! :> LOL
But back to serious work! This article (very good ideas by the way) sparked a question in my head! Ya SG, it did hurt! :>
The FIRST thing Martijn talks about is using the '?' ternary operator. I was at one place of work, where (and this is true, no joke) my boss actually told me numerous times (about once every two months) that I shouldn't be using the conditional operator cause it's "too complicated for co-op or new grads to understand." "Maintenance is the most important thing and when you leave, I'm left maintaning all this code." That always urked me when he told me that, but I didn't really have any rebuttal to his argument cause well, maintenance IS always important. However, my head always did a bit of twitch when I heard that from him though.
Martijn's point made me think.....to what level of developer do YOU code for? Do you code for the lowest common denominator? Or do you challenge your peers to use the tools/language constructs available to them? What I mean is simple,
- Do you use Generics or stick with simple arrays?
- Do you use delegates and events or just avoid them whenever possible?
- Do you overload methods where appropriate?
- Do you use C#/VB.NET attributes?
- Do you Do you use automatic fields where appropriate and type them out longhand because you have (serializing comes to mind)?
- Do you switch statements, if statements or even ternary operators?
- Do you use abstract classes and interfaces appropriately?
I'm not asking to what level or degree you use proper OOP methodologies, just whether you do or not. The basic premise of this question is, do you coddle your development for some noob who might work for you sometime in the future? Or you trust your employees to embrace the challenge of learning cool new things?
PS The second point on Martijn's list is the null-coalesce operator (double question marks), hhhmmm if one '?' is difficult I doubt the "??" will never get any use.