Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 19th, 2008, 10:18 AM
Registered User
Join Date: Apr 2008
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default i need help for my coding problem...


I am a beginner C# programmer and I did some simple program with database(mssql 2005) but i think my coding system is poor because I found some of codes that are redundant, one of the example is the execution of the query.
what i want to happen here is to normalize my code and to find better techniques on coding.

what are the things I need to learn and to study? to make my learning faster....
what will I do so that my code are not redundant?

somebody here please...i need your opinion....


Reply With Quote
  #2 (permalink)  
Old May 19th, 2008, 10:27 AM
Friend of Wrox
Join Date: Mar 2007
Location: Hampshire, United Kingdom.
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post

How about posting some code to look at and discuss? We'd be happy to help!

Especially the code for execution of a query because as far as I know, with the exception of LINQ, it hasn't changed much since 1.1?

As for learning and studying, I would say you definatly need a firm grasp on Data Access, logical blocks (if, while, switch etc). Like any other trade, a lot of the rest comes from experience, blood, sweat, maybe some tears and lots more work ;)

Reply With Quote
  #3 (permalink)  
Old May 19th, 2008, 03:51 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

Some basic guidelines to reducing redundancy:

- When you find yourself copying and pasting the same chunk of code to use elsewhere, think about putting it into a reusable method.
- When you need to reuse code in different files (i.e. other classes) you'll need to explore creating utility classes (helpers). For this you'll need to learn how to construct your own classes, and where you can put them in order to reuse them.
- When you need to reuse code in different assemblies (i.e. other applications) you'll need to explore creating shared class library assemblies. For this you'll need to learn how to work with binary/project references and namespaces.

Unfortunately, there is a lot to learning how to write code efficiently. It is very much a crawl/walk/run metaphor. As Rob said, only years of experience will make you very efficient. In spite of that, you'll always find a better and faster way to do something. No one can become an expert overnight.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in coding with ndbm library shayanppp BOOK: Beginning Linux Programming, 4th Edition ISBN 978-0-470-14762-7 1 August 8th, 2008 11:32 AM
coding problem in common dialog box cancertropica Visual Basic 2005 Basics 0 July 30th, 2008 09:38 AM
javascript coding problem hosefo81 Javascript How-To 3 December 4th, 2003 04:56 AM

All times are GMT -4. The time now is 04:57 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.