On Thu, Aug 24, 2006 at 02:59:31PM +0200, Kyrre Nyg?rd wrote:
> Hello people,
> 
> I'm looking for the best ways to create a line of code beautification 
> (reformatting) scripts -- one for C, one for Ruby, one for Bash and 
> one for web development languages like XHTML, XML, CSS, PHP and Ajax. 
> Whether as frontline warriors or household maids, they would ensure 
> proper indentation, linebreaks, spaces, tabs and so forth.

Why create when they already exist?

> Can anybody help me?
> 
> My studies of architectural science has taught me to pay extreme care 
> to the correction of details, and I now wish to apply these teachings 
> to all my code. I find myself always reformatting whatever my 
> associates give me. Not that they're bad programmers, they just care 
> more about the code itself rather than its structure, and I dare not 
> argue with that. When their code is messy, however, my heart feels 
> messy and I can't get any sleep.

While I, too, like neat code, it really isn't too difficult to run stuff
through indent(1) or similar.

> I wish to be in full control of my code beautifiers. That is, I wish 
> to have them as simple and meaningful as possible. Give me an easy 
> Bash over a complex Ruby any day.
> 
> There's a lot of messed up tools out there. Companies with flashy 
> websites just doing this for the money.

Well, that's what a company is for.

> So apart from the bullshit, 
> I've managed to spot out the Ruby Beautifier and GNU Indent as two 
> worthy code beautifiers. However I get the feeling they are more 
> complex than they ought to be, and if less is more, my search will 
> have to continue.

Okay... but where's the question? Even in the ports tree, I see
devel/astyle (C, C++, Java), devel/gindent (GNU indent), and
devel/perltidy (for Perl, obviously). There's also www/tidy for HTML and
such, though I don't think it does PHP well. (And what the heck is Ajax
in this context? Do you, perhaps, mean javascript?)

True, it looks like you'd have to make your own port for that Ruby
beautifier... and I have no clue about how complex these utilities might
be, but I can personally testify that www/tidy and indent(1) can be
pretty useful.

                Joachim

Reply via email to