|
Patrick Sears wrote: enforced formatting in Visual Studio
SAY WHAT?
Does Visual Studio 2005 enforce its own formatting rules?
Where's my sledge hammmer...
Software Zen: delete this;
|
|
|
|
|
Actually, it does! I always like to leave one space after an opening '(' and before the closing ')' but VS always comes around and knocks it right off and even worse it actually adds one space before the opening '('! If you wrote this for example:
if( didItCheckOut )
It'd change it to this:
if (didItCheckOut)
But it does this only for C# and not for C++! Say, there's a subtle little signal in there: C++ folks know what they are doing and C# folks need to be told what they must do?!
|
|
|
|
|
Things like that can be set in Tools|Options|Text Editor|...
But my formatting isn't as rigid as that. One of my peeves is that I can't tell VS that empty braces, brackets, and parentheses should be scrunched up;
f ( x ) ;
f() ;
byte[] a = new byte [ 4 ] ;
|
|
|
|
|
Sounds a bit like the language detection in word, it still sucks in version 2007 and it probably will in the next ten versions.
No, I like it the way it is..
WM.
What about weapons of mass-construction?
"You can always try to smash it with a wrench to fix that. It might actually work" - WillemM
|
|
|
|
|
M i s t e r L i s t e r wrote: Which means the file could be stored like this:
if(1==x){int a = x++;}
Sounds good to me.
Plus, C# almost gets to the point where new-lines are unnecessary, I hope the next language reaches that point.
|
|
|
|
|
I always seem to end up working with code written by the three (3) people who "never bother doing any formatting?"
Grim (aka Toby) MCDBA, MCSD, MCP+SB
SELECT * FROM users WHERE clue IS NOT NULL
GO
(0 row(s) affected)
|
|
|
|
|
Same problem here, last week I had a piece of javascript without spaces, enters and any other proper formatting. Also all variable names were like a,b,c,d,x,y,z etc. That code was ready for the trashcan...
WM.
What about weapons of mass-construction?
"You can always try to smash it with a wrench to fix that. It might actually work" - WillemM
|
|
|
|
|
That is one I HATE. Had to work in someones code that
used single character var names. n, a, b, x, y etc.
In books and I will bet -- MOST code one reads
for (int i = 0; i < value; i++) {}
I never use "i" -- Always inx (or cnt or knt (etc))
for (int inx = 0; inx < value; inx++) {}
I NEVER use single character var names! Reason -- to hard
to search for. I can type! the difference between "i" and "inx"
is not that great and is so much easer to find my index if
I need to.
WedgeSoft
|
|
|
|
|
I hate it when people always capitalize their Html, CSS and other web tags. It really gets annoying, and it's really hard to read.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
If I'm working on someone else's code then I will respect their formatting styles, but otherwise I am very strict with my formatting (close to the convention on idesign.net[^]). It is not just with code either, I always strictly format HTML/XML etc, and even normal text. Periods (full stops) in documentation (and this message) are always followed by two spaces, even though web browsers won't display them. Organisation of files within projects and members within classes also follows strictly applied formatting rules.
People who work with me usually claim I am pedantic, but to be honest I find it saves time in the long run by getting it right to start with: I've never had a situation where someone has needed to reformat my code to understand it.
|
|
|
|
|
David Wulff wrote: it saves time in the long run by getting it right to start with
So true of nearly everything...
"...a photo album is like Life, but flat and stuck to pages." - Shog9
|
|
|
|
|
David Wulff wrote: Periods (full stops) in documentation (and this message) are always followed by two spaces,
Phew, I'm not alone!
|
|
|
|
|
|
You just described me to a T. Everything I do is obsessively organized. Music? Artist -> Album > Songs. Code? I can't stand a line of code misaligned by a single space. Spelling? Don't get me started.
David Wulff wrote: Periods (full stops) in documentation (and this message) are always followed by two spaces, even though web browsers won't display them.
Why two? I've always used a single space, because that's how I see it everywhere.
Cheers,
Vikram.
"Life isn't fair, and the world is full of unscrupulous characters. There are things worth fighting for, killing for and dying for, but it's a really small list. Chalk it up to experience, let it go, and move on to the next positive experience in your life." - Christopher Duncan.
|
|
|
|
|
Vikram A Punathambekar wrote: I've always used a single space, because that's how I see it everywhere
That's because web browsers don't display it properly.
Traditionally you would use two spaces after a period when typing a letter on a typewriter as it used fixed-width letters and symbols with the period positioned in the centre of its block. It has carried over to modern print and electronic writing because it makes text easier to read, especially when faced with a large block of text (for example, a letter or a contract).
It is not as necessary as it was thanks to the much better fonts we have now, but with some fonts it can still make quite the difference. I do it here even though no one ever sees the difference because the message editing textarea uses a fixed-width font. Two spaces makes it much easier for me to proofread.
As an example, try opening a large text document and replacing all the single period spaces with doubles, then see how much easier it is to skim read.
|
|
|
|
|
David Wulff wrote: That's because web browsers don't display it properly.
I was mainly referring to books.
David Wulff wrote: As an example, try opening a large text document and replacing all the single period spaces with doubles, then see how much easier it is to skim read.
Hmm... it doesn't appear any easier, but the extra spaces kinda stick out and are actually ungainly. Maybe that's because I'm doing it for the first time.
Cheers,
Vikram.
"...we are disempowered to cultivate in their communities an inclination to assimilate to our culture." - Stan Shannon.
|
|
|
|
|
Vikram A Punathambekar wrote: I was mainly referring to books.
You will find that most books, especially novels, do still use double spacing after periods. It may not be as obvious as it is with fixed-width fonts, but if you compare the gaps with those following commas you will see they are wider. Most magazines seem to be the same too. It's purpose is to help you quickly skim read back to the place you left the story when you last put it down by helping you jump between sentences.
That said, I have noticed some technology books don't do this anymore, such as product manuals and books authored by developers. It's a shame because it makes it a lot harder for me to read them. Likewise, many people fail to use paragraphs correctly anymore, even in professional writing. I believe this is one of the reasons why Word 2007 introduced the one-break pargraph by default, instead of having to enter two breaks.
Don't feel too bad about it, you are a member of the growing majority and if it works well for you then there isn't a problem. Eventually the practise will die for convienience. People just don't care about writen communication any more, double-spacing is the least of our problems when four out of ten of our primary school leavers are unable to even use full stops (periods) in the first place. Pupils 'unable to use full stops'[^]
Vikram A Punathambekar wrote: the extra spaces kinda stick out and are actually ungainly
I wrote this message with double spaces, how far did you get before noticing it?
|
|
|
|
|
David Wulff wrote: I wrote this message with double spaces, how far did you get before noticing it?
The end of sentence one...
If two spaces after a full stop is good enough for LaTeX, it's good enough for me.
|
|
|
|
|
Count me out of the 'I don't care about written communication' group. I cringe when I see native English speakers write things like "Your right, it's cool" or "I could of told you that".
David Wulff wrote: Eventually the practise will die for convienience. People just don't care about writen communication any more
Sometimes, Dave... [Vikram munches on a carrot] I think you go too far trying to prove your point.
Cheers,
Vikram.
"...we are disempowered to cultivate in their communities an inclination to assimilate to our culture." - Stan Shannon.
|
|
|
|
|
There's always one.
|
|
|
|
|
Vikram A Punathambekar wrote: Music? Artist -> Album > Songs
Slacker, that should be Genre -> Artist -> Album -> Songs
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
I'm seriously considering using Language as a root, which will contain different artists in subfolders. I can count 5 languages that I regularly listen to.
I don't really care for the genre. I fill in the Genre tag in the MP3s, but that's about it.
Cheers,
Vikram.
"...we are disempowered to cultivate in their communities an inclination to assimilate to our culture." - Stan Shannon.
|
|
|
|
|
Vikram A Punathambekar wrote: can count 5 languages that I regularly listen to.
5 Languages? I can bearly sign along with the one language I know
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
David Wulff wrote: on idesign.net[^]).
Wow. There's some good resources there!
Marc
Thyme In The CountryPeople are just notoriously impossible. --DavidCrow There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith
|
|
|
|
|
Most of them have built if functionality to do the reformatting of your source for you. So as long as you setup a proper standard, every time you press the little button "reformat source" its prefect
Ok seriously, ya I have to have it perfectly aligned. This also includes how many characters per row. Unfortunately languages like C# and Java tend to deliver much longer characters per line than lets say C++.
|
|
|
|