Go to Post Problem with microprocessors: they do exactly what you tell them to do - KenWittlief [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
View Poll Results: Should first switch back to Pbasic?
Yes 2 2.99%
No 63 94.03%
Not Sure 2 2.99%
Voters: 67. You may not vote on this poll

Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 14-03-2004, 22:31
NoRemorse's Avatar
NoRemorse NoRemorse is offline
FOCUS Integration, LLC - Owner
AKA: Brian Roberts
FRC #1023 (Bedford Express)
Team Role: Alumni
 
Join Date: Feb 2003
Rookie Year: 2003
Location: Bedford
Posts: 221
NoRemorse has a spectacular aura aboutNoRemorse has a spectacular aura about
Send a message via AIM to NoRemorse Send a message via MSN to NoRemorse
Re: C Programing language. Is it the devil?

C is sooo much more powerful.

My only thoughts are that they need to clean up thier default code and all. IT's wierd how you can write a function and it NEVER returns from it. Also they can;t make stupid mistakes like forgetting to initialize the outputs in the auton mode, and bad firmware. When it's all polished up hopefully by next year, i think it will shine!
__________________

http://LSJBuildUp.com -Documenting the build of my LSJ, as well as other influential cars.
  #2   Spotlight this post!  
Unread 17-03-2004, 00:36
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
Re: C Programing language. Is it the devil?

Quote:
Originally Posted by NoRemorse
C is sooo much more powerful.

My only thoughts are that they need to clean up thier default code and all. IT's wierd how you can write a function and it NEVER returns from it. Also they can;t make stupid mistakes like forgetting to initialize the outputs in the auton mode, and bad firmware. When it's all polished up hopefully by next year, i think it will shine!
Why wait for IFI to clean up their default code? Throw it all away! There isn't much magic in the code. You just have to respect a couple calls & sequences (all noted with /*DO NOT CHANGE */) and after that you are free to party! I agree totally that the default code was warty as heck. Even the EDU default code was better structured and easier to follow. By the time I was done I saved the printf code and nothing else. Oh, I did reuse the file name "user_routines.c"...

One of the big reasons I re-wrote everything was to make sure I understood how it all worked. Sometimes it is easier to rewrite than to take the time to understand and work around someone elses choices. The down side of the rewrite is that one cannot use any of the tutorial stuff on IFI...
  #3   Spotlight this post!  
Unread 17-03-2004, 00:52
Anthony Kesich's Avatar
Anthony Kesich Anthony Kesich is offline
Programmer Turned Engineer
AKA: SonKenshin
#1097 (Site 3 Engineernig)
Team Role: Leadership
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Sacramento, CA
Posts: 186
Anthony Kesich has a spectacular aura aboutAnthony Kesich has a spectacular aura about
Send a message via AIM to Anthony Kesich
Re: C Programing language. Is it the devil?

Quote:
Originally Posted by Larry Barello
Even the EDU default code was better structured and easier to follow
Is it just me or is this a recurring theme? Even last year with that dreaded thing called pBasic, the edu code was better than the FRC code (which was why i used it to run our bot lat year). Yes, I know this is off topic, so i'll add in my blurb about C

C, even if it is not the most common language, is essentially the granddaddy of all other modern languages. Look at Java or C++(duh) or C# (another duh) or J#, or php to a degree. All of them are structured like C and have very similar, if not identical syntax and basic functions (i.e. ++ << >> etc). If I had to narrow it down to one reason i would keep C over pBasic, it is the following:

X=X+1 becomes X++;

-Kesich
__________________
C is screwing up my English--I'm ending all my sentences in semi-colons;

Horray for most things! -George Carlin

"Sure, I'll play rugby. Besides, I have a lot of experience running from really big guys who want to cream me." -Me, Freshman year
  #4   Spotlight this post!  
Unread 17-03-2004, 07:34
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: C Programing language. Is it the devil?

Isn't most of the default code headers and printf? I built mine on the default code, but totally destroyed anything user. As in: select>delete.
  #5   Spotlight this post!  
Unread 17-03-2004, 07:37
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: C Programing language. Is it the devil?

Quote:
Originally Posted by Larry Barello
Why wait for IFI to clean up their default code? Throw it all away!...By the time I was done I saved the printf code and nothing else...
Funny, I hear a lot of people are throwing away the printf code and writing their own.

I was a complete newcomer to FIRST this year, with absolutely no experience with the IFI computers. My strategy was to make as few structural changes to the code as possible, so I could always go back and look at the default code to figure out how it was supposed to flow. I did end up with a separate "math utilities" file, and I am only just now on the verge of splitting out the autonomous code into its own file.
  #6   Spotlight this post!  
Unread 17-03-2004, 08:41
seanwitte seanwitte is offline
Registered User
None #0116
Team Role: Engineer
 
Join Date: Nov 2002
Location: Herndon, VA
Posts: 378
seanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant future
Send a message via AIM to seanwitte
Re: C Programing language. Is it the devil?

There is nothing wrong with PBASIC, expecially with the latest release. The only thing missing from the language syntax that I missed was structs. The issue with the old controller has more to do with the architecture of the stamp. The stamp 2sx has 8 banks of 2kb program memory, but they all share the same 32 bytes of RAM. You can write a separate source file for each of the 8 program slots, but unless you declare the same variables in the same order in each file you can't share variable values between slots. Its sort of modular, but not really.

The big advantage to C is the fact that you can break your code up into logical blocks based on shared interfaces. When you write a complex program it is much easier to work with small, fully tested modules than one huge file. Once you define your interfaces you can code as many implementations of each as you want. It makes it much easier to write platform independent code that will run on either the mini or FRC controller. It also makes it easier to share code between teams because you're only adding files to the project instead of pasting code.

You'll eventually learn that for a good developer the language is largely irrelevent. Aside from the normal caveats in any language, value is added by knowing how to solve problems, not in knowing the syntax.
  #7   Spotlight this post!  
Unread 17-03-2004, 14:52
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: C Programing language. Is it the devil?

Yes, but not knowing the syntax makes it dificult to solve the problem.
  #8   Spotlight this post!  
Unread 17-03-2004, 14:59
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: C Programing language. Is it the devil?

Quote:
Originally Posted by seanwitte
The big advantage to C is the fact that you can break your code up into logical blocks based on shared interfaces.
I still say the biggest advantage to C is signed math. The hoops you had to jump through with pBASIC to get anything to work was rediculous. Look at the following two statements:

pBASIC:
PControl = Error * PGain - 127*(PGain-1) // What??????

C:
PControl = Error*PGain;

It seems to me that the C implementation is much easier, more intuitive, and requires less testing/debug to be sure you recentered yourself correctly around zero. The sad thing is, it just took me 2 seconds to write the C line, but about 5 minutes to figure out the pBASIC line. Given that, I'd rather have C any day.
__________________
-
An ounce of perception is worth a pound of obscure.
  #9   Spotlight this post!  
Unread 21-03-2004, 21:16
adventrx327's Avatar
adventrx327 adventrx327 is offline
Registered User
no team
 
Join Date: Mar 2004
Rookie Year: 2003
Location: ""
Posts: 19
adventrx327 is on a distinguished road
Send a message via AIM to adventrx327
Re: C Programing language. Is it the devil?

learning java first, c was a much easier transition than pbasic
  #10   Spotlight this post!  
Unread 21-03-2004, 21:21
K0r34nB0y's Avatar
K0r34nB0y K0r34nB0y is offline
Registered User
AKA: Nate
#0250 (Dynamos)
Team Role: Programmer
 
Join Date: Feb 2004
Location: Capital Region, NY, USA
Posts: 27
K0r34nB0y is an unknown quantity at this point
Re: C Programing language. Is it the devil?

pbasic is old and ugly. C may be old but its obviously good enough to spawn 5 (probably more, but all i can think of at the moment) new languages
__________________
"Joe! Stop answering all the questions! You're too smart."
--later--
"Okay, from now on you have to speak in tertiary."
  #11   Spotlight this post!  
Unread 21-03-2004, 21:45
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: C Programing language. Is it the devil?

C+, C++, C#, plus all the varients and standards of C (PIC C, ANSII C, NQC, etc.).
  #12   Spotlight this post!  
Unread 22-03-2004, 09:23
CrashZero's Avatar
CrashZero CrashZero is offline
Computer Nerd
#1352 (Huskie Robotics)
Team Role: Programmer
 
Join Date: Mar 2004
Location: Stratford Northwestern
Posts: 44
CrashZero will become famous soon enoughCrashZero will become famous soon enough
Talking Re: C Programing language. Is it the devil?

C is easier and better to use because of the fact that more people already know it or something very close to it making it easier for newcomers to learn it from someone who already has knowledge. I agree that the default code may have some serious problems but I simply did not have time to re-write it all. My team did not have the bot built until the day of shiping and then wanted something that would work. IN LESS THEN A DAY!!! so I gave them the default to see if the moters work. They were not happy that they couldn't test anything else so now I have a modified code but the base is still the default.
__________________
This is our world now... the world of the electron and the switch, the beauty of the baud. We make use of a service already existing without paying for what could be dirt-cheap if it wasn't run by profiteering gluttons, and you call us criminals. We explore... and you call us criminals. We seek after knowledge... and you call us criminals. We exist without skin color, without nationality, without religious bias... and you call us criminals. You build atomic bombs, you wage wars, you murder, cheat, and lie to us and try to make us believe it's for our own good, yet we're the criminals. Yes, I am a criminal. My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like. My crime is that of outsmarting you, something that you will never forgive me for. I am a hacker, and this is my manifesto. You may stop me, but you can't stop us all...

quote from:

+++ The Mentor +++
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is your most prefered programming language? Hailfire Programming 156 19-01-2005 21:42
PBASIC language syntax WizardOfAz Programming 14 30-04-2003 10:23
Team 1018 Devil 1 ...dateline 4 AM 2-20-03 Bob Steele Robot Showcase 1 20-02-2003 18:17
Who is doing the programing for team 61 Walter_Jr Programming 5 25-01-2003 00:31
TI programming using Z80 assembly language Jeff Wong Chit-Chat 1 07-06-2001 01:27


All times are GMT -5. The time now is 15:43.

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