3 Replies - 2779 Views - Last Post: 06 November 2012 - 11:37 AM

#1 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2247
  • View blog
  • Posts: 9,237
  • Joined: 18-February 07

Add AStyle (or similar) to DIC Code box?

Posted 12 August 2012 - 08:31 AM

Ok we can "pretty print" but having something that could auto-indent code would really be:

A. Nice
B. A differentiator (nobody else has this... at least that I have seen).

It may also help new programmers learn a proper indention style.

Ok I *KNOW* the no one would be able to agree on indention styles and people would be saying that their eyes bleed because of WHATEVER choice we made for a default indention style for a particular language... but in future upgrades you could maybe add customizations.

Is This A Good Question/Topic? 0
  • +

Replies To: Add AStyle (or similar) to DIC Code box?

#2 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4312
  • View blog
  • Posts: 7,467
  • Joined: 08-June 10

Re: Add AStyle (or similar) to DIC Code box?

Posted 13 August 2012 - 11:10 AM

I'm thinking that wouldn't work for languages like Python where indentation is significant.
Was This Post Helpful? 0
  • +
  • -

#3 Dogstopper  Icon User is offline

  • The Ninjaducky
  • member icon



Reputation: 2858
  • View blog
  • Posts: 10,963
  • Joined: 15-July 08

Re: Add AStyle (or similar) to DIC Code box?

Posted 28 August 2012 - 08:36 AM

That's why it needs to occur on a language by language level. If it doesn't make sense to indent, then there should be no correction. However, it seems like a good idea for languages like C, C++, and Java, ...
Was This Post Helpful? 0
  • +
  • -

#4 Xupicor  Icon User is offline

  • Nasal Demon
  • member icon

Reputation: 249
  • View blog
  • Posts: 582
  • Joined: 31-May 11

Re: Add AStyle (or similar) to DIC Code box?

Posted 06 November 2012 - 11:37 AM

I have mixed feelings about this, however - it might just be worth the risk.
Things I'd see as a must in v0.1 of this thing:
- incorporated into ''code'' tag, so ''[code style=STYLE]'' where STYLE could be e.g. "k&r", "1tbs", "allman", "gnu", etc. That style would be applied client-side, obviously. It would also mean that moderators could easily add a style to OP to show them how to indent code.
- it would need to have client-side "change style" feature, including "show original".
- it might be an idea to add "force style" to personal settings, however for this to make sense code box would need to know that its contents are in specific language (C, C++, Java,...), or only work in specific boards.

I'd vote on "let's experiment!", after all if we do that and it ends up as crap, we can just get rid of it, and know better next time. Unless "we" already do know better? ;)


And no, there would be no war over styles... I mean, come on, everybody knows the 1TBS is the best. :P
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1