I wish for a re-design of the programming language.

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by CABrouwes, Oct 1, 2012.

  1. CABrouwes

    CABrouwes

    Joined:
    Apr 25, 2009
    Messages:
    86
    Likes Received:
    2
    Location:
    New York Area
    Is anyone else wishing that the programming language for the logic engine be re-designed. While the current Pascal inspired language is effective I find it clunky. It makes code re-use and sharing difficult, it does not allow for cleanly separating modules or separating code from variables. I would love it if instead of being based on the Pascal model , it were based on an object-oriented language. An object oriented model would fit perfectly the C-bus architecture, for example Charmed Quark System uses very effectively the object model in its automation software.

    Some example of issues.,

    1. Each programming unit is split between different sections, e.g. permanent variables in one place, initialization routine in another one, functions here, procedures there and finally somewhere else the main module. This makes sense code re-use and sharing very difficult.
    2. No local variables.
    3. If you want to write the same logic for multiple devices you have to repeat the same code multiple times or use complicated data structures.
    4. The whole business of accessing system IO, manager variables, even C-bus quantities is very clumsy because it relies on procedure calls. Why not use functions instead and avoid temporary variable. Even better, why not use object properties instead?
    5. Timer can' t be used in procedures or functions.
     
    CABrouwes, Oct 1, 2012
    #1
  2. CABrouwes

    bmerrick

    Joined:
    Jun 13, 2007
    Messages:
    434
    Likes Received:
    34
    Location:
    Sydney
    I'll have that for you by Thursday.....probably just after lunch or earlier if I get some spare time ;)

    I strongly suspect this request would take a wholesale revision of the whole C-Bus logic structure and hardware as all logic units, Touch Screens, Front End software (Homegate & Schedule Plus), Clipsal Wiser, PAC etc use this logic.

    I agree with you that Pascal is somewhat 'structured' to use, especially when your program is not 'behaving' as you would expect, maybe after having not worked on a logic project for a while and just being rusty, but this could be said of any robust language.

    From a more 'incremental upgrade' perspective I would be happy just to see someone tweak the 'reported errors' a little bit as they are sometimes not very 'human friendly' particularly when programming late at night, reporting an unrelated error due to an overseen lack of a delimiter etc. ;-)

    A further avenue toward what you're suggesting could be something like the old BASIC to PASCAL converters / compilers. A VB/Visual Studio/Javascript (or some other programming / scripting language) to Clipsal 'PASCAL' converter may be a good thing.

    Just an idea really,

    Have a good one,

    Brad
     
    Last edited by a moderator: Oct 2, 2012
    bmerrick, Oct 2, 2012
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.