Results 1 to 5 of 5

Thread: Safety first: 3+1 suggestions for thinBASIC

  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Lightbulb Safety first: 3+1 suggestions for thinBASIC

    After using ThinBASIC for 3 years for professional work, there are few things which I would like to see imlemented one day. I would like to leave it open for discussion for some time, that is why I didn't post this at Support area.

    Optional script pre-parsing
    It is very unpleasant to fall into syntax error trap in some less exposed code branch. It would be nice to have syntax checker, which would formally analyse the script without running it. I think it could be done via metadata from thinBasic_LoadSymbolEx for example.

    Encapsulation of code units
    Some kind of isolated code units has been raised few times here, I think with the dawn of OOP this comes true step by step

    Exception handling
    Currently, when ThinBASIC and its modules, (especially TBGL) find a serious issue, they raise a RunTimeError dialog, which stops the execution or write ERR variable, which is not realised very often. It would be nice to have a structured exception handling (try/catch/finally), with ability to raise descriptive messages instead of sometimes vague ERR. Structured proposal is posted as attachement here.

    Bonus round: Test driven developement support
    My friend Honza from work gave me a book called "Growing Object Oriented Software, Guided by Tests". It describes very interesting approach of designing software in quite unique way - by writing failing tests for features first, and then the actual code. It is approach worth study, as I can see from work it makes sense - code by Honza basically never crashes, which looks like kind of magic (but it is not something esotheric - "just" well thought developement approach).


    Petr
    Last edited by Petr Schreiber; 24-09-2013 at 21:11.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  2. #2
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404
    After playing with many OOP based languages. Although the all object oriented languages are very powerful, not having the option to go procedural and oop seems restrictive.
    I like the c++ approach of you can program in any style you like, I just don't like the turn back to c style syntax many new c++11 gurus are using.

    Function(some parameters here){
    your function code here;
    }

    And they have gone to all lowercase with underscrores between words, OOOOOOh I hate that.
    this_to_me_is_tedious = but_they_are_using_this_everywhere_now;

    Sorry, I think I got off topic with syntax and not discussion about errors buried in less used code.

    Perhaps a unit testing master program should be released with each major release of thinBasic?

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Quote Originally Posted by Petr Schreiber View Post
    Optional script pre-parsing
    It is very unpleasant to fall into syntax error trap in some less exposed code branch. It would be nice to have syntax checker, which would formally analyse the script without running it. I think it could be done via metadata from thinBasic_LoadSymbolEx for example.
    It is something I always think when I work on thinBasic! Always. But how to implement?
    thinBasic is not compiled and no pCode is generated so there is no real full scan of the source code.
    During script start-up a pre-parsing stage is executed but only few things can be checked: logical flow nesting sequence, opening and closing tags, some lexical correctness. I can add some more checking during this phase but the real full checking is something I still have to understand how to do. Using keyword syntax is possible using your approach (passing keyword syntax inside thinBasic_LoadSymbolEx) but this would increase a lot the size of all DLLs


    Quote Originally Posted by Petr Schreiber View Post
    Encapsulation of code units
    Some kind of isolated code units has been raised few times here, I think with the dawn of OOP this comes true step by step
    Some news here: http://www.thinbasic.com/community/p...d=440#note2631


    Quote Originally Posted by Petr Schreiber View Post
    Exception handling
    Currently, when ThinBASIC and its modules, (especially TBGL) find a serious issue, they raise a RunTimeError dialog, which stops the execution or write ERR variable, which is not realised very often. It would be nice to have a structured exception handling (try/catch/finally), with ability to raise descriptive messages instead of sometimes vague ERR. Structured proposal is posted as attachement here.
    Your suggestion is very clever and mostly doable. It will be one of my next thinBasic big things.


    Quote Originally Posted by Petr Schreiber View Post
    Bonus round: Test driven developement support
    My friend Honza from work gave me a book called "Growing Object Oriented Software, Guided by Tests". It describes very interesting approach of designing software in quite unique way - by writing failing tests for features first, and then the actual code. It is approach worth study, as I can see from work it makes sense - code by Honza basically never crashes, which looks like kind of magic (but it is not something esotheric - "just" well thought developement approach).
    Great suggestion! I found a PDF version here http://it-ebooks.info/book/1503/
    Personally I have to say that I followed this approach in some of my work projects in the past and I had great results in terms of stability. It is a bit longer during the first phase of the project where many programmers have the natural instinct to just write down few projects details and go directly to the code. During the initial phase it seems you are loosing your time. But, to my opinion, the time spent in making failing test at first is much much less than the time and brain neuron and personal credibility you will loose later if you do not follow this approach.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

Similar Threads

  1. Suggestions for website and/or forum
    By marcuslee in forum Shout Box Area
    Replies: 6
    Last Post: 23-03-2009, 18:16
  2. Few suggestions
    By Petr Schreiber in forum thinBundle suggest new features
    Replies: 1
    Last Post: 27-01-2007, 16:04
  3. Few mad suggestions
    By Petr Schreiber in forum thinAir General
    Replies: 5
    Last Post: 31-10-2005, 09:55

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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