Ways to make code easily reviewable and extendable


Closed Thread
Results 1 to 15 of 15
  1. #1
    Ted's's Avatar
    Ted's Guest

    Exclamation Ways to make code easily reviewable and extendable

    I sometimes lose the thread within my code.

    This is mainly because of pbp's missing opportunity of using real functions. Speaking of which: That is what I like about visual basic. To structure my code in pbp

    - I use colons to put multiple orders in one line
    - I use semi-colons to comment my code
    - I use indents
    - I use variables like
    - I print the code 4 pages/a4 page

    Which additional ways do you know to make the code easily reviewable and extendable?

  2. #2
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    I have 3 dialects of BASIC (mikroE, Swordfish and Oshonsoft) for PIC's and have been considering adding PBP to the list. Interesting to note that functions are not supported. Thanks for the heads up.

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Consider this
    http://www.picbasic.co.uk/forum/show...58&postcount=4

    And look at how Darrel has for example Instant Interrupts and LCD Any Pin.

    Not quite the same as in other languages, but when you get right down to it it is.
    This is the nice thing about PBP, with a little learning you can make it do whatever you want.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Mack, I think I understand LCD Any Pin, the 3 compilers mentioned above allow connecting an LCD to any port/pin combination - also for graphic LCD's. Correct?

    What is the purpose of instant interrupts? Thanks.

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I do not use the other compilers. Can not comment on their abilities. I was referring to VB, C whatever and the like.

    Instant Interrupts are basically as the name implies. Look at all of the features.
    http://www.picbasic.co.uk/forum/showthread.php?t=3251

    The point I am trying to make, it seems like any language you use, there is always some thing that would be nice to have but does not. When the language is learned and the hardware or machine is understood, then you can always find a work around. Maybe this thinking comes from the time when a Hacker was still considered a good think to be called. (now days it seems the world is full of "crackers") . The ability to take a language, pieces of hardware, do a little tweaking, and do something new is all the fun.

    The longevity of PBP and the things that can be done with it is what keeps me using it. I gave up on the point and click VB and VB like stuff years ago. To constrained. Sure, a simple function to pass a couple of variables is nice, but that also seems to make more overhead.

    Give PBP a try, I think there is still a demo available. You will be suprised with what it can do.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Thanks, Dave. Will take a closer look at PBP.

  7. #7
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Thumbs down

    Nice excursion mackrackit, now move back to topic.

  8. #8
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    I sometimes lose the thread within my code.
    I find that folks with early-onset Alzheimer's generally find programming a challenge...

    Assuming you don't fall into that category...

    1. Comment what you're doing
    2. Comment what your program is doing
    3. Comment revisions and alterations
    4. Comment section headings

    Am I getting thru with this 'comment' business?...

    5. Put your subroutines in one place
    6. Comment your subroutines as to what they do
    7. Give Subroutines a meaningful name

    8. Put interrupt handlers in one place
    9. Comment Interrupt Handlers as to what they do
    10. Give Interrupt Handlers a meaningful name

    11. Assign meaningful names to aliases and variables
    12. Put your Hardware Defines all in one place
    13. Put your Hardware aliases all in one place
    14. Put your software defines all in one place
    15. Put EEPROM defines all in one place

    It's not that difficult to write neat and tidy code that can be logically followed.

    People wrote good logical code long before Visual Basic ever came on the scene!

    Ever thought of flow-charting your program first as an aid to your writing it? Rarely done because folks are just plain lazy, but it can be an aid if you're having difficulties as can donepezil hydrochloride.

  9. #9
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ted's View Post
    Nice excursion mackrackit, now move back to topic.
    I was on topic, you mentioned functions and I addressed that.
    My apologies if you could not follow the subject.
    By the way, do you know trent? I bet he could help you.
    Dave
    Always wear safety glasses while programming.

  10. #10
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    Ever thought of flow-charting your program first as an aid to your writing it?
    Yes and that is a good point. Do you know a flow-chart program which converts to pbp or is at least able to be customized to do so? I thought about this but my search was unsuccessful.

  11. #11
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    donepezil hydrochloride wuld bi muy ferst option if onli i culd remenbe how to spel it...;o}
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  12. #12
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

  13. #13
    Join Date
    Mar 2005
    Location
    Iowa, USA
    Posts
    216


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ted's View Post
    Yes and that is a good point. Do you know a flow-chart program which converts to pbp or is at least able to be customized to do so? I thought about this but my search was unsuccessful.
    http://www.imagesco.com/microcontrol...-compiler.html
    It doesn't convert flowcharts to PBP code as you requested in THIS THREAD , but I believe this is somewhat what you're looking for.

    O/T -
    Bruce - You might want someone to spellcheck that book you're working on
    Wisdom is knowing what path to take next... Integrity is taking it.
    Ryan Miller

  14. #14
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Bruce - You might want someone to spellcheck that book you're working on
    I'm good now. I found my donepezil hydrochloride prescription so I can remember most of it
    now...;o}
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  15. #15
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by rhino View Post
    It doesn't convert flowcharts to PBP code as you requested in THIS THREAD , but I believe this is somewhat what you're looking for.
    Thank you. This looks interesting.

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts