473,791 Members | 2,853 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IDesign C# coding std 1.81, topic 3.21

Hi

Topic 3.21 in <http://www.idesign.net/idesign/download/IDesign%20CShar p%20Coding%20St andard.zip> claims the following

"Release build should contain debug symbols

I wonder why. Doesn't this make the executable larger, and slower

Thanks
Tom.
Nov 16 '05 #1
16 1891
TT (Tom Tempelaere) <"=?Utf-8?B?VFQgKFRvbSB UZW1wZWxhZXJlKQ ==?=" <_N_
0SPA|/\|t*******@hotm ail.com|/\|APS0_N_>> wrote:
Topic 3.21 in
<http://www.idesign.net/idesign/downl...arp%20Coding%2
0Standard.zip> claims the following:

"Release build should contain debug symbols"

I wonder why. Doesn't this make the executable larger, and slower?


It's a shame it doesn't explain things, really.

Mind you, I have to wonder about the usefulness of it when I read:

<quote>
17. Maintain strict indentation
a) Use 3 spaces for indentation
b) Do not use tabs or non-standard indentation like 1, 2 or 4 spaces
</quote>

In what world is 4 spaces *less* standard than 3?

Similarly, separating all member variables from all properties isn't a
good idea, IMO (number 20). If a property is backed by a member in a
simple fashion, it makes sense to declare the two together.

(Still reading the rest...)

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
TT (Tom Tempelaere) <"=?Utf-8?B?VFQgKFRvbSB UZW1wZWxhZXJlKQ ==?=" <_N_
0SPA|/\|t*******@hotm ail.com|/\|APS0_N_>> wrote:
Indeed he doesn't explain things enough. A rationale per topic would
come in handy.
Yup - it would also make it easier to argue against specific points.
Personally, I use tabs, and each tab is 2 spaces. I haven't seen
anyone use 3 spaces. I have seen people using tabs with a tab being a
single space charachter. Plain ugly when you decide tab to be 2
spaces later on, because you can't see spaces from tabs when 1 tab ==
1 space.
I think I've seen *one* person use 3 spaces before, but it's hardly
standard. A lot of people use 4 spaces, however.
Perhaps he wishes to avoid code layout changes for people who decide
they do not wish a tab to be 2 spaces, but 3 or 4 spaces instead. I
don't know.


The argument of "tabs vs spaces" is a separate one from how much
indentation to use, of course. Personally I use spaces instead of tabs,
so that everyone will see the code in the same way. However, that's an
argument with lots of good reasons on both sides, and not one I
particularly want to get into here.

I don't even really want to comment on whether 3 is a good number of
spaces to use or not. It was the bizarre way that it implied that 3 was
a standard which stunned me.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #3
> 2.1.4
Every 5th Line should contain an Debug.Assert();
Oh my god!
2.3.5
Mark every Public and Protected method as virtual
Stupid.
2.5.55
Always provide a static constructor when providing static member variables
Why? Providing a static ctor means you will have no beforefieldinit set in
the class which means that on first
access of any field, *all* static fields are initialized. But what if I
require lazy initialisation?
2.5.60
Do not use "this"-reference unless you are invoking a ctor from another

ctor

He must be gone crazy. Some other people say you _always_ have to use this.

After reading this sosaid coding standard I created one rules for writers of
coding standards:

1.1.1
Never declare your personal preferences as official standard if over 50% of
other experts have another opinion.

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
Nov 16 '05 #4
Hi,

I'm 4-indent-space-maniac.
I think that 3 spaces of indent are used to kill using a tab character
that are usually visualised as 8 spaces.
There's no other common number other than 24 factor. So how many of Your
code has more than 7 indents?
Maybe it looks sily... but i don't see any other reason :)

Marcin
TT (Tom Tempelaere) <"=?Utf-8?B?VFQgKFRvbSB UZW1wZWxhZXJlKQ ==?=" <_N_
0SPA|/\|t*******@hotm ail.com|/\|APS0_N_>> wrote:
Indeed he doesn't explain things enough. A rationale per topic would
come in handy.

Yup - it would also make it easier to argue against specific points.

Personally, I use tabs, and each tab is 2 spaces. I haven't seen
anyone use 3 spaces. I have seen people using tabs with a tab being a
single space charachter. Plain ugly when you decide tab to be 2
spaces later on, because you can't see spaces from tabs when 1 tab ==
1 space.

I think I've seen *one* person use 3 spaces before, but it's hardly
standard. A lot of people use 4 spaces, however.

Perhaps he wishes to avoid code layout changes for people who decide
they do not wish a tab to be 2 spaces, but 3 or 4 spaces instead. I
don't know.

The argument of "tabs vs spaces" is a separate one from how much
indentation to use, of course. Personally I use spaces instead of tabs,
so that everyone will see the code in the same way. However, that's an
argument with lots of good reasons on both sides, and not one I
particularly want to get into here.

I don't even really want to comment on whether 3 is a good number of
spaces to use or not. It was the bizarre way that it implied that 3 was
a standard which stunned me.

Nov 16 '05 #5
codymanix <no************ ****@gmx.net> wrote:
2.3.5
Mark every Public and Protected method as virtual
Stupid.


Indeed, although I've been arguing about this with someone else in
another place. Seems very odd to me.
2.5.55
Always provide a static constructor when providing static member variables


Why? Providing a static ctor means you will have no beforefieldinit set in
the class which means that on first
access of any field, *all* static fields are initialized. But what if I
require lazy initialisation?


In fact, having a static constructor will probably end up giving you
lazier access - from what I've seen, the current CLR is likely to call
the type initializer when it first enters a method which uses any part
of the class.

Note that the idea of different static fields being initialized at
different times just isn't going to happen - there's only one type
initializer per type. (You could manually do it, of course, but that's
a different level from the type initialization one.)
2.5.60
Do not use "this"-reference unless you are invoking a ctor from another

ctor

He must be gone crazy. Some other people say you _always_ have to use this.


Indeed. I'm lazier - I say "Use this when you have to" and I use
variable names which mean that on constructors I usually have to.
Elsewhere I rarely end up using "this" - although there are times when
you want to use it for entirely different reasons, of course.
After reading this sosaid coding standard I created one rules for writers of
coding standards:

1.1.1
Never declare your personal preferences as official standard if over 50% of
other experts have another opinion.


:) Of course, it's very difficult to gauge that "50% of other experts".
Writing a "personal standard" seems to be a better bet, really. Maybe I
should have a go at doing that some time...

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #6
> <quote>
17. Maintain strict indentation
a) Use 3 spaces for indentation
b) Do not use tabs or non-standard indentation like 1, 2 or 4 spaces
</quote>

In what world is 4 spaces *less* standard than 3?


Probably in IDesign's world. I've always approached a coding standards
document as simply a way to make all the code in a particular shop or
project internally consistent. Many decisions have multiple correct choices
and the standards document simply states which correct choice will be used.
It would have been nice if the author had included a preamble to explain the
philosophy and purpose of the document.

Personally the number of spaces people choose for their tabs (as long as it
isn't 1) doesn't drive me nuts nearly as much as old-style ASP programmers
who write code like this:

if b = 1 THEN
' do something
end IF

Unfortunately, that isn't some contrived example. I've actually worked with
code like that (including the variable name 'b' which just happened to be a
global variable).

Colin
Nov 16 '05 #7
Hi CodyManix

----- codymanix wrote: ----
2.1.
Every 5th Line should contain an Debug.Assert()
Oh my god

He writes, "On average, ...". His intent is probably to encourage people to use Debug.Assert to check invariants. He should rephrase that suggestion
2.3.
Mark every Public and Protected method as virtua
Stupid

Indeed, I completely agree. IMHO it is a serious flaw in Java that every method is virtual by default. C# designers made the right decision not to make methods virtual by default
2.5.6
Do not use "this"-reference unless you are invoking a ctor from anothe

cto

He must be gone crazy. Some other people say you _always_ have to use this

Agreed, yet I don't think Juval has gone crazy (just check his books, they are good)

After reading this sosaid coding standard I created one rules for writers o
coding standards

1.1.
Never declare your personal preferences as official standard if over 50% o
other experts have another opinion

Juval never said that this is official, it is the IDesign C# coding standard. It reflects his personal opinions, nothing else. Some are good, others are questionable

-
cod

Freeware Tools, Games and Humou
http://www.deutronium.de.vu || http://www.deutronium.t

Tom Tempelaere.
Nov 16 '05 #8
Jon Skeet [C# MVP] wrote:
[...]
Writing a "personal standard" seems to be a better bet, really. Maybe I
should have a go at doing that some time...


I'd be interested to read it :-)
Nov 16 '05 #9
> In fact, having a static constructor will probably end up giving you
lazier access - from what I've seen, the current CLR is likely to call
the type initializer when it first enters a method which uses any part
of the class.

Note that the idea of different static fields being initialized at
different times just isn't going to happen - there's only one type
initializer per type.
Now I understand. Beforefieldinit does not mean to initialize only fields
that have been accessed but instead
means nothing other than "The system is allowed to call the class
initializer before the first field of that class is accessed"
2.5.60
Do not use "this"-reference unless you are invoking a ctor from
another ctor
He must be gone crazy. Some other people say you _always_ have to use

this.
Indeed. I'm lazier - I say "Use this when you have to" and I use
variable names which mean that on constructors I usually have to.
Elsewhere I rarely end up using "this" - although there are times when
you want to use it for entirely different reasons, of course.


But he is consistent is his Standard. If one always use m_* to mark member
variables,
using "this" is never neccessary. I very often use "this" because of
intellisense so I do not have to type in the "long descriptive names" :)

But I was always wondering why they doesn't have introduced a symbol instead
of "this". $ or @ or ven # would be great.

class Numba
{
int n;
public void Numba(int n)
{
@n=n;
}
}

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
Nov 16 '05 #10

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

Similar topics

8
1679
by: Bruno R. Dias | last post by:
Perhaps it would be interesting to program a virtual machine simulating an ancient computer (such as the pdp-7). Then, it would be rather interesting to code for it (porting gcc to it maybe?). I think it would be fun to play with the long-forgotten art of coding in machine language. And what about a fictional computer, such as one that works on an entirely different way (such as a non-binary computer)? It wouldn't be very useful, but...
55
5192
by: Jonas Smithson | last post by:
I've seen a few attractive multi-column sites whose geometry is based on pure CSS-P, but they're what you might call "code afficionado" sites, where the subject matter of the site is "coding practices." (One example of this is alistapart.com.) However, the project/development realities for small boutique sites are completely different from those of large commercial or institutional sites -- and I was curious to see what coding approaches...
2
1588
by: Leveridge Systems INC | last post by:
We're in desperate need of contract help for c++/ linux or Unix based talent. 6 month need .. we have budget for a serious coder.. so the dollars are there. anyways.. may be of help to a group member of friend cheers John.
4
3081
by: Mikkel christensen | last post by:
Hi there I wonder if any of you could point me in a direction where I can find some usefull information about coding standarts. I have some generel experiense in programming but I lack many things specific to C++. One thing that causes me many troubles is how to properly nest "#include 'filename'" statements in combination with the "#pragma once" directive and
144
6976
by: Natt Serrasalmus | last post by:
After years of operating without any coding standards whatsoever, the company that I recently started working for has decided that it might be a good idea to have some. I'm involved in this initiative. Typically I find that coding standards are written by some guy in the company who has a way of coding that he likes and then tries to force everybody else to write code the way he likes it, not for any rational reason, but simply for the...
16
342
by: TT (Tom Tempelaere) | last post by:
Hi Topic 3.21 in <http://www.idesign.net/idesign/download/IDesign%20CSharp%20Coding%20Standard.zip> claims the following "Release build should contain debug symbols I wonder why. Doesn't this make the executable larger, and slower Thanks Tom.
50
4745
by: Konrad Palczynski | last post by:
I am looking for tool to validate conformity to defined coding standard. I have already found Parasoft's C++ Test, but it is quite expensive. Is there any Open Source alternative? I do not need GUI, fancy reports nor predefined sets of rules.
2
1426
by: editormt | last post by:
A recent poll asked if programming standards are used by development organisations... and if they are controlled. None: 20% Yes, but without control: 49% Yes, with control: 31% Participants: 369 Source: Methods & Tools (http://www.methodsandtools.com)
0
10207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10154
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
9993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
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...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4109
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
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.