Microcontrollers > Data Logging

Datalogger update

<< < (2/7) > >>

Bruce S:
SparWeb & Damon
Do y'all ever cull the commented out code? Not the stuff put in there for specific reason, say"descriptors" but old code that is commented out once a quicker or more eloquent coding? AND if so do you notice the code using less space and therefore less power to the Arduino?

I can follow OperHouse's stuff easy enough

I'm more of a firmware person  8).

Thanks
Bruce  S

SparWeb:
Yes, I "clean house" but only after the extra stuff has been in the closet for a while.  This edit shed about 100 lines; a fairly big purge, but I also added several dozen lines to make the energy calculation work.

Comments can burden the compiled code?  Most compilers should just ignore it, right?  Anyway, every time I compile for an upload to the AtMega, it tells me that it's only using 9% of program space.  While this program is a biggie for me, at 600 lines, it's peanuts to the capacity of an Atmel Mega 2560 ARM.

SparWeb:
The hardware side.
All the short green "X" wires are a result of my drastic simplification of the datalogger.

DamonHD:
If code is truely redundant (eg not debugging statements that I may want to use once in a while) and unlikely to be used again then I kill it, to make the rest easier to read and navigate.  When maintaining 10s or 100s of thousands of lines, removing the truely dead stuff helps the compiler in my head even if it makes essentially no difference to the the target.  (Compilers can skip comments VERY fast.)

I often find myself in suitations where I am bumping along the top of available space, and to add a new feature I have to delete an old one and its resources, eg when I shoehorned several servers' worth of stuff into a single Raspberry Pi.  And so yes, in that case I really can see the benefit of culling the old stuff.

Rgds

Damon

Mary B:
I wrote a rudimentary word processor back in 1979(senior in high school), ran to around 20k lines of basic... LOTS of comment lines so others could follow it and the teacher semi had a clue(well he was clueless but he could read comments as to what the code did... he didn't understand it) what each bit did... That program was then used by the U of MN(I used their mainframe on a dial up connection) to actually create a word processor, one of their graduate students grabbed it and I got partial credit on it for the original code and idea. The grad student asked what the heck all the comments were for and when I told him he laughed for 10 minutes. We ended up deleting 90% of them over the summer(I got paid!) and I walked him through my thinking. It also counted towards my first degree in programming.

Comments are great to understand WHY a section of code is doing something. I still use them so I don't come back later and ask myself why in the heck did I write this section this way???

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version