dmt: Python-like indentation in D programming language

uranuz neuranuz at gmail.com
Sat Nov 20 10:11:31 UTC 2021


On Wednesday, 17 November 2021 at 11:00:46 UTC, JN wrote:
> On Tuesday, 16 November 2021 at 21:58:24 UTC, Witold Baryluk 
> wrote:
>> Hi,
>>
>> `dmt` is an old project of mine from around year 2006. I 
>> ported it recently from D1 to D2, and added some extra 
>> features and support for extra keywords, and fixed few bugs 
>> here and there.
>>
>> `dmt` is a converter (offline or auto-invoking compiler after 
>> conversion) from Python-like indention style to curly braces 
>> for D programming language.
>>
>
> I love the idea. Never been a fan of braces to define blocks 
> and I find them to be much more of a pain to match than 
> whitespace. These days however, I just set dfmt to autorun on 
> file save and never worry about formatting again.

I am programming in Python mostly on my job and sometimes in C++ 
and JavaScript. Personally I like syntax with braces to define 
blocks more that Python's syntax without blocks.
One of the reasons - why?1 Is that very often when I copy-paste 
some fragments of code then some editors sometimes just tries to 
autoindent programme and does it wrong. Then it breaks entirely 
and I get some errors from production just because of this.
And just for aestetic reasons I like when blocks are explicitly 
delimitered by braces.
Syntax with braces also allows write "one-liners" easier when 
it's needed.
So personall I shall not use this in D


More information about the Digitalmars-d-announce mailing list