what is best method to document your .Net code? [closed] - c#

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
You and me both know that creating a document for codes is really boring and i opened this as a discussion that you share your experience for creating document for your code.
i think project documentation is differs from code documentation in a project documentation you can use UML to describe the whole projects,algorithms,designs, architecture.However your code documentation is very effective while your developing a DLL library or providing a web service or any other codes that will be use from other developers.
i think discussion subjects is :
1.Tools that you know useful for generating documentation
2.Methods and Rules for providing a source documentation
3.Does other developer code comment helped you what was useful

This is one of those things that the community in general tends to disagree on. Not in general... I think we all acknowledge that code documentation is A Good Thing™, but how we do it is a personal matter.
Here is my take on it:
I know it's painful, but inline documentation helps to keep you focused, as well as giving you some information you can refer to when you look back at the code.
1) I use Sandcastle to generate help files from my libraries, which I document with XML document comments.
2a) Always provide reasonable XML documentation for your public fields, properties and methods. Don't just put /// <summary>FieldName</summary>, describe what the field is for.
2b) Use inline comments sparingly. Don't comment every line, but do comment blocks of code that do something interesting or in an interesting way, just so you (or anyone else) can understand it clearly next time you read the code.
3) Abso-freaking-lutely. Reading my own code is usually pretty simple, but every developer works differently. When you have a piece of code somebody else wrote, comments can make the difference between understanding and not.

Related

Picking a parser generator for building an interpreter for a custom language using C#? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
This is the first time I go into actually trying to implement a Domain Specific Language.
I know the basics of language grammars and Abstract Syntax Trees, however I didn't get my hands dirty in implementing them before.
I want to build a small language, simple variables/arrays and conditional statements. I want to interpret and execute the user entered code via an interpreter I build by C#. Something pretty similar in spirit to PHP tho way simpler.
I searched and I became confused.
Best parser generators I found which had good C# supports were Gold and Irony. I also found ANTLR but I saw too many people complaining about problems with C# suppots. Also, the three of those seem to lack good documentation.
My main fear is to begin working with one of them and then discovering its not usable for the task, either because of lack of good C# support, or good documentation or something else. I want something that I can begin working with "confidently" to get myself kickstarted in the project.
Could anyone help me to pick something that does the job well and guaranteed to work well with C# ?
I suggest you to use ANTLR. I wrote my own compiler (for MSIL) using it.
ANTLR has C# support and i did not found any problems with it.
U can also look at my source code (i can not be working sample, but it has ANTLT .g file) for sample.
I suggest you try TinyPG. It compiles to C#, and you can provide C# directly in the grammar.

Stand alone C# compiler [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
We have a software which we use in-house for our day to day work.
It is like a customize CRM (sort of) and Bug Tracking software. We had a small team of 3 developers who had developed this software. Now this team is also working on other assignments.
Recently we are receiving a lot of request for adding functionality from users (who are our employees and all of them are developers working of different projects) in our firm. The original team that created this software does not have enough time to work on enhancing this software. So instead of spending a lot of time in updating as per request and the updating the executable of software for each user, we want to implement a programming/scripting solution that is if possible free and open source.
I was thinking of adding support for a language which is similar to C# to our application. This way the developers will add the features that they require on their own in their spare time if they really need a feature!
Can anyone point me to some such implementation already existing?
I don't know if I am taking the right decision or not regarding C# I would like to get opinion of experts on this also.
TIA
The framework already comes with a C# compiler you can use at execution time via CSharpCodeProvider.
You might want to look at the source code to Snippy, a small tool I wrote for C# in Depth - that compiles code on the fly, and can act as a reasonably simple introduction to CSharpCodeProvider.
I think I'd look at a scripting solution here; probably IronPython is the easiest to bundle and host, but others are available (including Javascript.NET, IronRuby, IronScheme, Boo, F#, etc)

java versus c# - which one is safer in terms of security? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
I and some buddies have an argument here -
in which langauge is it safer by terms of writing a code that cannot be hacked?
by hacked I mean that after the code is encrypted, or turned into executable , it can be reversed enginered into some kind of intermidate code (like java byte code) , or even the real high level program code itself .
This agruments aruse in general because one of us is about to start a big software project,but he's afraid that his competitors will steal some of his very-efficient algorithams.
It would be nice if any of you could present some pros and cons for each langauge .
thanks.
I don't really get to work with Java so I'm more familiar with C#.
In C# (or other .net languages) you can use easy and free tools like Reflector to see ALL of the code written inside an executable or dll.
You can always try obfuscating the code with the most advanced tools, so this won't be revealed easily, but I'm pretty sure that if the code is worth enough for someone to hack/reverse-engineer, It WILL be, and it's just a matter of time till that happens!
Even with lower level languages like C/C++, if the code is worth it, the people interested will find out how it works.
Bottom line : EVERYTHING IS HACKABLE/REVERSE-ENGINEERABLE!
:)
Both Java and C# can be decompiled to (mostly) your original source code. In .Net you have Reflector, in Java you have DJ's Decompiler. It works both ways.
In the end, it doesn't really matter. If someone is determined, they can always dis-assemble your code and still get the "efficient algorithms". Any code readable by the CPU is readable by a human.
Since by "security" you seem to mean protection against reverse-engineering, your best bet is probably native code like C/C++... most interpreted languages are much easier to decompile than native code, although you can obfuscate them to make it harder.

Are there any good books on writing commercial quality software? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
My background has been generally new technology demonstrators, which, well... demonstrate the latest technology and how it can be of use to a clients company. They use it for internal demos etc.
Now my career has shiffed course a bit more into actual products, in particular software which runs in locations like museums as interactive pieces.
Clearly, although the technology demonstrators had to be well coded etc, there wasn't as much emphasis as there is on my current work, which has to work, be highly configurable, probably multi-ligual and run constantly, without restarts.
So my question is, now that I'm trying to up my coding quality and write more commercial applications, are there any books which discuss issues surrounding high quality commercial software?
I currently have a copy of Code Complete 2nd Edition, which is excellent, but just wondering if there's any better, possibly more focused titles out there?
Thanks a lot!
Andy.
** UPDATE **
After a suggestion from JosephH, I'm going to mainly be working with c# and .Net (possibly silverlight!), if this helps anyone! :)
You could try Working effectively with Legacy Code.
The title is slightly misleading - although it's a very good book at showing you ways to work with Legacy code, it's also good at showing you good and bad ways to do things, why it matters, and has a focus on producing testable code. (The author's definition of "Legacy code" is any code that doesn't have automated tests.) The examples are in C, C++ or Java.
(You might want to state what language and technologies you're working with to get more focussed answers.)

What are the most useful (custom) code snippets for C#? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
What are the best code snippets for C#? (using visual studio) VB has a lot that are pre-defined, but there are only a handful for C#. Do you have any really useful ones for C#?
Anyone want to post a good custom one you created yourself?
Anyone?... Bueller?
My absolute favorite is cw.
There's plenty of code snippets within Visual Studio for basic programming structure but I wouldn't necessarily rate one higher than another.
I would definitely say the best ones are the custom snippets you define yourself to accomplish more specific tasks that you may find yourself using on a regular basis. Definitely a big time saver.
A fairly basic intro to creating custom snippets can be found at http://www.15seconds.com/issue/080724.htm to help with this.
Microsoft have released a whole bunch of C# snippets that bring it up to parity with the ones for Visual Basic. You can download them here:
http://msdn.microsoft.com/en-us/library/z41h7fat.aspx
These are the ones I use daily.
prop
try
if
else
for
foreach
mbox - Message box stub
The ability to role your own. I have one for Property that are saved in the view state, methods a custom class example.
I had a few on my old blog:
testmethod Code Snippet
onevent Code Snippet
cleantestresults Code Snippet
astype Code Snippet
I also have an argnull code snippet that inserts a Guard Clause that checks an argument for null and throws an ArgumentNullException, but I haven't gotten around to post that yet.
prop and exception are my favorites.
I just started a blog, where I document short solutions in C# (code snippets) that I came up with and might prove useful to other coders.
http://thorstenlorenz.blogspot.com/
So far I have mostly blogged about extension methods and generics.
So have a look and tell me what you think.
Just to update an older thread... here's a link for Visual Studio 2008 C# code snippet download.
VS 2008 C# Code Snippet Download

Categories

Resources