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. 16 1892
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
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
> 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
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.
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
> <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
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.
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 :-)
> 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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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...
|
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...
|
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.
|
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
|
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...
| |
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.
|
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.
|
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)
|
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,...
|
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...
|
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...
| |
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,...
|
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...
|
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...
|
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();...
|
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
|
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...
| | |