Shop OBEX P1 Docs P2 Docs Learn Events
"The Elements of PBASIC Style." — Parallax Forums

"The Elements of PBASIC Style."

ArchiverArchiver Posts: 46,084
edited 2004-04-12 19:17 in General Discussion
"PBASIC Style"? That's almost a contradiction of terms. ;-)

Although I do have a designer Tee shirt. Is that "Geek Style"? ;-)

--
Enjoy,
George Warner,
Schizophrenic Optimization Scientists
Apple Developer Technical Support (DTS)

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-04-10 18:03
    Hello from Gregg C Levine
    I think not.
    George, even good old FPBASIC from Apple had that concept. Same with
    Apple's Integer BASIC. There were, then, certain methods that every
    program had to adhere to.

    And now back to our regularly scheduled discussion on Basic Stamps,
    and PBASIC.
    Gregg C Levine hansolofalcon@w...
    "The Force will be with you...Always." Obi-Wan Kenobi
    "Use the Force, Luke."· Obi-Wan Kenobi

    >
    Original Message
    > From: George Warner [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=2hVK4nekhiz9qDeRawTGejz4ImEAAIXbhbgx2Q6F7oM9YSj2NNcuzZHUTovN5kIvnuANHAHzmEo]geowar@a...[/url
    > Sent: Saturday, April 10, 2004 12:06 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] "The Elements of PBASIC Style."
    >
    > "PBASIC Style"? That's almost a contradiction of terms. ;-)
    >
    > Although I do have a designer Tee shirt. Is that "Geek Style"? ;-)
    >
    > --
    > Enjoy,
    > George Warner,
    > Schizophrenic Optimization Scientists
    > Apple Developer Technical Support (DTS)
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-10 18:10
    No so! PBASIC is a very elegant language and for that reason it has
    become wildly successful (look how many companies make [noparse][[/noparse]almost]
    PBASIC-compatible products).

    The problem, in my opinion, is that many coders seem to think that
    neatness counts for nothing. I know because I get a lot of code sent to
    me for "fixing" and most of the problem has to do more with formatting
    than anything else (most coders can't see their own errors through the
    sloppiness of their code). With a little planning and neatness when
    coding, most bugs can be prevented or more easily eliminated.

    Okay, I'll get off my soapbox now ... but I will fervently hold onto the
    opinion that most program bugs can be prevented by adopting and/or
    adjusting the strategies in that document.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: George Warner [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=5pNuLU47qJaSlh4ZCtZ9kk8wjN3Gg1FxATMsalBQa6zPKQscBd4V-FPP5JQuZthTRegs36lmEQ]geowar@a...[/url
    Sent: Saturday, April 10, 2004 11:06 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] "The Elements of PBASIC Style."


    "PBASIC Style"? That's almost a contradiction of terms. ;-)

    Although I do have a designer Tee shirt. Is that "Geek Style"? ;-)

    --
    Enjoy,
    George Warner,
    Schizophrenic Optimization Scientists
    Apple Developer Technical Support (DTS)
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-10 23:22
    And, the new PBASIC 2.5 allows programs to be even more structured
    and easy to document. The new IDE helps with capitalization and
    syntax coloring.

    In the context of multibank programming and PBASIC 2.5, I have found
    that my programming style for the Stamp has changed a lot in the past
    year or so. On one hand, it used to be with the single bank BS2 that
    I had to be frugal with every bit, parsimonious to the nth degree
    with every feature of the program. Use E.g., PAUSE 128 instead of
    PAUSE 100, just to save a couple of bits, or make a prompt 2 letters
    instead of 5, because there was only one byte left before the dreaded
    "out of eeprom" message.

    With the luxury of multiple banks, that is no longer much of a
    concern, so long as each group of "tasks" is broken down to a size
    manageable in one bank. And the new structures in PBASIC 2.5 can be
    applied (and more easily documented) even though the program will end
    up larger in terms of code size compared to a program painstakingly
    pared down for minimum size (but not as transparent).

    -- Tracy



    >No so! PBASIC is a very elegant language and for that reason it has
    >become wildly successful (look how many companies make [noparse][[/noparse]almost]
    >PBASIC-compatible products).
    >
    >The problem, in my opinion, is that many coders seem to think that
    >neatness counts for nothing. I know because I get a lot of code sent to
    >me for "fixing" and most of the problem has to do more with formatting
    >than anything else (most coders can't see their own errors through the
    >sloppiness of their code). With a little planning and neatness when
    >coding, most bugs can be prevented or more easily eliminated.
    >
    >Okay, I'll get off my soapbox now ... but I will fervently hold onto the
    >opinion that most program bugs can be prevented by adopting and/or
    >adjusting the strategies in that document.
    >
    >-- Jon Williams
    >-- Applications Engineer, Parallax
    >-- Dallas Office
    >
    >
    >
    Original Message
    >From: George Warner [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=IuCR0T7S1ah6zes371v1TYQJoLRlOAK6Xr-3P6EUKCBQu5RDitu_oxt_jzkQvRzFXvj8qzfx-eE]geowar@a...[/url
    >Sent: Saturday, April 10, 2004 11:06 AM
    >To: basicstamps@yahoogroups.com
    >Subject: [noparse][[/noparse]basicstamps] "The Elements of PBASIC Style."
    >
    >
    >"PBASIC Style"? That's almost a contradiction of terms. ;-)
    >
    >Although I do have a designer Tee shirt. Is that "Geek Style"? ;-)
    >
    >--
    >Enjoy,
    >George Warner,
    >Schizophrenic Optimization Scientists
    >Apple Developer Technical Support (DTS)
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-12 14:57
    > On one hand, it used to be with the single bank BS2 that
    > I had to be frugal with every bit, parsimonious to the nth degree
    > with every feature of the program. Use E.g., PAUSE 128 instead of
    > PAUSE 100, just to save a couple of bits

    Whoa, let's talk about that. Is this because 128 is a power of 2?

    Paul
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-12 19:17
    > > On one hand, it used to be with the single bank BS2 that
    >> I had to be frugal with every bit, parsimonious to the nth degree
    >> with every feature of the program. Use E.g., PAUSE 128 instead of
    >> PAUSE 100, just to save a couple of bits
    >
    >Whoa, let's talk about that. Is this because 128 is a power of 2?
    >
    >Paul

    Hi Paul,

    Yes, the Stamp internally stores the powers of 2 in a very compact form.

    -- Tracy
Sign In or Register to comment.