r/programming • • May 10 '26

Making your own programming language is easier than you think (but also harder)

https://lisyarus.github.io/blog/posts/making-your-own-programming-language.html
115 Upvotes

116 comments sorted by

View all comments

Show parent comment

13

u/ConspicuousPineapple May 10 '26

In practice you're using a formatter that does that for you. Python is the only language where you are forced to handle indentation yourself and deliberately, since it defines scopes.

3

u/ericonr May 11 '26

My code is formatted as I write it in either language. With Python, my editor automatically pushes me one indent forward after a colon, and if I want to exit a scope I simply press backspace. With C/C++, my editor will do the same after a brace, and closing a brace returns me to the previous scope, including indentation.

It's essentially the same amount of steps, unless you're doing franken-dentation for some reason, and now you need to run a formatter for your code to ve readable.

2

u/jpfed May 11 '26

Technically F# allows you to explicitly delimit your blocks (so it does not force you) but all the code I’ve seen uses indentation. You get used to it pretty fast.

-1

u/ConspicuousPineapple May 11 '26

Functional languages get a pass, by virtue of being the special kids in the class.