Go to Post We have a lot of rookies, and I can't wait to see the inspiration on their faces. - Karibou [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-09-2011, 14:06
Kyler Hagler's Avatar
Kyler Hagler Kyler Hagler is offline
Jack of all trades
FRC #3310 (Black Hawk Robotics)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Rockwall-Heath High School
Posts: 99
Kyler Hagler has a spectacular aura aboutKyler Hagler has a spectacular aura aboutKyler Hagler has a spectacular aura about
Exclamation A new Programmer

Hi my name is Kyler, I am the new Head Programmer as our old programmer has left us to go to college. Now since i have got that out of the way....

I have started c++ over the summer and can basically make a calculator.... (I know not good) but i want to program in c++ because he left me all of his code (Plus i find it interesting since i am a computer wiz) All i need to know if i should just continue to learn c++ or did what he did and focus on programming just for the WPILIB Library?
Reply With Quote
  #2   Spotlight this post!  
Unread 05-09-2011, 15:21
Patrickwhite's Avatar
Patrickwhite Patrickwhite is offline
May the North be with you
FRC #0610 (The Coyotes)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Toronto
Posts: 88
Patrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of light
Re: A new Programmer

Programming with WPILib is a whole different ballgame from basic arithmetic. However, if I were in your shoes, I'd keep learning C++ in general. Here's why:
WPILib focuses on providing you with objects through which all the work to interfacing with the robot is done for you.
If you continue learning C++, especially using any non-standard libraries, you'll run across objects sooner or later. There's a two-way learning process here - what you learn in this way will be applicable to WPI code, and vice versa.
If you learn one multi-paradigm language like C++ well, picking up another language (unless it's Haskell or something ridiculous like that) is generally a case of getting used to some different syntax.
If you're planning on doing anything related to programming in the future, C++ is a good place to be, and the more you know, the more you are able to do.

Cheers, and hope you have fun learning C++!
__________________
while(!going.isTough());
tough.exit();

What will we do tonight, Warfa?
The same thing we do every night, Patrick. Sit and wait for Electrical.
Reply With Quote
  #3   Spotlight this post!  
Unread 05-09-2011, 18:04
~Cory~'s Avatar
~Cory~ ~Cory~ is offline
Student
AKA: Cory Rypkema
FRC #0706
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Worcester MA
Posts: 216
~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold
Re: A new Programmer

I was given some advice that really helped me when I was in your shoes. Now its time to pass it on:

Quote:
Its the strategic part of programming that you are going to struggle with. Getting your ideas translated into code that isnt difficult.
I really took this to heart and stopped worrying about "learning" c++ and dove right into programming the robot. I kept a c++ reference with me and basically looked up how to do everything that had to do with the language (syntax) part. I wrote the code in English of what I wanted to do (I did this at home so no one would see). And then translated it into c++. I feel that I was much more effective with this manner because by the time competition came around I was very familiar with algorithms (such as PID) which is wayyyyyy more important than being able to recite the for loop syntax or "strong" vs "weak" typed languages. You will have ample time latter to learn this stuff.
__________________
corin.rypkema.org
WPI Class of '17
'12 Dean's List Finalist, Mentor of 706 - Cyberhawks
Reply With Quote
  #4   Spotlight this post!  
Unread 05-09-2011, 19:55
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: A new Programmer

Just remember, to become a good programmer, you need years of practice. It is just like any sport, skill, activity. Once you start to get the hang of programming, there will be more curve balls thrown at you and you will need to learn how to adapt. While I do agree on not focusing on C++ as in the syntax, but I say focus on C++. It is not all black and white as you may think; syntax goes hand an hand with the whole "programming" part of it. What I mean by that is that you may have all the pseudo code on paper, but you might not be able to translate that into code without knowing a lot of syntax. It is hard to explain what I mean. If you did not know what static functions are, you might have had to change up the class hierarchy to accommodate what you wanted to do. Learn what is inside your tool box; you do not want to be using a hack saw to cut down a tree while a chainsaw is in your toolbox.

By all means, go learn algorithms, but learn how to think. Thinking is the most important aspect of coding. Always get in the habit of pseudo coding before touching the keyboard. If you are stuck, just sleep on it. Chances are, if you are tired, you end up doing stupid stuff. Like last night, I was writing a sorting algorithm late at night, but I I ended up with this 200 line class. It was not pretty, but I reduced it down to 40 lines or so.
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.

Last edited by davidthefat : 05-09-2011 at 19:58.
Reply With Quote
  #5   Spotlight this post!  
Unread 05-09-2011, 22:58
~Cory~'s Avatar
~Cory~ ~Cory~ is offline
Student
AKA: Cory Rypkema
FRC #0706
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Worcester MA
Posts: 216
~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold
Re: A new Programmer

Quote:
Originally Posted by davidthefat View Post
learn how to think. Thinking is the most important aspect of coding. Always get in the habit of pseudo coding before touching the keyboard. If you are stuck, just sleep on it. Chances are, if you are tired, you end up doing stupid stuff. Like last night, I was writing a sorting algorithm late at night, but I I ended up with this 200 line class. It was not pretty, but I reduced it down to 40 lines or so.

This captures the entirety of learning how to really code. Well said!
__________________
corin.rypkema.org
WPI Class of '17
'12 Dean's List Finalist, Mentor of 706 - Cyberhawks
Reply With Quote
  #6   Spotlight this post!  
Unread 06-09-2011, 01:25
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 803
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: A new Programmer

One of the best things you can do to learn how to program the robot is to try programming last year's robot again from scratch. Heck, try to make it even better than last year's code. You have months until the season starts. Try to write a 2 tube autonomous mode. Have fun with the robot. You don't need to know lots of crazy C++ language features to be able to program the robot well. If you find something that you don't understand in WPILib, then take the opportunity to learn about that language feature.

My experience with FRC programming has been that figuring out which algorithm works best to solve the problem in front of me is the hardest part. It is quite hard to figure out how to get the robot to do what you want it to do, and that problem is just as hard to solve when writing pseudo code as when writing C++.

I have also been work for years on how to structure the code in such a way to make it easy to maintain, quick to try new stuff out with, and flexible. It is easy(ier) to write code to get the job done, but hard to make it so that you can fix it quickly when you catch a bug in the heat of competition, or so that it is easy for someone new on the team to quickly get up to speed.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:09.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi