|
|
|
![]() |
|
|||||||
|
||||||||
| 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 | |||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: C Programing language. Is it the devil?
Quote:
![]() 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. |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||||
|
|||||
|
Re: C Programing language. Is it the devil?
Yes, but not knowing the syntax makes it dificult to solve the problem.
|
|
#4
|
||||||
|
||||||
|
Re: C Programing language. Is it the devil?
Quote:
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. |
|
#5
|
||||
|
||||
|
Re: C Programing language. Is it the devil?
learning java first, c was a much easier transition than pbasic
![]() |
|
#6
|
||||
|
||||
|
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
|
|
#7
|
|||||
|
|||||
|
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.).
|
|
#8
|
||||
|
||||
|
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.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |