|
Performance and properly architected code matter in all cases. Also, please use proper english and not SMS (Text) Speak in the forums and don't advertise.
|
|
|
|
|
This really depends on what you want to analyze. If you are just looking for performance measurements, you can do order analysis or wrap sections of the code in timing blocks. If you are looking for best practices type analysis, you can run tools like NDepend[^] or FxCop[^].
There are a lot of design resources available through CP, the web, or books as well that can give you good design patterns to start to follow.
|
|
|
|
|
Learn to spell 'should'
Pick out a small section of your code, a small class, or a few methods and post it here, asking people to critique it for you. Don't post your whole application though.
Whilst this is strictly a forum for answering problems regarding C#, considering the amount of dross that is being posted recently, I imagine you will get loads of people offering advice on how your code can be improved, and constructive criticism on what you have done.
If others don't agree with me, the worst you will get is a few '1' votes (and I'll get a few more for suggesting it!!)
<edit>
Unless you're from NIIT - then you're on your own! (sorry, I have a problem with NIIT students on here at the moment - hopefully one of them will prove me wrong soon.)
</edit>
-- modified at 3:36 Wednesday 26th September, 2007
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
Malcolm Smart wrote: hopefully one of them will prove me wrong soon.)
I don't think that's likely to happen. They really do seem to like being the dross on the net.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I think that you need to learn to program and experience the mistakes. I learned programming with falling and standing up. Wrote brilliant code that later-on was a piece of crap caused by performance issues. Well this you learn while you are learning and doing.
How you can test if your application is doing fine, work with it.
Your application works fine with a small amount of data, what if you multiply this small amount of data by 1000?
Is my application slowing down? Do I make to much Interface call backs during the process?
Besides that, there are in the market profiling tools that can point out code that is taking to much time to run. Think of ANTS profiler and JetBrains.
|
|
|
|
|
I haven't looked too closely at your code but you'll receive a datareceived event as soon as the first byte comes in. Sounds like you're then trying to read everything that's arrived. Most of your data will still be yet to arrive.
Try reading a byte every time you get the datareceived event and then assembling them as you see fit.
This assumes you have set the serial port to send a datareceived event for every byte. If you've set it for more then read as many as you've set.
I have no blog...
|
|
|
|
|
Dudes,
Why is it that everytime i download a csv file it will include the default.aspx
result:
11,22,33,44,55,test,testA,test12,8888,42352,asdf,as12DF,20000 ->this is only what i want
--> but it always include this
...
...
...
heres my code:
string filename = "default";
Response.Clear();
Response.ContentType = "APPLICATION/CSV";
Response.AddHeader("Content-Disposition", "Attachment; Filename =" + filename + ".csv");
Response.Flush();
Response.WriteFile(Server.MapPath("~/doc/default.csv"));
Did i miss something?
Thanks in advance,
C#Coudou
******************************
I just want to
know everything
|
|
|
|
|
Hello All,
I have two tables First one has PK auto increment column and the second table Has FK I select the last inserted PK in the First table and insert it into the second table as FK. is there is any more professional way to do so or this is the correct way?
Sms
|
|
|
|
|
If you're using SQLServer you can get the value of @@identity. It's a sql server var that gives you the value of the last autoincrement assigned.
Visit my blog at http://dotnetforeveryone.blogspot.com/
|
|
|
|
|
Hi
Should I write destructors for all the classes or do all classes have destructors by default(In built)
Regards,
Sivaprasad
|
|
|
|
|
No, I don't think so.
.Net Framework has its own Garbage Collection.
---------------------------------
Believe what you saw!
|
|
|
|
|
No Need
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
If .net frame work handles this...Y should I write destructors manually in some cases and
Regards,
Sivaprasad
|
|
|
|
|
|
And how does this answer his question?
|
|
|
|
|
.NET does not have the same concept of destructors as C++ does. The ~T syntax (for C#) you see (where T is the name of the class) is actually a finalizer. You should almost never need to write a finalizer.
What you are probably thinking of is a Dispose method or the IDisposable interface. Really the only time you need to use this in your own class is when you are managing native resources (unmanaged memory) yourself or you are internally managing a class that implements it.
There are a lot of references available, both here on CP and the web. You can check out this article[^] for more information.
|
|
|
|
|
hi
how to call base class constructor from derived class
how to do it?
not by instantiaze the base class object..
thanks in advance
|
|
|
|
|
To kalyan_2416,
Take a look at the following sample.
public abstract class BaseClass
{
public BaseClass()
{
Console.WriteLine("Invoke from base class.");
}
}
public class DerivedClass : BaseClass
{
public DerivedClass()
: base()
{
Console.WriteLine("Invoke from derived class.");
}
}
class Program
{
static void Main(string[] args)
{
new DerivedClass();
}
}
---------------------------output--------------------------
Invoke from base class.
Invoke from derived class.
---------------------------------
Believe what you saw!
|
|
|
|
|
I am new in c# programming,i want to improve my programming ability,how?
|
|
|
|
|
A says like this : Practice makes perfect.;P
---------------------------------
Believe what you saw!
|
|
|
|
|
You need to study and gain experience. Being the "top" in anything takes time and hard work.
|
|
|
|
|
Hello Dears
Subject: Want to Disappear Context menue strip
I made a window service controller which are in system tray (sqlservier controler in system tray) , right click on symbol of (Controller)
the context menue strip is appear.... and show some menue like show, Exit etc...
now the problem is that if i click any where in desktop it should disapear but in our case it is not....
Now i Want to Disappear Context menue strip when i click any where on desktop except Context menue strip.....
Sooperfellow
-- modified at 2:15 Wednesday 26th September, 2007
Afridi
-- modified at 2:17 Wednesday 26th September, 2007
|
|
|
|
|
As I know, a real application has the ability to let users to change certain settings and alter the way the application runs, which is regarded as user configuration. Some settings will take the effect immediately after you click 'OK' while the program is running, some may request you to restart the program
I am a complete novice for programming, though I have read so many text books about C#. All I know now is that like how to create classes, structures, define functions, callbacks, delegates, interfaces, declare variables and so forth.
I totally have no idea about how to design a real application from scratch although I was thrown in this situation that I have to. I have partially completed the flowchart but I still don't understand how to persist and implement user configurations to make the application interactive?
Thanks for anyone could give me some hints.
-- modified at 23:13 Tuesday 25th September, 2007
Someone was born greatness;
Someone achieved greatness;
Someone have the greatness thrust upon him;
|
|
|
|
|
As you mentioned, you're a newbie in C#, so I think the most important thing to you is not the application interative but how to create a real application.
You can create some applications without thinking too much more, just let them run with simple features, such as IO, Registry, Graphics, etc. These can help you with further programming.
YouMiss wrote: but I still don't understand that how to persist and implement user configurations to make the application interactive?
Since then, you shoule know this way: you can use XML document to save the user configuration and let the application "read" the user's settings and "implement" them. Use XML to store and read user configruation. That's "what you do", not "how to do".
---------------------------------
Believe what you saw!
|
|
|
|
|
Dunbar C wrote: You can create some applications without thinking too much more, just let them run with simple features, such as IO, Registry, Graphics, etc. These can help you with further programming.
Thanks very much for your suggestion. But, if I could choose to start from all the fundamentals I would REALLY not put myself into this situation .
Dunbar C wrote: Since then, you shoule know this way: you can use XML document to save the user configuration and let the application "read" the user's settings and "implement" them. Use XML to store and read user configruation. That's "what you do", not "how to do".
I did read about that the C# (or maybe the .NET framework) supports the *.resx file format which is to persist all the external resources used for an application. However, upon what I read I haven't figured out how to modify a resource file at real-time. And yes, the resource file is making use of the XML file. Is it what you were just trying to say?
Someone was born greatness;
Someone achieved greatness;
Someone let the greatness thrust upon him;
|
|
|
|