Can Someone Help Me With The Programming?

No, no, no! I am not in the slightest bit upset about your treatment of delay(), nor about your treatment of John! :laughing: :laughing: It's all jolly banter, and I love it.

No, I was just hoping to respond with a kind of "While we're on the subject..." type of thing. I've noticed that there is a bit of a "religion" on this forum in which delay() takes on the role of the devil, hence my wanting to challenge it, purely in a good-natured way.

You mentioned you don't "like" delay(), and I'm just putting it to you that there is no such word as "like" in engineering disciplines. It's like saying "I don't like plastic, I will always encourage people to use metal." No engineer would ever say that; they say "Choose the most appropriate material bearing in mind the following criteria: operating temperature, tensile strength, durability, etc, etc."

That's why I want to challenge the "group-think" in this forum around delay().

And honestly, none of this is intended as an "attack", nothing involves being "upset". It's just an interesting and good natured debate, isn't it?

Actually, of course, this is a major thread hijack, so perhaps I might start a new thread for it. :grinning:

Well, it was the bold text and the word "dogma". I thought, "Oh lord, I lit someone's fuse."

Why I hate delay() : Its just what I said. Its kind of a gateway drug to linear programming. Once a inexperienced programmer heads down that path, its so hard to retrain them.

Much of what I run across here (mostly from people bringing in internet "finds") are dead ends by people that relied on delay() for their timing. You could say the burnt hand teaches best, but you have to have some hand left by the end of the burning.

So yeah, delay() is kinda' the devil. And it has earned its reputation by the damage it creates.

-jim lee

1 Like

Out of respect to the OP, I feel I should stop replying after this. :grinning:

To me, delay() is just a tool in the toolbox. So is an FSM. So is object-oriented programming. Etcetera. I don't think any of them are "evil" or "bad". The evil or bad comes from misusing them, which is the same for any tool.

I feel the right approach is to teach people when to use which tool. The slot-head screwdriver is probably one of the most misused tools in a workshop - it is used as a pry bar, a chisel, for undoing cross-head screws, a crow bar, an awl, even for doing a manicure! But that doesn't mean we should discourage a student from using one when she wants to undo a slot-headed screw.

So I think we should encourage the use of delay() where it is appropriate, and point out the dangers of using it where it isn't. Like I say, if your Arduino's sole purpose is to flash a single LED on and off, then a/ you probably don't need an Arduino, and b/ you probably don't need a finite state machine. :laughing:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.