Shop OBEX P1 Docs P2 Docs Learn Events
PBasic Code Suggestions — Parallax Forums

PBasic Code Suggestions

willthiswork89willthiswork89 Posts: 359
edited 2006-08-10 06:23 in General Discussion
Although ive come to love pbasic and how well it was written, i have noticed that alot of it takes VB as its inhertiance, I think that there are a few things that could be changed very easily which would make the coding standards a little bit easier... by taking in some of c++ standards i think you could gain alot more efficient· coding... such as

variable = variable + 1 translates to Variable++

the for loop could be changed also to be made simpler, im sure there are many other suggestions but i figured ide make a suggestion! thanks for listening!

Comments

  • KB3JJGKB3JJG Posts: 95
    edited 2006-08-09 01:13
    pbasic and the simple syntax·is what makes stamping so darn easy. Making a hybrid from the syntax of two different languages will not make anything easier for anyone, anywhere.

    If you want to develop in a language/syntax similiar to c++, you should take a look at the javelin stamp. It has common elements found in java, like OO, exceptions and strings.

    my .02
    ·
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-08-09 01:45
    my main thing was the incrementing porcedure, i thought that would be a nice thing to have in there instead of that... its a good coding standard no doubt i agree!
  • KatyBriKatyBri Posts: 171
    edited 2006-08-09 02:21
    Please stay away from c++ with the STAMP. It is too cryptic. The C++ community already destroyed the great Visual Basic IDE by going to .NET (although Microsoft has added layers to make some of it look like the old VB6).
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-08-09 02:26
    i would have to disagree Katy, the c++ language is the most powerful, AND efficient language on the PC and will be for years to come,IMO. VB is too much to deal with for one reason and one reason only, its COM files you have to include. if ones missing nothing works...
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-08-09 23:26
    willthiswork89 said...(trimmed)
    Although ive come to love pbasic and how well it was written, i have noticed that alot of it takes VB as its inhertiance,
    Are you saying that you think PBASIC was derived from VB?· I don't think VB was around then...There were a great number of BASICS but VB is inherently an Object-Oriented Language, whereas the BASIC Stamp is an Embedded Microcontroller.· Many of the facilities that VB makes use of wouldn't normally be available on such a controller.· I guess I don't see the comparison, but I am trying to understand if you are referring to upgrading PBASIC?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-08-10 01:14
    no no not at all i just think there should be an easier way of incrementing things and what not... little things like the variable++ which would save a little time, i think pbasic should be changed but in a very inconspicuous way. i was pointing out that pbasic and vb are alike buy the way the language writes out, like IF has to have END IF

    brackets would make the clarity of pbasic alot better, and the editor has to background color changer! it stays white regardless ide like to see that changed.

    im sure you all agree that

    IF(Variable < variable1)
    {
    variable++
    }

    looks alot easier then

    if(variable < variable1) THEN
    variable = variable + 1
    ENDIF

    maybe its because im used to reading c++ as thats where my core is. just my opinion!
  • MikeKMikeK Posts: 118
    edited 2006-08-10 02:07
    Don't be sure that we'll all agree. The {} do not appear clearly in all fonts on all displays and printouts. They're also not easy to discern from () and [noparse]/noparse in many cases. I work (in my daily job) with several different languages and I generally find the IF / THEN / ENDIF (or FI) easier to deal with.

    I do prefer x++ or x += 1 over x=x+1, especially when the variable names are long.

    Mike

    Post Edited (MikeK) : 8/10/2006 2:11:40 AM GMT
  • RDL2004RDL2004 Posts: 2,554
    edited 2006-08-10 02:50
    I agree KatyBri.

    /mourn VB6

    I also never understood why Microsoft didn't make the VB files part of the default Windows installation. It made no sense whatsoever.

    In the early years it may have bloated the basic Windows install a bit, but from the late 90s on, the additional disk space needed was trivial.

    - Rick
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-08-10 03:43
    Some of the things you are interested are already in place on the new Propeller/Language.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-08-10 06:23
    yea i totally agree mike ide love to have variable++ for normal pbasic... if that could be added ide be completley satisfied.
Sign In or Register to comment.