Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7735437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:30:07+00:00 2026-06-01T07:30:07+00:00

I was thinking about the old holy war that is curly brace placement ,

  • 0

I was thinking about the old holy war that is curly brace placement, and decided that it really wasn’t so much an issue with programmers as an issue with the IDE.

Most C-style programming languages* support a mishmash of whatever spacing and alignment the programmer would like:

foo(bar, baz) {
  fizz();
  buzz();
}

is functionally identical to:

foo(bar, baz)
{
    fizz();
    buzz();
}

is functionally identical to:

foo(bar,baz){fizz();buzz();}

No one questions this, but programmers are still apt to disagree over the correct formatting.

Because it’s such a user preference, I thought it would be convenient if there was an IDE that would automatically re-flow the written code into the format specified by user preferences while leaving it as written:

foo
(
bar
,
baz
)
{
fizz();
buzz();
}

would be auto-formatted to look like:

foo(bar, baz)
{
    fizz();
    buzz();
}

or whatever your preference is, without changing the original code (or maybe auto converts it to a different format on save)…

And then I realized it’s not likely that I’ve got an original idea.

So the crux of the matter is whether this functionality already exists, and I simply haven’t found it, or whether it doesn’t exist and I need to make it.


* I typically write in JavaScript, CSS, C#, and PHP; obviously this would be useless for a language such as Python.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T07:30:09+00:00Added an answer on June 1, 2026 at 7:30 am

    They’re called (code) “formatters” or “beautifiers”, and there’s a bunch around, some even built into your favorite IDE(s).

    The biggest problem they suffer from is people that insist on microscopic formatting properties, and the almost religious-war disagreement among programmers on what good layout is. I call this the “art” problem: everybody likes his, and dislikes other’s tastes.

    Usually what this means is a that group can’t agree on a format, and so formatting doesn’t happen, and you end up with, well, badly formatted code. I personally find this astonishing; choosing nearly any style for an organization to use I think is a win because now everybody knows what to expect. Considering that programmers spend 50% of their time reading code, this seems to me like a serious waste.

    AStyle is widely used. It has lots of options so that even cranky people can kind of get the format they want.

    Most of these are based on ad hoc string hacking tricks.e.g., using regexps to find keywords and special syntax such as curly braces. Its pretty easy to build a basic formatter this way. To the extent that such string hacking doesn’t understand the language syntax perfectly (what if a curly brace is escaped in a string literal or some such), they can damage your code (usually by inserting a spurious syntax error, sometimes by breaking the code in more subtle ways), so it is important after formatting to recompile and verify the formatted module.

    My company makes an unusual variety of formatters for programming languages based on parsing and regenerating the language text. These tools have the property that they can’t break your code (unless we’ve made an error in building our parser front ends, which is a lot less likely than somebody with a regular expression). So you can run them across your complete code base without fear of breaking anything.

    We tend to have fewer options than Astyle, although many of these will let you place braces (if important in that language, e.g., PHP or Java) in various “typical” places. But even braceless langauges such as Python can have layout rules about things other than braces, such as how to indent compound conditional expressions, etc. Our tools usually have these.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Thinking about avoiding code replication, I got a question that catches me every time
Just thinking about the best way to build an Order form that would (from
I am thinking about making a program that will need to send input and
Thinking about if we modify the definition of Hamiltonian path as we need to
Im thinking about to use a DB for my logs instead of a normal
Im thinking about building an application on our website to track order places through
Been thinking about this for hours now. Im building a simple slideshow application, where
Im thinking about learn to develop app for iOS. I had a lot of
I'm thinking about writing a FLAC to ALAC and/or FLAC to AAC converter, probably
We have a lot of old legacy Perl scripts that connect to a MS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.