View Single Post
  #8   Spotlight this post!  
Unread 15-01-2011, 17:11
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Procedural v Object Oriented Programming

Quote:
Originally Posted by Ether View Post
Not sure what you mean by this. Can you elaborate?

Ok from what I know, Java makes multiple copies of the object that I pass through parameters. In C++ you can just reference the object and it does not get copied into another memory location. If that is not true, my mistake.
Quote:
Originally Posted by DonRotolo View Post
Nope, can't see that from here.

My advice is to note the word "Team". If you are the only one who can use C++, or one of three who can while three or five others cannot, then you must consider the capabilities of the team.

If you're the only one who is good with C++, I see you as a potential bottleneck in programming. Our team would NEVER let a single student be responsible for an entire system, ain't gonna happen.

If half the programmers can do C++, then what is it the other half of the programmers will be doing?

Just because YOU can do a better job does not mean that it is best for the team. I see it only as what's best for you, and that doesn't fly in my book.


OK, now let's say you have a good case, and C++ really is a better choice. (Remember, I'm not aware of the specific situation on your team). Then it becomes your responsibility to logically explain why your way is superior for the team. Keep emotion out of it, keep your needs out of it: Why is it best for the team. Have several mentors listen to your "defense", and then accept their decision as final, with either your 100% support, or your resignation from the team - no team can have someone not fully committed to the team's decisions.


Lastly, think about why your team exists. What is the "product" delivered by the team? I can tell you it is NOT robots. It is "students", or to quote Team 1676's vision statement:
If this is similar to what your team believes, then the other students (who do not know C++) deserve a chance to contribute and learn. Next year, teach everyone C++ between September and December so you have the flexibility.
Yes that is why I made the choice of staying with Java, there was only 3 programmers last year, but from that time, we have grown to around 8. That was when I made the executive decision to stay with Java for the sake of others.
Quote:
Originally Posted by imac256 View Post
Do you guys have a programming mentor? If you do get his advice and see what he thinks. In my experience programming for FIRST robots I have used a mix of procedural and object oriented in C++ (in this case I consider procedural calling a function inside the class which the robot started to run, because with the cRIO there must be at least one class).

I do procedural calls in the code to break up the main teleop loop, so I would have a MecanumDrive() function which is called, and then that calls an OO class we wrote to get joystick information. I would create new classes if it were for sensors which we would have multiple of (our sensors for the Swerve Drive is an example), or for something we might use in future years (a class to interact with an Xbox 360 controller is an example). That way there is less repetitious code.

With that method of programming in mind, my suggestion is to use OO to program the robot, because it means that the code is better organized and therefore can be more easily fixed at competitions and during testing. And in my experience OO code has proved to be more understandable for people looking at the code because you can have calls like "FrontSensor->GetAngle();" which when reading it you can see that you are getting the angle of the front sensor.

That is just my 2 cents though.
We have 2 programming mentors, in fact, they also want C++. They made me the lead programmer and they want to take the "hands off" mentality. They do not interfere with anything unless I ask. They can't make it to 75% of the meetings. So I have to make all the executive decisions for the programmers. I am also the most experienced out of the 8. Half of them do not even show up half the time either.
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.