Does anyone need code beautifier / formatter?

Let us know what you would like to see in the next version of this software

Moderator: kfury77

Forum rules
Please follow these guidelines when posting feature requests. This will help to increase the value of your contribution.
  • Do not create new topics for already requested features. Add your comments to the existing feature request topics instead;
  • Create separate topic for each feature suggestion. Do NOT post a number of non-related feature suggestions in a single topic;
  • Give your topic a meaningful title. Do NOT create topics with meaningless titles, such as "My Suggestion" or "My Problem".
Please note that we DO READ all suggestions, even if a reply is not posted. Thanks!

Would you use code beautifier?

Yes, mainly for HTML
14
13%
Yes, mainly for CSS
4
4%
Yes, mainly for PHP
17
16%
Yes, mainly for JavaScript
1
1%
Yes, for all web languages
51
48%
Very rarely
6
6%
No, better implement other features
13
12%
 
Total votes: 106

User avatar
Karlis
Site Admin
Posts: 3605
Joined: Mon Jul 15, 2002 5:24 pm
Location: Riga, Latvia, Europe
Contact:

Does anyone need code beautifier / formatter?

Post by Karlis »

We are currently thinking about implementing code beautifier for HTML, CSS, JavaScript and PHP.

It would be basic code beautifier/formatter which would allow you to automatically re-format your code according to your prefferred style.
Karlis Blumentals
Blumentals Software
www.blumentals.net
Guest

Post by Guest »

no. how about you work on other features first.
like formatting the <P> as we like, etc.
Ken Comer

beauty is in the eye of the beholder

Post by Ken Comer »

I keep thinking that one of these days I am gonna write my own beautifier. I have my own quirky style of line separation:

longFunctionName(
$arg1
,$arg2
,$arg3
);

is an example. It makes a lot of sense to me because you can never get confused about which part the line was separated at and what's going on. There is no chance of being confused by a long line and an autowrap. Another:

$ternaryFormat = ( $condition )
? $ifTrue
: $else;

echo "lots of stuff lots of stuff lots of stuff lots of stuff lots of stuff"
. "lots of stuff lots of stuff lots of stuff lots of stuff ";

The important features are:
* long lines are indented one step
* function calls with long argument lists are indented two steps for the
start of each argument, one step if an argument somehow gets long
enough to wrap.
* an operator or "punctuation" grammar element begins any line except

As you can see, I am gonna want to have something very pretty TO ME, and it probably won't match up to any non-OCD coder. Being able to go back and forth between my style and anyone else's would be FANTASTIC. Being able to beautify into anyone else's style WITHOUT being able to go back frankly would be useless to me.

I suspect that, among the beautify users, I am not alone in my quirky preferences. If I can't configure it to make the result I prefer, I don't want it. I suggest that you could more profitably spend your time on other features.

I may be wrong. It has happened before.
Bendis
Posts: 35
Joined: Mon Jun 06, 2005 1:10 pm

Post by Bendis »

My co-workers use a different editor. When they edit a file, they "crash" my prefered source formating and add a lot of blank whitespace lines to the code. I would like to remove this with a beautifier.

Also important for me:

An option to change

<p>
text
</p>

to

<p>text</p>

A good example for a beautifer is Dreamweaver's "Apply Source Formating" function.
printmkr
Posts: 24
Joined: Wed May 11, 2005 8:58 pm

Post by printmkr »

Yes, Dreamweaver's feature is a great example of what I would want in a beautifier. And yes, the important thing is to be able to use your own personal styles or quirks!
Bendis
Posts: 35
Joined: Mon Jun 06, 2005 1:10 pm

Post by Bendis »

printmkr wrote:Yes, Dreamweaver's feature is a great example of what I would want in a beautifier.
There's also an Extension available for Dreamweaver called "format_source.mxp" that allows to format a whole project or site at once. That feature would be nice, but probably hard to develop.
User avatar
Karlis
Site Admin
Posts: 3605
Joined: Mon Jul 15, 2002 5:24 pm
Location: Riga, Latvia, Europe
Contact:

Post by Karlis »

I will look at the Dreamweaver. Ken has some good points too.

I believe everything can be done and your ideas are very helpful.

Please keep on posting our ideas regarding code beautifiers.
Karlis Blumentals
Blumentals Software
www.blumentals.net
gLes
Posts: 33
Joined: Sat Aug 27, 2005 6:01 pm
Location: Budapest, Hungary
Contact:

Post by gLes »

How about implementing a code compression setting too? :roll:

I mean it could also have an option to remove all unnecessary whitespace from the code thus reducing file size. :)

Or is HTML Tidy capable of this? :? Perhaps I overlooked it :lol:
purpleedge2004
Posts: 11
Joined: Fri Jun 24, 2005 1:41 am
Location: Sydney, Oz

A CSS beautifier would be nice

Post by purpleedge2004 »

I work with CSS and sometimes the properties are all on one line, a keep looking for the menu option to "Indent CSS" and get a result like I get with "Indent HTML"
Regards,
Purple
donull
Posts: 17
Joined: Fri Oct 14, 2005 5:08 am

Post by donull »

Yeah this could be usefull... :D

Please note: I voted for PHP, but i meant to vote: All Web Languages ( my eyes skipped this option :shock: ). PHP & HTML are my favorites anyways :wink:
phper
Posts: 10
Joined: Sat Mar 25, 2006 7:22 am

Post by phper »

I tend to not like code formatters.. i have some pretty strange quirks about formatting code. sometimes the "right" method of formatting and indentation doesn't look as good. I much prefer to format the code the way I want it.
HyrumR
Posts: 19
Joined: Fri Mar 10, 2006 5:49 pm

Post by HyrumR »

I'm with phper on this one, too. If I want beautiful code, I'll write it that way. :) (Of course my code is always beautiful :shock: )
Count Zero
Posts: 2
Joined: Wed Apr 05, 2006 10:12 pm

Post by Count Zero »

I think that code beautifier is necessary tool for Rapid PHP. I used another PHP editor, but it does not format JavaScript code, only PHP... So, now I'm looking for code editor that can format JavaScript.
kokoglen
Posts: 12
Joined: Mon Apr 24, 2006 6:29 pm
Location: CA
Contact:

Code Formatter

Post by kokoglen »

I liked the feature to remove trailing spaces, but I had to turn it off because I would do this:

<div class="blah">

</div>
And it would be tabbed properly, then I would go UP to the middle area and start typing, but the tabs would be gone already.

So it would be nice to have a code formatter to remove the traling spaces when I finished the page. Also, making sure the tabbing is correct would be nice.
jazzle
Posts: 7
Joined: Fri Jun 02, 2006 11:49 am

Post by jazzle »

although I voted "no, work on other features first" (FTP in particular), I'd like to say that IMHO indenting is probably the most important part of code-formatting, and so could be implemented separately.
Post Reply