Quote:
Originally Posted by Jared341
We defined a custom "scripting format" that lets you describe high level robot behaviors in a plain text format. The "autonomous mode text file" can be created on a laptop (either with Notepad or, hopefully next year, in a full-featured GUI) and FTP'd down to the cRIO.
...
If you have the time (and interest), a system like this is fun to create and can lead to more maintainable code. Of course, it takes a lot of boilerplate to get it up and running, and you need to be absolutely sure it is bug free or you will be doing yourself no favors.
|
We were going to do this, but never got around to it. I've done systems like this (but not for FRC). I think that the biggest reason we didn't push at all to get this done, is that it does add another point of failure. Our current method just requires surrounding the commands with this:
Code:
case n: if (ralff.COMMAND()) stage++; break;
Which is near as easy to edit, but won't be dead if there's a syntax error (would be caught before deploy), and is easier to edit the system. I should note that the ralff system is designed so that all the commands interact in a certain way that makes it extra lovely.
Quote:
Originally Posted by ideasrule
I agree with the posters above: modular code is what makes object-oriented code as powerful and elegant as it is. My philosophy is that if you're copy and pasting code everywhere, you haven't created enough methods/function/subroutines/whatever-they're-called.
|
This position bothers me. Everything you said is true, modularity is one of OO's strengths. If you're copy/pasting code everywhere, you are doing something wrong.
But, code doesn't need to be object-oriented to be modular, powerful, elegant, and avoid copy/pasting. Yes, modularity is one of OO's strengths. I feel that they are teaching the benefits of OO, playing it as a superior paradigm. Yes, it has strengths, but so do others. And I've written more C code that is more modular than the better part of the Object-Oriented C++ and Java code I have seen.