EmbeddedRelated.com
Forums
The 2026 Embedded Online Conference

Don't you hate it when...

Started by Tim Wescott July 26, 2015
I'm working on a Sunday, so I can vent, right?

Don't you hate it when you're looking at your OWN CODE and going "WTF?!?  
This shouldn't even compile!!!"  I mean, if it were someone else's code 
that would be expected, because if you're not me then you're clearly an 
idiot.

Sorry.  Couldn't resist.  I'm back to puzzling over my own strange code.

-- 

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
On 2015-07-26, Tim Wescott <seemywebsite@myfooter.really> wrote:
> I'm working on a Sunday, so I can vent, right? > > Don't you hate it when you're looking at your OWN CODE and going "WTF?!? > This shouldn't even compile!!!" I mean, if it were someone else's code > that would be expected, because if you're not me then you're clearly an > idiot. > > Sorry. Couldn't resist. I'm back to puzzling over my own strange code. >
Been there, done that. My code is also more heavily commented and has less "clever" constructs than it did when I was in my 20s. I'll let you decide if there's a connection between the two. :-) There's also the additional perspective that maturity brings to the design and code writing process to consider. Simon. -- Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP Microsoft: Bringing you 1980s technology to a 21st century world
Hi Simon,

On 7/26/2015 4:50 PM, Simon Clubley wrote:
> On 2015-07-26, Tim Wescott <seemywebsite@myfooter.really> wrote: >> I'm working on a Sunday, so I can vent, right? >> >> Don't you hate it when you're looking at your OWN CODE and going "WTF?!? >> This shouldn't even compile!!!" I mean, if it were someone else's code >> that would be expected, because if you're not me then you're clearly an >> idiot. >> >> Sorry. Couldn't resist. I'm back to puzzling over my own strange code. > > Been there, done that. My code is also more heavily commented and has > less "clever" constructs than it did when I was in my 20s.
Yup. I've learned to spend more keystrokes saying what I want to say (unfortunately, its geared towards *me* as the audience -- not "others") than mistakenly trying to "optimize source code". I also am haunted by a mantra from an early compiler design class: "programs" should fit on one page. I am amazed at how often this advice proves helpful!
> I'll let you decide if there's a connection between the two. :-) > > There's also the additional perspective that maturity brings to the > design and code writing process to consider.
OTOH, there is the "rotting" of the meatware to consider. I've learned that "in line"/"in code" documentation is not enough to refresh my memory of what a piece of code is *supposed* to do, its liabilities/limitations, etc. I.e., *why* did I choose this particular data representation (over lots of equivalent ones!) or this particular algorithm... why did I order the tests in this sequence... etc. So, I write little "tutorials" that let me explain (to myself and anyone who happens to read over my shoulder) the thought *process*... instead of just the *results*. [Then again, this problem is probably exacerbated by the long timespans involved in many of my designs...]
On Sunday, July 26, 2015 at 8:26:06 PM UTC-4, Don Y wrote:
> ... I've learned to spend more keystrokes ...
We've noticed ;-) Sorry, I couldn't help myself...
On 7/26/2015 5:34 PM, Dave Nadler wrote:
> On Sunday, July 26, 2015 at 8:26:06 PM UTC-4, Don Y wrote: >> ... I've learned to spend more keystrokes ... > > We've noticed ;-) > Sorry, I couldn't help myself...
And folks complain that I'm *still* not clear!! :-/
Tim Wescott wrote:

> I'm working on a Sunday, so I can vent, right? > > Don't you hate it when you're looking at your OWN CODE and going "WTF?!? > This shouldn't even compile!!!" I mean, if it were someone else's code > that would be expected, because if you're not me then you're clearly an > idiot. > > Sorry. Couldn't resist. I'm back to puzzling over my own strange code.
No problem, it was a former you that was the idiot. Now you have evolved further, hopefully to the better. :-) -- Reinhardt
On 7/26/2015 7:19 PM, Tim Wescott wrote:
> I'm working on a Sunday, so I can vent, right? > > Don't you hate it when you're looking at your OWN CODE and going "WTF?!? > This shouldn't even compile!!!" I mean, if it were someone else's code > that would be expected, because if you're not me then you're clearly an > idiot. > > Sorry. Couldn't resist. I'm back to puzzling over my own strange code.
When I started writing code for my own company I learned that it pays to treat code like any other document you write. Write it, read it to see that it makes sense. Then read it again after a few days or even weeks. If it is hard to follow when not fresh in your mind, how hard will it be to read when someone else tries? Even if you can't take the time to pretty up the code, you can at least add some comments to help understand it. Sometimes I wonder if that is why some people do well with Forth. They take the time to critique their own code and rewrite it if needed. I see that mentioned a lot in comp.lang.forth. -- Rick
On 7/26/2015 6:42 AM, Clifford Heath wrote:
> On 27/07/15 10:35, Don Y wrote: >> On 7/26/2015 5:34 PM, Dave Nadler wrote: >>> On Sunday, July 26, 2015 at 8:26:06 PM UTC-4, Don Y wrote: >>>> ... I've learned to spend more keystrokes ... >>> >>> We've noticed ;-) >>> Sorry, I couldn't help myself... >> >> And folks complain that I'm *still* not clear!! :-/ > > Too many words create obfuscation just as effectively as too few. > > I would read your posts diligently if you edited out 3/4 of the text.
I've tried that. What the posts get met with is requests for *specifics*: - What are you trying to do? - Why do you want to do that? etc. So, I try to guide folks through my reasons for asking *before* they pepper me with questions that aren't important. A colleague suggests many folks are incapable of abstract thought; needing specifics to formulate an answer. [Here's a great question: is suicide justified?] Another claims that people are just lazy thinkers; needing a fill-in-the-blank question before they can propose an answer. <shrug>
On 7/26/2015 11:18 PM, Don Y wrote:
> On 7/26/2015 6:42 AM, Clifford Heath wrote: >> On 27/07/15 10:35, Don Y wrote: >>> On 7/26/2015 5:34 PM, Dave Nadler wrote: >>>> On Sunday, July 26, 2015 at 8:26:06 PM UTC-4, Don Y wrote: >>>>> ... I've learned to spend more keystrokes ... >>>> >>>> We've noticed ;-) >>>> Sorry, I couldn't help myself... >>> >>> And folks complain that I'm *still* not clear!! :-/ >> >> Too many words create obfuscation just as effectively as too few. >> >> I would read your posts diligently if you edited out 3/4 of the text. > > I've tried that. What the posts get met with is requests for > *specifics*: > - What are you trying to do? > - Why do you want to do that? > etc. > > So, I try to guide folks through my reasons for asking *before* > they pepper me with questions that aren't important. > > A colleague suggests many folks are incapable of abstract thought; > needing specifics to formulate an answer. > > [Here's a great question: is suicide justified?] > > Another claims that people are just lazy thinkers; needing a > fill-in-the-blank question before they can propose an answer. > > <shrug> >
On 7/26/2015 11:18 PM, Don Y wrote:
> On 7/26/2015 6:42 AM, Clifford Heath wrote: >> On 27/07/15 10:35, Don Y wrote: >>> On 7/26/2015 5:34 PM, Dave Nadler wrote: >>>> On Sunday, July 26, 2015 at 8:26:06 PM UTC-4, Don Y wrote: >>>>> ... I've learned to spend more keystrokes ... >>>> >>>> We've noticed ;-) >>>> Sorry, I couldn't help myself... >>> >>> And folks complain that I'm *still* not clear!! :-/ >> >> Too many words create obfuscation just as effectively as too few. >> >> I would read your posts diligently if you edited out 3/4 of the text. > > I've tried that. What the posts get met with is requests for > *specifics*: > - What are you trying to do? > - Why do you want to do that? > etc. > > So, I try to guide folks through my reasons for asking *before* > they pepper me with questions that aren't important. > > A colleague suggests many folks are incapable of abstract thought; > needing specifics to formulate an answer. > > [Here's a great question: is suicide justified?] > > Another claims that people are just lazy thinkers; needing a > fill-in-the-blank question before they can propose an answer.
The problem is not that you don't use enough detail or that you give too much detail, but that you use so many words to fill in all sorts of unimportant detail and even nuance that is just overkill. You don't have to give every aspect of your thinking. Just explain the purpose of the things you are requiring... without overkill. If you hear from so many people that you use too many words, do you really think they are all wrong? Try changing your viewpoint and maybe you will see it their way. -- Rick -- Rick
On 7/26/15 11:46 PM, rickman wrote:
> On 7/26/2015 11:18 PM, Don Y wrote: >> On 7/26/2015 6:42 AM, Clifford Heath wrote: >>> On 27/07/15 10:35, Don Y wrote: >>>> And folks complain that I'm *still* not clear!! :-/ >>> >>> Too many words create obfuscation just as effectively as too few. >>> >>> I would read your posts diligently if you edited out 3/4 of the text. >> >> I've tried that. What the posts get met with is requests for >> *specifics*: >> - What are you trying to do? >> - Why do you want to do that? >> etc. >> >> So, I try to guide folks through my reasons for asking *before* >> they pepper me with questions that aren't important. >> >> A colleague suggests many folks are incapable of abstract thought; >> needing specifics to formulate an answer. >> >> [Here's a great question: is suicide justified?] >> >> Another claims that people are just lazy thinkers; needing a >> fill-in-the-blank question before they can propose an answer. > > The problem is not that you don't use enough detail or that you give too > much detail, but that you use so many words to fill in all sorts of > unimportant detail and even nuance that is just overkill. You don't > have to give every aspect of your thinking. Just explain the purpose of > the things you are requiring... without overkill. > > If you hear from so many people that you use too many words, do you > really think they are all wrong? Try changing your viewpoint and maybe > you will see it their way. >
It takes effort to write a good concise message. (I believe it was Mark Twain that once wrote something like, "I don't have time to write you a short letter, so I am writing you a long one"). The issue often isn't length per-se, but that there are lots of details that don't really matter, but there may still be important points not clearly stated (or lost in the vast sea of irrelevance). Often, spending the effort to write a clearer question will help lead to the answer of the question, as it make you think more carefully about it.
The 2026 Embedded Online Conference