Code Beautifer Resources

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Code Beautifer Resources

Post by alex.barylski »

http://www.prettyprinter.de/index.php
http://en.wikipedia.org/wiki/Prettyprint - Haven't tried any but it's lengthly

It's not perfect, but it's online which is nice... :P

I would hate to download an application for such un-essential task, but yet, so frequently we as developers are forced to either manually reformat the code to our own standards or run a beautifer...

Personally I could never be bothered to install YAA (Yet Another Application) for such a one off task, but online resources...now that makes sense...

Anyone know of any others for our supporting languages???

HTML/Javascript/PHP/CSS I think would be a good general coverage. Maybe SQL too.

I figure if we can all pool our resources, and build a list of online beautifers...we could make this a sticky as I'm sure you've all encountered this problem as well...

Maybe even post a downloadable version, but make sure it's quality, otherwise...there is no point :)

Your turn...go out there and google for web based beautifers and post those links here...

Cheers :)
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post by Todd_Z »

Gave it a little test whirl, not so impressed. For example, that "beautifier" would turn

Code: Select all

$var = "str {$var} str";
into a multilined madness
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

I never claimed they were perfect did I? :P

Besides it's experiemental...which is fine...cause even a little automation in beuatifying source code is a big help...

They are not easy to write...you should try it...it's quite a programming challenge ;)
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

That'd be handy for some of my old sites. Is there a one I can run against a batch of files (like.. 500 files..)?
User avatar
MrPotatoes
Forum Regular
Posts: 617
Joined: Wed May 24, 2006 6:42 am

Post by MrPotatoes »

no doubt. hell, if there is a desktop version (faster and better IMO) that would be great.
shoot, i'm thinking of making one sometime next week on my off time :D
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

The only problem I see with using a dekstop version...

You'd be more likely to have to beautifier run on production code...if there is a bug...which is possible considering most desktop apps are done in C++ which is likely to yeild more buggy code, depending on the developer, compiler, IDE, etc...

You'd be screwed if it chewed your source and you had no backups... :P

By virtue of the fact it's more difficult to develope desktop applications...it would also likely be less flexible...

Server Side is the way to go IMHO :)
User avatar
MrPotatoes
Forum Regular
Posts: 617
Joined: Wed May 24, 2006 6:42 am

Post by MrPotatoes »

wtf are you talking about? are you serious?

if you don't understand to have a backup of your work you shouldn't be working professionaly. period.

REGARDLESS of serverside or desktop there will always be bugs. how many times has PHPBB2 needed to be security fixed? that isn't a bug it's a feature?

C++ more buggy code? this completely dumbfounded me. you HAVE to be kidding. sorry man but i'd hate to flame but that comment is completely asinine. it's like saying that reading books is more prone to paper cuts so have a bok read to you
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

Post by pedrotuga »

i remember visualstudio had a keyboard shortcut to auto-indent the code back when i used it.

but this things... i don't know... the time when its more necessary to have the code beautifier is when you are actually writing it... if you dont have it correctly idented then... i don't know.

I guess its not a critical tool, i took at my code and it need no identation.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

MrPotatoes wrote:wtf are you talking about? are you serious?

if you don't understand to have a backup of your work you shouldn't be working professionaly. period.

REGARDLESS of serverside or desktop there will always be bugs. how many times has PHPBB2 needed to be security fixed? that isn't a bug it's a feature?

C++ more buggy code? this completely dumbfounded me. you HAVE to be kidding. sorry man but i'd hate to flame but that comment is completely asinine. it's like saying that reading books is more prone to paper cuts so have a bok read to you
a. Your right...I've been at this longer than you've been alive...I'm ready for retirement I think :P I retract that comment incase your like 50 or something :P

I was simply hinting at the fact that as developers, like in any profession, we sometimes become complacent with unlimited undo's and if by chance you beautified an entire source tree (with buggy software) and *forgot* to backup...you'd have a very frustrated few moments... :P
REGARDLESS of serverside or desktop there will always be bugs. how many times has PHPBB2 needed to be security fixed? that isn't a bug it's a feature
My software never has bugs in it :P I'm perfect
C++ more buggy code? this completely dumbfounded me. you HAVE to be kidding. sorry man but i'd hate to flame but that comment is completely asinine. it's like saying that reading books is more prone to paper cuts so have a bok read to you
C++ the language itself is *not* the culprit...but the developers themselves.

I've programmed in C++ for over 10 years...in almost every GUI library available today...I've stared at probably hundreds of thousands of lines of source code and played with even more. I've seen more buggy software in C++ by it's complicated nature and more house work being required.

The language is not what is buggy...in fact it's probably the most stable well known, well understood language both in terms of expressing oneself and in terms of compiler design. It's complicated to program in and is common knowledge to most professional C++ developers they will likely encounter bugs in even small source code bases (depending on their origin and maturity of course).

Like Murphy's Law suggests: "If anything can go wrong it will"

So I'm afraid...my friend...with complexity, comes more complexity...I think your to accustomed to PHP handling the dirty work for you.... ;)

Cheers :)
User avatar
MrPotatoes
Forum Regular
Posts: 617
Joined: Wed May 24, 2006 6:42 am

Post by MrPotatoes »

as long as we are at terms. you sounded like serverside is better than C++ or compiled languages

phew, i was questioning your sanity there for a min
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

IMHO there is no better language...I can program software in many...and I am slightly biased in favour towards C++ but I love PHP too.

Considering the circumstances...I would *personally* choose a web based solution is all I was saying :)

Cheers :)
Post Reply