Hi,
On Thu, 11 Sep 2008, John Carter wrote:


No. I explicitly don't miss computed gotos. I loathed gotos and in
particular hated computed gotos. I hated common blocks. Maintenance
and bug nightmares the lot of them.

Gotos - they are still here.
A case statement is one form of a computed goto
A break statement is another form of a goto
A continue statement is another form of a goto.

I don't care what the person uses, as long as it is readable and understandable. The kernel uses goto statements. They have strict rules about how they may be used.

Using switch statments, with nested switch statements, with nested switch statements, where the whole thing covers a thousand lines or more, is bad bad bad. This failed the readability test.


"State Machines" are the embedded development flavour of the month?
year? (god forbid) decade? but are nothing more than multi-threaded
tangle of computed goto's with a roll your own scheduler in drag. :-))

threads often break the readability - but if a thread "only" runs around inside one or two methods, I am happy with that.


(Oh dear... I have probably offended about half my colleagues. :-))
Nope.
Most people in the IT industry end up developing a thick skin, so they can cope just fine.


====================
The real problem is quite different.

If you look at the life cycle of code, you see that it hangs around for a long long time.
Indeed, code spends most of its time in the debug/develop/enhance phase.

which means that a little care and attention at the initial writing phase
will pay huge benefits later on. It is ludicrous to attempt to save time
during the initial writing phase.

I have seen & written C++ threaded code that is easy to follow.
I have seen threaded C code that was near impossible to follow.

There are open source drivers out there that are state machines with threads (well, multiple task queues & interrupts) that are a nightmare to follow. Other drivers are a dream to work on.

My view is that "it does not matter what model you use".
The key point - is it followable and maintainable ?


Derek.
--
Derek Smithies Ph.D.
IndraNet Technologies Ltd.
Email: [EMAIL PROTECTED]
ph +64 3 365 6485
Web: http://www.indranet-technologies.com/

Reply via email to