Shop OBEX P1 Docs P2 Docs Learn Events
Tab stops and code highlighting — Parallax Forums

Tab stops and code highlighting

This discussion was created from comments split from: LCD_GRAPHICS_DRIVER (Clusso99) ILI9341.

Comments

  • evanhevanh Posts: 16,014
    edited 2024-07-15 23:50

    Von,
    On that note, I'll recommend changing the forum to use tab-stops of eight.
    This has two benefits:

    • Eight suits formatting of assembly much better than high-level-languages. And assembly doesn't have indentation to be sensitive to.
    • Because eight is not typical for HLL, it will more often show up bad combinations of tabs and spaces in posted source code.
  • @evanh said:
    Von,
    On that note, I'll recommend changing the forum to use tab-stops of eight.

    PLEASE DON'T !
    :#

  • @celtic3 Glad you solved it. These things are always a process of discovery !

    @evanh @"Christof Eb." No fear, that cannot be done within the available tools anyway :)

  • evanhevanh Posts: 16,014

    @"Christof Eb." said:

    @evanh said:
    Von,
    On that note, I'll recommend changing the forum to use tab-stops of eight.

    PLEASE DON'T !

    Because?
    I thought those were rather good reasons.

  • @evanh said:

    @"Christof Eb." said:

    @evanh said:
    Von,
    On that note, I'll recommend changing the forum to use tab-stops of eight.

    PLEASE DON'T !

    Because?
    I thought those were rather good reasons.

    Well, If you look at this forum only for ASSEMBLER SPIN1/SPIN2, then these might be good reasons. Unfortunately the forum software does also colour Forth code too the SPIN way. (It also converts * into some fancy formatting.)
    In my opinion it is a really bad concept to use something invisible (tab or space) to structure a language, so the proper solution would be to use in SPINx something like { } as in C. :-)

  • VonSzarvasVonSzarvas Posts: 3,473
    edited 2024-07-16 11:53

    @"Christof Eb." said:
    Unfortunately the forum software does also colour Forth code too the SPIN way.

    The forum uses https://highlightjs.org/ for syntax highlighting.

    If you/anyone would like other languages added, feel free to start a new thread and seek help to create, or attach, the language definition; I'd be happy to add it,- just I don't have the bandwidth to create it!

    I checked highlight, and they don't seem to have a ready baked Forth definition.

  • VonSzarvasVonSzarvas Posts: 3,473
    edited 2024-07-16 14:29

    Update! I've gone and created a new thread for such chatter !! :-)

    Anyone wish to contribute Forth (or any other) js language definition for highlightjs?? Attach here and I'll see about getting it installed.

  • evanhevanh Posts: 16,014

    @"Christof Eb." said:
    Well, If you look at this forum only for ASSEMBLER SPIN1/SPIN2, then these might be good reasons. Unfortunately the forum software does also colour Forth code too the SPIN way. (It also converts * into some fancy formatting.)
    In my opinion it is a really bad concept to use something invisible (tab or space) to structure a language, so the proper solution would be to use in SPINx something like { } as in C. :-)

    So you don't actually have anything against adjusting the value of the tab-stop then?

  • @evanh said:

    @"Christof Eb." said:
    Well, If you look at this forum only for ASSEMBLER SPIN1/SPIN2, then these might be good reasons. Unfortunately the forum software does also colour Forth code too the SPIN way. (It also converts * into some fancy formatting.)
    In my opinion it is a really bad concept to use something invisible (tab or space) to structure a language, so the proper solution would be to use in SPINx something like { } as in C. :-)

    So you don't actually have anything against adjusting the value of the tab-stop then?

    Well, I tried to point out, that in my opinion the real problem is the concept of SPINx. So this is the thing to change.

  • evanhevanh Posts: 16,014

    Python is the most popular language on the planet right now. They might have a counter-opinion on your point. ;)

  • @evanh said:
    Python is the most popular language on the planet right now. They might have a counter-opinion on your point. ;)

    We seem to agree, that the SPACE/TAB thingy is a trap, otherwise you would not have made your proposal. In my opinion Python tries to force students to write code with indentation for good readability. The popularity of Python comes from it's mighty libraries, which are written in C. Also it's interactive, so you can try out things fast. It is free!!! I doubt, that Python is loved by many for this trap. The other misconcept is the dynamic typing, which makes it so awfully slow. In EU politicians have banned light bulbs. It's a miracle, that a language with that efficiency is allowed to be teached....

  • evanhevanh Posts: 16,014

    Use of general computing tools has never tried to be efficient. Compiled bloatware is very much alive irrespective of the language used.

  • evanhevanh Posts: 16,014

    You're not entirely wrong, I saw the opportunity with the Spin indentation issue and took it. I do also have a motive myself, and it's the other point. It doesn't take long in reading the forums to know I enjoy working at the metal with Pasm2 ...
    Well, coding in assembly really fits well with tab-stops set to 8. It keeps the sources tidy with very little effort. Having cryptic looking mnemonics all lined up is a good way to keep clear to everyone reading it what is the instructions verses labels, variables and special purpose register names.

Sign In or Register to comment.