Directory Freebies VS CheatSheet Forum

RSS

Email

Translate

Home About Archive Privacy Contact Advertise Write for Dev102

shootinfoot

This is part B of the 10 Ways To Programaticly Shoot Yourself In The Foot article. As I already stated in part A, there are several things a software developer can do to make his life much more difficult in the future. In this article I will talk about another 5 issues that even the best developers have to be aware of. In other words, I will try to prevent you from programaticly shooting yourself in the foot.


  • Use The Wrong Access Modifiers 

There are four access modifiers: public, protected, internal and private. Don’t use public everywhere you can! Choose the correct access modifier!…


Continue Reading...

Hi

 

I was working on a Silverlight Application lately and I was in the need to open up a Popup window. and I am not talking about the regular .NET Message box. Naturally I Created a Page with some controls created a new instance of it but Saddly there was no Page.Show() method :( .

 

I know you can use the Popup Control to do a similar job (although I am not sure about the fade in and out) but I just played around and I liked what came out of it, so here is my solution to this problem.

 


Continue Reading...
Posted by Amit on Nov 19th, 2008 | Filed under .Net, C# | 4 Comments

Lately I have been playing around with serializing and deserializing of objects, and I stumbled upon a very weird behavior. I was trying to serialize a certain object that was implementing the INotifyPropertyChanged Interface. I marked the object as [Serializable] and used the following method to serialize it:

   1: public void SerializeNow()
   2: {
   3:    Stream s = File.Create("Data.dat");
   4:    BinaryFormatter b = new BinaryFormatter();
   5:    b.Serialize(s, data);
   6:    s.Close();
   7: }

Continue Reading...

For the last month, I was working on an imagery infrastructure library. Some of my effort was to well document each class, method and property so that the users of this library will have the privilege of knowing how to properly use it. During the development phase, I created a test project so I will be able to test my code at runtime. By the end of this month, I decided to separate the test project from the main solution and create a test solution. Surprisingly, when browsing the test code and hovering my library classes and methods, no comments appeared in the Visual Studio tooltip:

image

Those comments did appear when the test and the imagery infrastructure projects belonged to the same solution. On In this article, I am going to explain why it is so important to generate XML documentation file for each one of your .Net projects.


Continue Reading...

Here is something I picked up while wandering the web

This one is for all you Gamers and Quake lovers. It seems that a guy named has ported the Quake engine into Silverlight!!!


Continue Reading...
Posted by Amit on Nov 13th, 2008 | Filed under .Net, ASP.Net, C#, Web Development | 4 Comments

Today’s article is going to be one of many, or at least a few, that take a look at building an application using the new ASP.Net MVC Beta. I wanted to do this in a small series so we can look at each phase of the application in a decent amount of detail while keeping the length appropriate for a blog post.

 

This first part isn’t actually going to crack the lid on MVC just yet but we are going to look at a few things today.

  1. What is MVC and specifically what does ASP.Net MVC look like?
  2. What will the goals of our application be? What features will it have?
  3. What will our database structure look like?

Continue Reading...
Posted by Shahar Y on Nov 10th, 2008 | Filed under .Net, C# | 2 Comments

shootinfoot

There are several things a software developer can do to make his life much more difficult in the future. One day, some pieces of an old code may make us sorry we haven’t dedicated some more effort when we wrote it, so we have to pay attention and be careful. I am not talking about bad developers who always generate bad code because in those cases, every piece of their code is a disaster. Amit is talking about this issue in Terrible Code Examples - Methods From Hell. In this article I will point out some more .NET advanced issues that even the best developers have to be aware of. There are some things you can do which will cause some problems later on and you will be the one who have to handle with those issues. In other words, I will try to prevent you from shooting yourself in the foot.


Continue Reading...

Another month is over and once again we received some massive traffic from stumble upon. I have decided to change the structure of the stats as the old one was a bit boring in my opinion so from now on I will present the stats a little bit different than usual.
 
Guest Posting
This month we got [...]


Continue Reading...
Posted by Shahar Y on Nov 5th, 2008 | Filed under .Net, ASP.Net, C#, Unmanaged Code | 1 Comment

After publishing the How To Get Free Disk Space And Other WMI Stuff (.NET) article, I learned two new things. One is about a better way to get free disk space and the other is about a better and easier way to use WMI in general. This is what is good about blogging, you share your knowledge and then learn from others.

 

Better Method For Getting Free Disk Space

Karl Agius left the following comment:

“I agree that WMI is extremely powerful, and that it lets you get to details that are not otherwise available in managed code. In this case though, the free drive space can be derived through the AvailableFreeSpace method in DriveInfo. What are the arguments for using WMI instead of this?

Great article, by the way :D That WMI object browser looks handy … sure beats trawling through MSDN looking for stuff ;) Thanks!”


Continue Reading...
Posted by Shahar Y on Nov 3rd, 2008 | Filed under .Net, C# | 43 Comments

I guess that most of you have already heard about Anders Hejlsberg introduction to the future of C#, taken place at PDC 2008. One of the core features introduced in C# 4.0 is called Dynamic Lookup which allows a unified approach to invoking things dynamically. Currently, when you call object methods or properties, the compiler checks that they exist and raises an error if they do not. With dynamic lookup, you can call any method or property, and they are not checked until runtime. C# 4.0 is extending towards the dynamic languages. Having an object, you do not need to worry about whether it comes from COM, Python, JavaScript or reflection, you just apply operations to it and leave it to the runtime to figure out what exactly those operations mean.


Continue Reading...
Write Article for Dev102

Write for Dev102!

We pay for user submitted tutorials and articles that we publish. Anyone can send in a contribution

Learn More