|
I found writing codes in C#/VB.NET/VC.NET do need to use #region and #endregion.
I like the way it organizes/hides the codes that I don't need to see.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
I uses the XML /// comment
and C++ comment /* and // at the same time.
cause these two serve on different purposes.
The XML /// Serve as the explanation of my function. Stuff like pre-condition, post-condition, returns, parameters pass in etc
/* and // are use in explaining some of my codes in my functions.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
This is just my two cents... but doesn't anybody see something intrinsically wrong with the direction .net is going...
I mean it's great and all to be able to code in VB, C#, Cobol, Fortran and whatever other language you can dream up all in the same application...
but...
what good is that if you don't know the language a defect is found in and your "expert" that did the coding left the company ?
There you sit high and dry... debugging something that throws and exception and then quits... so you have no idea what the code does or how it does it?
Comments will help out a little... but I think the bigger picture here is "left over hash". Applications that have a little of this and a little of that from different languages...
Does anybody else have any insights?
|
|
|
|
|
Anonymous wrote:
but...
what good is that if you don't know the language a defect is found in and your "expert" that did the coding left the company ?
It isn't any more likely that this would happen w/.NET than any other platform.
This wouldn't happen unless the company decided to code their application in many different languages, in which case, they're taking that risk. Besides, even today, there are a number of different apps that are coded in, for example, both C++ and VB, interacting using COM.
Also, since the framework is the same for all those languages, it's much easier to learn the languages. And we can choose the right tool for the job w/o worrying about whether we'll be able to still use our components if we switch to a different language.
|
|
|
|
|
The only approach to prevent this problem is to document and manage your changes, so the knowledege stays in your company and not in your resources (coders primarly). This is not an exclusive problem of .NET.
|
|
|
|
|
There's a key combination: Ctrl+K and then directly Ctrl+C this makes comment out of the selected code. Handy when you need to comment out large codeblocks.
You want to uncomment the code again? Ctrl+K and then directly Ctrl+U.
Realy easy to use
I could post more short-cuts, but you can find them in Edit -> Advanced (take a look at the items and you will find all available short-cuts to format the code)
Greetings....
|
|
|
|
|
But thats not really a comment, it is just commented out code
Being in a minority of one, doesn't make you insane (George Orwell , I think)
|
|
|
|
|
I find there's no real excuse not to use the XML style document comments for, at the very least, Methods/Properties. I tend to use a standard comment line (//) for variables and whatnot, but the IDE just makes it too easy to add comments now ...
Unforunately, I'm still not entirely certain that having them is going to prevent another developer from coming along and adding yet ANOTHER method that does exactly the same thing a method I have written already does; just because most developers won't take the time or make the effort to (1) look at the existing code or (2) dump the XML comments and look through that ...
Seems to me, that most people take the path of least resistance; they dump all the hard $#!^ on me.
D.
|
|
|
|
|
further use NDoc to make the Xml comments into a Microsoft style help file .chm or HTML as needed. Makes it more readable too.
Cheers, MTK.
|
|
|
|
|
best code is c++, windows forms are the worst thing, another thing... where are sounds on c# ?? oh, you need to call windows api, cool.
|
|
|
|
|
You knew this? C++ = Windows API Calls... so nothing is different !
And by the way, try DirectX it has build in sound support (AudioVideoPlayback class).
Greetings....
|
|
|
|
|
Microsucks has its benefits with C#
Try it!!!
50 Cents
|
|
|
|
|
I think it's an overly compilcated version of C++ that MS released just too sound cool...
::Sorry if i've offended anyone::
|
|
|
|
|
Is this an informed opinion (as in, you've written 100,000 lines or so of C#)?
Software Zen: delete this;
|
|
|
|
|
Hm, I don't agree.
I wrote a C# program of more then 21.000 lines of code within 3 days. Which you probably won't write with C++ in 3 days (never tried, only used C++ for dos apps )
Anyway, everyone has a favorite. Your free to have that opinion, although I won't share it
C# is for me the best there is when it comes to possibilities. And the language looks like C++, so that's a positive thing, no need to learn a complete new way of writing code (syntax and stuff). Ok, some things are different but these are easy to learn.
Greetings....
|
|
|
|
|
So lets say you work 14 hours a day, you have coded? 500 lines per hour..
sounds not very real it you talking about brand new code.
seems to be a wizard created form app with many generated code to me.
But anyway.
we will see
|
|
|
|
|
"C# program of more then 21.000 lines of code within 3 days. Which you probably won't write with C++ in 3 days"
This would make c# a good prototyping language.
You can also write code in VB much faster than c++, but that doen't mean VB is a better language.
From you're own personal point of view you are tying you skills to a limited environment: Windows and .NET.
With c++ you can do anything on any platform, even mobile phones and emebedded devices.
|
|
|
|
|
Yeah i agree with you, c++/c programmer can move around from one platform to another which is good from the software company's point view. With C# you are stuck at one place and dont know what ur future will be if the company does not have any C# projects.
esdessdfsdfsd
|
|
|
|
|
An overly complicated version of C++? What exactly to you think C++ is?
int main(int ac, char** av)
{
std::cout << "Hello world" << std::endl;
}
C# comes nowhere near C++ in complexity. The only area where I find C# to be more rich of details is the runtime (.NET).
Judging by you statement, you don't know either C++ or C#.
--
Yeah well, my daddy can beat up your daddy!
|
|
|
|
|
10 REM This is a proper comment
"Your village called - They're missing their idiot."
|
|
|
|
|
Au contraire.
C
C THIS IS A PROPER COMMENT
C and this is too
;
; this is a proper comment
;
Software Zen: delete this;
|
|
|
|
|
Or even
# This is a comment
|
|
|
|
|
Lemme guess; Exormacs assembler for the 68000, right?
Software Zen: delete this;
|
|
|
|
|
'nuff said.
#endif
I think it's cool that Shog's coding johnson is longer than everyone elses
-- JoeSox 10/8/03
|
|
|
|
|
#if 0 is great for commenting out blocks of code that almost work, but not quite, so you can't use them.
If your nose runs and your feet smell, then you're built upside down.
|
|
|
|