473,806 Members | 2,607 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Whidbey: Hopefully to implement alternativ code layouts in C#

I've just read about the new Whidbey, which I think gives great features to
the programmer.

The HTML editor comes with a bunch of great formatting options. It'd be
great if C# would get some of these options, too. I, for example, prefer to
write code using indented braces, like:

byte x()
{byte i=1;

if (y(i))
{i+=1;
z(i);}

return i<<1;}

and would quite appreciate if C# supported this kind of formatting when
automatically reformatting my code.
Nov 15 '05 #1
9 1356
Axel Dahmen <NO*****@NoOneK nows.de> wrote:
I've just read about the new Whidbey, which I think gives great features to
the programmer.

The HTML editor comes with a bunch of great formatting options. It'd be
great if C# would get some of these options, too. I, for example, prefer to
write code using indented braces, like:

byte x()
{byte i=1;

if (y(i))
{i+=1;
z(i);}

return i<<1;}

and would quite appreciate if C# supported this kind of formatting when
automatically reformatting my code.


I very much doubt that that'll be an option, simply because it's not a
commonly used formatting style - I don't recall ever seeing anyone use
it for any of Java, C, C++ or C#. I'm sure there are other programmers
out there who use it, but probably not enough to make it worth MS
spending the time implementing a formatting style for their/your
benefit.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #2

"Axel Dahmen" <NO*****@NoOneK nows.de> wrote in message
news:uQ******** ******@TK2MSFTN GP12.phx.gbl...
I've just read about the new Whidbey, which I think gives great features to the programmer.

The HTML editor comes with a bunch of great formatting options. It'd be
great if C# would get some of these options, too. I, for example, prefer to write code using indented braces, like:

byte x()
{byte i=1;

if (y(i))
{i+=1;
z(i);}

return i<<1;}

and would quite appreciate if C# supported this kind of formatting when
automatically reformatting my code.


That has got to be the worst coding style I have ever seen. Let's be
frank... if you were to present this as your sample code at a job interview
with me, I would immediately show you the quickest way to the back door...

byte x()
{
byte i = 0;

if (y(i))
{
i += 1;
z(i);
}

return i << 1;
}

That is the correct style, and promotes the concept of easy identifiable
code blocks by aligning the opening and closing braces... though I would
grudgingly accept the following (with a signed letter of intent to change to
the above format for continued gainful employment):

byte x() {
byte i = 0;

if (y(i)) {
i += 1;
z(i);
}

return i << 1;
}

Why people insist on saving one line of code in favor of far more difficult
code readability and maintenance? I have no idea.
Nov 15 '05 #3
On Thu, 30 Oct 2003 22:58:00 -0500, "The Posting One"
<fe*****@blah.c om> wrote:
Why people insist on saving one line of code in favor of far more difficult
code readability and maintenance? I have no idea.


Because they think this format makes the code MORE readable rather
than less, perchance? Saving "one line of code" per construct shows a
lot more code when you have ten constructs on a page, and the editor
only shows 25 lines or so at once. Less vertical whitespace also
means fewer visual disruptions, especially when the leading and
following statements are closely related (as they often are).

Of course this format is harder to read in the way YOU wrote it,
because you used too little indendation -- the standard is four
spaces, not two. Note that monitors are wider than they're high...
--
http://www.kynosarges.de
Nov 15 '05 #4
FYI:

This is a new feature, which microsoft plans to ship with
Whidbey.
You can have your own defined formatting style on your C#
code.
So it would be possible for Axel to format the code in his
own (ugly) way.

Sunil TG
-----Original Message-----
Axel Dahmen <NO*****@NoOneK nows.de> wrote:
I've just read about the new Whidbey, which I think gives great features to the programmer.

The HTML editor comes with a bunch of great formatting options. It'd be great if C# would get some of these options, too. I, for example, prefer to write code using indented braces, like:

byte x()
{byte i=1;

if (y(i))
{i+=1;
z(i);}

return i<<1;}

and would quite appreciate if C# supported this kind of formatting when automatically reformatting my code.
I very much doubt that that'll be an option, simply

because it's not acommonly used formatting style - I don't recall ever seeing anyone useit for any of Java, C, C++ or C#. I'm sure there are other programmersout there who use it, but probably not enough to make it worth MSspending the time implementing a formatting style for their/yourbenefit.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
.

Nov 15 '05 #5
Sunil TG <su*****@achaya ns.com> wrote:
This is a new feature, which microsoft plans to ship with
Whidbey.
You can have your own defined formatting style on your C#
code.
So it would be possible for Axel to format the code in his
own (ugly) way.


While I'm sure you can define your own formatting style to *some*
extent, I doubt that you'll have free reign to do *everything*. For
instance, Jalopy allows various different styles of Java formatting,
but I don't think it would provide a way of formatting to Alex's style
(without changing the code, anyway).

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #6
I perfectly agree with you, Christoph.

Got no more points to add here. Well, except for one sidekick regarding the
other style: I think it's mainly used by examples and therefore by beginners
until they evolve the other style for the reasons mentioned by you. Got the
same discussion running back at my job.

---------
"Christoph Nahr" <ch************ @kynosarges.de> schrieb im Newsbeitrag
news:7p******** *************** *********@4ax.c om...
On Thu, 30 Oct 2003 22:58:00 -0500, "The Posting One"
<fe*****@blah.c om> wrote:
Why people insist on saving one line of code in favor of far more difficultcode readability and maintenance? I have no idea.


Because they think this format makes the code MORE readable rather
than less, perchance? Saving "one line of code" per construct shows a
lot more code when you have ten constructs on a page, and the editor
only shows 25 lines or so at once. Less vertical whitespace also
means fewer visual disruptions, especially when the leading and
following statements are closely related (as they often are).

Of course this format is harder to read in the way YOU wrote it,
because you used too little indendation -- the standard is four
spaces, not two. Note that monitors are wider than they're high...
--
http://www.kynosarges.de

Nov 15 '05 #7
I think that's rather short sided. The logic of the code is what dictates
it's value more than anything else. Let's say that Windows was written with
that formatting, there'd be a bunch of talented programmers unemployed if
you were Bill Gates and the OS would work exactly the same.

I think you're are being a little unnecessarily hard on the guy because if
he wants to format it a certain way so be it. There's no coding format
rules that I have come across although there are guidelines. And provided
he comments his code (something wayyyy to few programmers do) adequately, it
Will be readable.
"The Posting One" <fe*****@blah.c om> wrote in message
news:Or******** ******@TK2MSFTN GP12.phx.gbl...

"Axel Dahmen" <NO*****@NoOneK nows.de> wrote in message
news:uQ******** ******@TK2MSFTN GP12.phx.gbl...
I've just read about the new Whidbey, which I think gives great features to
the programmer.

The HTML editor comes with a bunch of great formatting options. It'd be
great if C# would get some of these options, too. I, for example, prefer

to
write code using indented braces, like:

byte x()
{byte i=1;

if (y(i))
{i+=1;
z(i);}

return i<<1;}

and would quite appreciate if C# supported this kind of formatting when
automatically reformatting my code.


That has got to be the worst coding style I have ever seen. Let's be
frank... if you were to present this as your sample code at a job

interview with me, I would immediately show you the quickest way to the back door...

byte x()
{
byte i = 0;

if (y(i))
{
i += 1;
z(i);
}

return i << 1;
}

That is the correct style, and promotes the concept of easy identifiable
code blocks by aligning the opening and closing braces... though I would
grudgingly accept the following (with a signed letter of intent to change to the above format for continued gainful employment):

byte x() {
byte i = 0;

if (y(i)) {
i += 1;
z(i);
}

return i << 1;
}

Why people insist on saving one line of code in favor of far more difficult code readability and maintenance? I have no idea.

Nov 15 '05 #8
"The Posting One" <fe*****@blah.c om> wrote in message
news:Or******** ******@TK2MSFTN GP12.phx.gbl...
Why people insist on saving one line of code in favor of far more difficult code readability and maintenance? I have no idea.


Because my programming career started with learning from the first edition
of K&R C, which was the bible at the time. Been doing it that way ever
since (1985).

-- Alan
Nov 15 '05 #9
> The HTML editor comes with a bunch of great formatting options. It'd be
great if C# would get some of these options, too. I, for example, prefer to write code using indented braces, like:


You must be the only person that thinks the HTML editor provides "great
formatting options." :) VS.Net is quite possibly the only program I've ever
seen that will take perfectly correct and valid HTML and convert it into a
complete mess of random line breaks in addition to spewing out a mish-mash
of upper- and lower-case attributes that don't conform to any accepted
standards.

If the way it handles HTML is anything to go by, I'd appreciate VS.Net
keeping its grubby little paws off my C# code. I like my code to compile
thank you very much.

Colin
Nov 15 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
2461
by: Michael Rozdoba | last post by:
I'm far from a CSS expert, but what I see of it I really like & I love keeping content & style separate. I also hate the way table layout produces convoluted bulky code. However when asked why one should use CSS rather than tables, particularly when tables work & browser support of CSS can be dodgy, especially in IE, I usually fail to come up with a concise & convincing argument :/ I've been having this long running discussion with a...
1
1453
by: Scott | last post by:
Hello all, I've tried analyzing this one but can't figure it out. Hopefully someone will be able to help. I have installed VS 2005 beta on 2 machines with good luck. The 3rd machine is my nightmare. When I am working with a website, if I try to add anything new to the site itself, I get an error that says "Unable to perform operation, unspecified error." Well, that wasn't too helpful. So, I go to IIS only to find that the virtual...
48
2483
by: Arman Oganesian | last post by:
Just finished reading about upcoming features in 2004 version of VS.NET and C# in particular http://msdn.microsoft.com/vstudio/productinfo/roadmap.aspx# whidbey Looks good and I am very happy (about generics, split types...), Except 1 thing Microsoft is reintroducing the "Edit and continue" future for VB.NET ONLY???? The "Edit and Continue" functionality in debugger is NOT about simplicity, but about having a modern and powerful
1
1463
by: Dan | last post by:
Is there any way to get Whidbey to build for, say, framework v1.1? Thanks in advance.
3
1207
by: Doug Holland | last post by:
Hi There I just installed the PDC build of Whidbey onto Windows XP using the 'Web Developer' profile when I installed and was a little surprised to see that it is only ASP.NET projects that I have available and now wishing I'd chosen 'C# Developer' which probably displays all project type ... how do I switch profiles in VS.NET Whidbey???? Secondly what happened to Microsoft telling us that code
0
1089
by: Wernfried Schwenkner | last post by:
I've tried a little bit with whodbey ASP.NET. If this is the wrong group to ask, then point me to the correkt one. In whidbey there are control for handling login. I've read about the MembershipProvider and MembershipUser classes. And there is an article how to implement an own ODBCMembershipProvider. So I thought based on this article to make my own XMLMembershipProvider. The MemebershipProvider has the ability to allow the user...
1
1094
by: Mukund Patel | last post by:
Hi Friends, I am working on asp.net in .net studio 2005 (Whidbey). I want to write trace in file in my web application. How to implement Diagnostics Trace features in Whidbey. I have written following code in web.config. But it says System.Diagnostics is not a valid child element. <system.diagnostics> <trace autoflush="true">
2
1586
by: Playmaker | last post by:
Hopefully someone else has come across this issue. What I have is a SQL Server 2000 back-end. I've created a simple webform which has both Gridview and DataList controls on it populated with a SqlDataSource. Okay, simple enough, that all works fine. I have also enabled inserting and editing on these controls. This is a very cool feature of 2.0 and it works quite well. Functionally I am able to do everything such as inserting and...
19
1100
by: Chris Dunaway | last post by:
Just got my hands on Whidbey. Here are a few interesting changes that you may not be aware of: 1. Continue statement on Do, For and While commands 2. Default Instances of certain classes are back (such as forms). 3. Properties can now have mixed access levels. For example you can declare a property like this:
0
9598
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10623
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10373
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9192
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5683
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3852
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.