Software Engineering discussion
Code Complete
>
Layout and Style
date
newest »


Yes, MS Visual Studio has suggested format and will use it's intellisense feature to make formatting changes for curly brackets and other syntax structures. It's no fun to fight the IDE's suggested format, so I usually don't try to.
I have been writing and working with Quine programs in my "fun" time lately. If you search the internet for Quine code examples, they are some of the most unreadable code I've ever encountered. I think if I tried to write code formatted that way it would be littered with bugs. Those Quine's authors must be very tallented.
Wow, I didn't realize that Quine programming blossomed into such a big hobby!

I wrote a tool to automate the code-data synchronization tasks. I tried to make my Quine very OO rather than aiming for shorted code. I was using C# and .Net.
My quine compiles its clone and kicks it off in a new process, which makes for a fun endless loop (almost virus-like) effect.

if ( foo ) {
bar();
}
and no one should ever do this:
if ( foo )
{
bar();
}
(just kidding)
Although endlessly controversial in specifics, I think that proper (or at least consistent) formatting is crucial. I find that the best programmers also take care in how their code looks.
When teaching programming to people who are new to it, and when they bring me some code to look at for help, more often than not it is a visual mess. The first thing I tell them to do is run it through a pretty printer or lay it out cleanly by hand. Most times, after they do that, they can then find the bug themselves.
As an aside, I am reading this book in ePub format on an iPad, and the code listings are all fairly messed up with line wraps!