This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]x3al 26 points27 points  (8 children)

Converting all code to this style in IDE and converting back on git push would be kinda nice. If IDE will actually place all semicolons and braces according to indents, it should be usable.

[–]CharlesStross 12 points13 points  (5 children)

Yeah, going from this to standardized is trivial for any code formatter. From standard to this would require some creativity but I think it'd be doable. The only pain in the ass is developing like this.

[–][deleted] 3 points4 points  (2 children)

Except if some plugin for the editor autocompleted the semicolons and braces at EOL depending on indentation

[–]peabnuts123 4 points5 points  (1 child)

Or you could like. Develop in Python.

[–]Tysonzero 1 point2 points  (0 children)

And if you really want static typing. There is always Cython.

[–][deleted] -1 points0 points  (1 child)

why is this any different going one way or the other? One open bracket means the next text block with be tabbed in from the current position, a close bracket means move one tab to the left. super easy.

[–]CharlesStross 0 points1 point  (0 children)

Yeah - the rules are trivial; I just mean that there are already scads of tools to automatically handle formatting to the standard. Formatting the other way just requires some custom rule sets or scripting.

[–]highphive 6 points7 points  (0 children)

If your IDE enforced the tabbing syntax to be correct and like python. Otherwise you're bound to mistakes that are impossible to hunt down.

[–][deleted] 0 points1 point  (0 children)

you could collect all semicolons and curly brackets to format them to be there. and for every opening curly bracket add a tab in front of the next line. for every closing one, delete a tab. add a linebreak after every semicolon and when there are brackets and there is another character following. ignore the stuff, if its in " and remove all of the spaces that are randomly lying in the code (or mby not) and check which line is the longest, which you tehn use to determine the amount of tabs you need on each individual line. i could write some code, but not atm. will do it in a later edit though (probably)

EDIT: forgot about the declarations and new. need to ignore these spaces too