473,486 Members | 1,850 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Coding - Best practices?

Hi,
I have been developing using C# in ASP.Net for about a year now. And have
been a programmer for about 10 years. I have learned many different things
in .NET, but still when I look at sample code fromother programmers I feel
like I am so far behind. I see them usingstuff like Interfaces,
IEnumerables, StringBuilders, etc. I have written several applications in C#
since I started, but I don't ever seem to need or use those more "Advanced"
features.

I have just been assigned a new application to build from scratch.
So this is what I am asking. Where can I find a simple list of what
I should do as I build a new application. I don't really have time
for a 300 page book. What I am looking for is something that says.
"If I were to build a new application I would do A,B,C,etc. I would
use Interfaces for this,because of this, and I would use IEnumerables here
because of this, etc." I know every application is different and you might
not need all of those for every application. But I want to start out
writting this "right" from the beginning. I don't know where people learned
all those advanced things, but I can't seem to find a diffenative web site
that explains the "right" way to do things.

Thanks for all your help. (I know it's alot to ask)

Michael
Feb 5 '07 #1
2 1654
Hi Michael,

Well I think I can sympathize with your feelings of many .net concepts
like Interfaces, Stringbuilder and IEnumerable.

But the fact of the matter is that these techniques, or tools aren't
really specific at all to .net. In fact, these tools are pretty
commonplace in other OOP languages and you'd be wise to take advantage
of them.

I think the best time to learn about these tools when they're born out
of need. Like when you find yourself concatenating a lot of String
data that's inside of a looping construct. After a certain point you
may notice your program is bottle-necking at this function and you
realize the need to make it faster. And that's where StringBuilder
comes in. StringBuilder will pretty much do the exact same thing but
do it in another fashion that makes it run much more fast and
effeciently.

As for Interfaces and IEnumerable it's true that you can get away with
coding without these things...but have you ever noticed how convenient
it is to loop over a collection using the foreach construct? Perhaps
if you ever wanted your own custom collections to behave in this
fashion you can give them that same functionality. How would you go
about doing it though? Would you write it completely from scratch?
You could...but the tool that comes to mind is the IEnumerable. When
properly implemented it will enhance your custom collection and allow
you or other users of your code to easily enumerate over your
collection...worry free.

Which brings me to my next topic other people: These concepts and
tools really start coming into play when working with other
programmers. You all need a way to organize your classes and provide
mechanisms to hook up into each others work. Interfaces provide this
type of enforcement or flexibility.

I'm not going to go into what Interfaces are or why you should use
them but it's definately worth it's weight in gold to get to know
these constructs...after all they are there to make your life easier.
Sure there is overhead getting to know these tools...but the payback
is tremendous and that's really what programming is about.

-Ralph

On Feb 5, 1:16 pm, Michael <Mich...@discussions.microsoft.comwrote:
Hi,
I have been developing using C# in ASP.Net for about a year now. And have
been a programmer for about 10 years. I have learned many different things
in .NET, but still when I look at sample code fromother programmers I feel
like I am so far behind. I see them usingstuff like Interfaces,
IEnumerables, StringBuilders, etc. I have written several applications in C#
since I started, but I don't ever seem to need or use those more "Advanced"
features.

I have just been assigned a new application to build from scratch.
So this is what I am asking. Where can I find a simple list of what
I should do as I build a new application. I don't really have time
for a 300 page book. What I am looking for is something that says.
"If I were to build a new application I would do A,B,C,etc. I would
use Interfaces for this,because of this, and I would use IEnumerables here
because of this, etc." I know every application is different and you might
not need all of those for every application. But I want to start out
writting this "right" from the beginning. I don't know where people learned
all those advanced things, but I can't seem to find a diffenative web site
that explains the "right" way to do things.

Thanks for all your help. (I know it's alot to ask)

Michael

Feb 6 '07 #2
I think the best time to learn about these tools when they're born out
of need.
I couldn't agree more. Though I also find it very useful to read a
bit.
I like the Wrox series a lot (I'd recommend C# Professional, it's very
general
and goes in deeper on some specific topics that make life easier)

As for a good website: this one has been posted quite often:
http://www.yoda.arachsys.com/csharp/

Regards,
Joachim

Feb 6 '07 #3

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

Similar topics

3
2544
by: Isaac Rodriguez | last post by:
Hi, I am fairily new to Python, but I am really liking what I am seeing. My team is going to re-design some automation projects, and we were going to use Python as our programming language. One...
55
5101
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...
1
298
by: Todd | last post by:
Does anyone know of a book for C# .NET on coding standards and guidelines? My company is in the process of defining this stuff as we move to C# .NET. I could swear I picked up a book like this...
4
2272
by: dotNetDave | last post by:
About three weeks ago I released the first .NET coding standards book titled "VSDN Tips & Tricks .NET Coding Standards". Here is what the famous author/ speaker Deborah Kurata says about it: ...
27
3447
by: Stuart Gerchick | last post by:
C++ Coding Standards : 101 Rules, Guidelines, and Best Practices by Herb Sutter, Andrei Alexandrescu is now a month or so away from release. What is people's opinion on this...is it going to be a...
1
1913
by: Rasika Wijayaratne | last post by:
Hello, Can I get feedback on these .NET coding best practices please. Thanks to Konrad Rudolph and Jon Skeet for the replies to my previous post on 'Writing Properties.' Thanks in advance to all...
10
2959
by: Ren | last post by:
Hi All, I'm still rather new at vb.net and would like to know the proper way to access private varibables in a class. Do I access the variable directly or do I use the public property? ...
7
4922
by: Robert Seacord | last post by:
The CERT/CC has just deployed a new web site dedicated to developing secure coding standards for the C programming language, C++, and eventually other programming language. We have already...
3
2229
by: John Dalberg | last post by:
I am looking for an ASP.NET application on CodePlex which exemplifies best practices for the following: - Use of interfaces - Seperation of the UI, business and data tiers - Data Tier that uses...
52
3317
by: burgermeister01 | last post by:
First, let me say that this question is a rather general programming question, but the context is PHP, so I figured this group would have the most relevant insight. Anyways, this is also more of...
0
6964
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...
0
7173
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...
0
7305
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...
0
5427
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,...
1
4863
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...
0
4559
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...
0
3066
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...
0
1378
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 ...
0
259
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...

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.