|
Marc Clifton wrote: that was one C# method
There's your problem right there. A method like that should be broken up into several (hundred) smaller methods...
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- Never argue with a fool. Onlookers may not be able to tell the difference. Mark Twain
|
|
|
|
|
Marc Clifton wrote: flowchart Now that's olde schoole!
Software Zen: delete this;
|
|
|
|
|
This is the joy of embedded code -> realtime does not (always) allow to use the debugger, since the debugger actually stops the program, so your embedded systems also stops, which ruins the dynamics. So we are often down to the equivalent of TRACEing, so that we do not interrupt the realtime events and interrupts.
Printing code ... No
|
|
|
|
|
|
Ah the good old days, pages of core dump and assembler code.
They call me different but the truth is they're all the same!
JaxCoder.com
|
|
|
|
|
Gary Wheeler wrote:
This is where it got really old school: I actually printed four pages of code to look at, all at once, on my desk. I do this often, taping the sheets together so it resembles continuous form. I then can mark it up with red pen, highlighter, etc.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I've done that occasionally, folding the edges to remove the header that Visual Studio adds.
I'm sure half the folks reading this are thinking "if the code is longer than a page, then you should refactor". Maybe so, but divvying a long procedure into
void Process_Step1()
{
}
void Process_Step2()
{
}
void Process_StepN()
{
} can be counter-productive at times.
Software Zen: delete this;
|
|
|
|
|
Hi All,
Friday afternoon not many people in the orfice today 'Working From Home' which I can't as I am using hardware that is too big. Silly thing is we have a 'smart' lighting system, you flick the switch, it take a gander at the light level, the lights then switch on & if it does not pick up some sort of movement every ten minutes turns the lights off. A pain if like me you are working on something where you have too be still!
|
|
|
|
|
Solution[^]
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Tried it, that very one. Not enough movement...
|
|
|
|
|
Solution 2[^]
I know: Too much movement.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Cat & Laser pointer....Hmmm
|
|
|
|
|
Obligatory Dilbert: It's not a new problem[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Dilbert solves the issue again!
|
|
|
|
|
We have a lab with lighting like that, but the lighting is anything but smart. This lab contains a printing press with lots of motion, flashing lights, and so on. You'd think it would keep the lights on. Nope. If you're in the lab, you have to remember to move every few minutes or the lights shut off.
Cue Stephen King's short story The Mangler[^].
Software Zen: delete this;
|
|
|
|
|
|
Ahhh The Family Guy option, might suggest that.
|
|
|
|
|
At least you weren't in the bathroom when the timer expired. Just sayin...
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Thank those lighrs aren't!
|
|
|
|
|
RPC/COM days had this word busy. I heard a mate discussing something as a stub, was just wondering what in today's tech could mean a stub.
|
|
|
|
|
I've stubbed routines but it's not common in my code these days. People just aren't into global interfaces that much anymore.
Most common stub of mine is System.Collections.IEnumerator.Reset() in .NET and even then that's not that common (although C# generates these stubs when you declare iterator methods)
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
The only time I use "stub" is to describe a dummy function that is generally used for simplifying development. So if you are writing a client and that client calls a service which does many things, or takes time, or needs annoying conditions to be true, you can write a stub that has the same method signature but simply returns a hard-coded result. That lets you continue testing the client without needing a working service.
|
|
|
|
|
As I understood the concept, it's to leave a deliberate opening for a future addition (to the code).
Planning for likely expansion. Sort of plan-ahead feature creep - a space is already reserved.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
I stub methods all the time, usually because I fully intend to implement them. My stubbed methods usually throw a NotImplemented exception. If I end up with any of these stubbed methods after the code is finished, I simply delete them (they're easy to find with a simple Find in Files search.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
In the last month and a hlaf I saw extensive usage of stubs in the following scenarios:
* Interfaces towards modules which are called by those modules but not yet implemented by us;
* The actual code of IPC Interfaces (Legato/dBus...) when the implementation is to be done but clients (or servers) are developed concurrently;
* Most of the autogenerated code by AutoSAR tools contains stubs to be implemented by the actual ECU software developers.
GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|