Cleverness
-
I abhor reading code which is intentionally clever. Clever code which functions properly is garbage. If you're smart enough to write clever code which works, stop being a jerk and write smart code which works. Please. Clever code requires me to spend time figuring out how some pompous smart person thinks. Smart code allows me to just read it and move on. Agreed?
:josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.
-
I abhor reading code which is intentionally clever. Clever code which functions properly is garbage. If you're smart enough to write clever code which works, stop being a jerk and write smart code which works. Please. Clever code requires me to spend time figuring out how some pompous smart person thinks. Smart code allows me to just read it and move on. Agreed?
:josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.
Yeah, there was a time when I wrote 'clever' C++ code, but I got over myself.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
I abhor reading code which is intentionally clever. Clever code which functions properly is garbage. If you're smart enough to write clever code which works, stop being a jerk and write smart code which works. Please. Clever code requires me to spend time figuring out how some pompous smart person thinks. Smart code allows me to just read it and move on. Agreed?
:josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.
But that takes the fun out of it.
-
I abhor reading code which is intentionally clever. Clever code which functions properly is garbage. If you're smart enough to write clever code which works, stop being a jerk and write smart code which works. Please. Clever code requires me to spend time figuring out how some pompous smart person thinks. Smart code allows me to just read it and move on. Agreed?
:josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.
You mean, like somebody will take a slightly more difficult and lengthy path, just because they know how? Rather than doing it the obvious regular way which probably works better anyway? Or did i completely miss your point?
My current favourite word is: Waffle Cheese is still good though.
-
I abhor reading code which is intentionally clever. Clever code which functions properly is garbage. If you're smart enough to write clever code which works, stop being a jerk and write smart code which works. Please. Clever code requires me to spend time figuring out how some pompous smart person thinks. Smart code allows me to just read it and move on. Agreed?
:josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.
It reminds me of my younger days when I was proud to do such things. I have plenty of *clever* C++ template code roaming around. Now of course my opinion is different.
Co-Author ASP.NET AJAX in Action CP Quote of the Day: It is the same Friday that blooms as a new enriching day with novelty and innovation for us every week. - Vasudevan Deepak Kumar
-
I abhor reading code which is intentionally clever. Clever code which functions properly is garbage. If you're smart enough to write clever code which works, stop being a jerk and write smart code which works. Please. Clever code requires me to spend time figuring out how some pompous smart person thinks. Smart code allows me to just read it and move on. Agreed?
:josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.
Josh Smith wrote:
I abhor reading code which is intentionally clever. Clever code which functions properly is garbage. If you're smart enough to write clever code which works, stop being a jerk and write smart code which works. Please.
You mean like: foo.GetType().GetProperty("Bar").SetValue(foo, "fizbin", null); when foo.bar="fizbin" would have worked just fine? Marc
-
Josh Smith wrote:
I abhor reading code which is intentionally clever. Clever code which functions properly is garbage. If you're smart enough to write clever code which works, stop being a jerk and write smart code which works. Please.
You mean like: foo.GetType().GetProperty("Bar").SetValue(foo, "fizbin", null); when foo.bar="fizbin" would have worked just fine? Marc
-
You mean, like somebody will take a slightly more difficult and lengthy path, just because they know how? Rather than doing it the obvious regular way which probably works better anyway? Or did i completely miss your point?
My current favourite word is: Waffle Cheese is still good though.
He means if you can see a way to make 5 lines work in one line of code, a simple example is int n = myInts[index++]; that's not *terribly* clever, but as a rough off the top of my head example, incrementing the index in the next line of code makes clear that you want it to increment after the operation. I know that in my early days of STL I delighted in writing code that in hindsight was far more obscure than this, on the basis that I knew how. But, you quickly realise that readable counts for more than clever, it's part of being a team player instead of trying to show off, IMO.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
I abhor reading code which is intentionally clever. Clever code which functions properly is garbage. If you're smart enough to write clever code which works, stop being a jerk and write smart code which works. Please. Clever code requires me to spend time figuring out how some pompous smart person thinks. Smart code allows me to just read it and move on. Agreed?
:josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.
Back in the old days of game programming you had to do all kinds of clever little tricks to speed up your game. Bit shifting instead of multiplication for instance. For the 386/486 and many others the bit shifting operation was quicker than multiplication, but you can only do that in certain scenarios.
46 75 63 6B 20 79 6F 75 20 4B 79 6C 65 20 45 64 77 61 72 64 73 20 66 72 6F 6D 20 41 72 6B 61 6E 73 61 73 21 20 46 75 63 6B 20 79 6F 75 20 74 6F 20 68 65 6C 6C This is a coded message, if you decode it and you are offended, it is your own f****ing fault.
-
I abhor reading code which is intentionally clever. Clever code which functions properly is garbage. If you're smart enough to write clever code which works, stop being a jerk and write smart code which works. Please. Clever code requires me to spend time figuring out how some pompous smart person thinks. Smart code allows me to just read it and move on. Agreed?
:josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.
Better to think cleverly and write it smart. The same thing about smart and clever is that both of them works. Only difference is that the smart developer considered things way beyond the code (readability, maintenance, reusability), while the clever developer only dwells on the solution for the current problem and does not think much about after coding the application.
-
I abhor reading code which is intentionally clever. Clever code which functions properly is garbage. If you're smart enough to write clever code which works, stop being a jerk and write smart code which works. Please. Clever code requires me to spend time figuring out how some pompous smart person thinks. Smart code allows me to just read it and move on. Agreed?
:josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.
Sometimes "clever" code doesn't impress me one bit.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
-
Yeah, there was a time when I wrote 'clever' C++ code, but I got over myself.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Although I love your articles on image processing.
Me: Can you see the "up" arrow? User:Errr...ummm....no. Me: Can you see an arrow that points upwards? User: Oh yes, I see it now! -Excerpt from a support call taken by me, 08/31/2007
-
But that takes the fun out of it.
Especially when debugging :->
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
-
Back in the old days of game programming you had to do all kinds of clever little tricks to speed up your game. Bit shifting instead of multiplication for instance. For the 386/486 and many others the bit shifting operation was quicker than multiplication, but you can only do that in certain scenarios.
46 75 63 6B 20 79 6F 75 20 4B 79 6C 65 20 45 64 77 61 72 64 73 20 66 72 6F 6D 20 41 72 6B 61 6E 73 61 73 21 20 46 75 63 6B 20 79 6F 75 20 74 6F 20 68 65 6C 6C This is a coded message, if you decode it and you are offended, it is your own f****ing fault.
CataclysmicQuantums wrote:
Bit shifting instead of multiplication for instance
I remember those tricks, and they still work well from time to time. ---modified Though it is tough to beat an optimizing compiler these days.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
-
Yeah, there was a time when I wrote 'clever' C++ code, but I got over myself.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Sometimes "clever" code doesn't impress me one bit.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
There's cleverness for the sake of cleverness, and there's cleverness that creates an elegant solution to a difficult problem...
------------------------------------------- Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Just bugger off and leave me alone!!
-
There's cleverness for the sake of cleverness, and there's cleverness that creates an elegant solution to a difficult problem...
------------------------------------------- Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Just bugger off and leave me alone!!
_Damian S_ wrote:
there's cleverness that creates an elegant solution to a difficult problem...
True. I just think of the cleverness for the sake of being a hot-shot smarty-pants.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
-
I abhor reading code which is intentionally clever. Clever code which functions properly is garbage. If you're smart enough to write clever code which works, stop being a jerk and write smart code which works. Please. Clever code requires me to spend time figuring out how some pompous smart person thinks. Smart code allows me to just read it and move on. Agreed?
:josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.
I was never clever enough to write clever code. Unless you mean doing things like bit shifts because at times they were faster than basic arithmetic on some platforms. Now days the c/c++ compilers are pretty good so I haven't found the need to do it too often.
My Blog A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects. - -Lazarus Long
-
_Damian S_ wrote:
there's cleverness that creates an elegant solution to a difficult problem...
True. I just think of the cleverness for the sake of being a hot-shot smarty-pants.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
Absolutely... I was agreeing with you on that one!!
------------------------------------------- Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Just bugger off and leave me alone!!
-
I abhor reading code which is intentionally clever. Clever code which functions properly is garbage. If you're smart enough to write clever code which works, stop being a jerk and write smart code which works. Please. Clever code requires me to spend time figuring out how some pompous smart person thinks. Smart code allows me to just read it and move on. Agreed?
:josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.
Josh Smith wrote:
Clever code requires me to spend time figuring out how some pompous smart person thinks. Smart code allows me to just read it and move on.
Well, I will agree mostly. I still have to hesitantly present a situation, that someone else brought up. Sometimes the non-clever way is too cpu-intensive. I have been accused of writing "clever" code, even though all I did was bring game programming techniques to sci-vis and engineering. I didn't invent anything, I sped it up by an exponent or more. Quaternions were once considered clever because it was a mathematical concept that was difficult to imagine (try imagining a 4 dimensional unit vector). But today it is normal to use for solving problems. And now people are coming to me because they somehow just discovered quaternions. :laugh: But cleverness for the sake of showing off, that programmer is no different than a pilot hotdogging. He needs to grow up. :-D
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)