Happy new year everyone!
Just a quick post to wish you all a happy new year!
Ramblings about C#, .NET and Programming
Just a quick post to wish you all a happy new year!
Enough is enough! I tipically don’t discuss politics but this time I’ll make an exception . Since it’s about Madeira and Portugal, I’ll write in Portuguese. Se me dissessem no ano passado que hoje estaria a escrever um post político no meu blog e que ainda por cima estaria a defender algumas decisões tomadas pelo […]
Disclaimer: I’ve received a free copy of this book for review. Nowadays, HTML5, CSS and JavaScript are everywhere. And since these are really hot technologies, it’s really easy to find lots of books about these topics. This really ends up being a problem because it’s not easy to find one which fits makes everyone happy. […]
It’s been more than one month since I’ve written something in this blog. Unfortunately, I’ve been really busy with work and lots of investigation in several areas…but I think now I’ll be able to return to my daily routines and I’ll try to write at least one post per day . So, what have I […]
Even though I though this was it, the fact is that MS renewed my ASP.NET MVP status for another year! (not sure why, but the notification email ended up in the spam area – bad boy Gmail!, bad body! ) Thanks MS!
[Disclaimer: I’ve received a free copy of this book for reviewing] A few days ago, I’ve received a copy of the Parallel Programming With MS VS 2010 book. Before delving into the parallel lib, the books starts by presenting several interesting concepts related with parallel/multithreaded programming. From chapter 2 onwards, it’s all about the Parallel […]
After playing a little bit more with the new Windows 8 preview, I’m a little more used to the new metro UI. I’ve already removed all the default crap (oops, applications…that’s what I meant) and I’ve added shortcuts for most of the apps I use daily. I’m still trying to figure out how to place […]
I’ve decided to use it in my home machine…couldn’t resist it, you know The first impressions are positive, though I’m not sure if this metro thingy is something I want to use in my day to day work. I would really be glad to end up with slick and fast UI + tools. After all, […]
Before going on, I need to confess one thing: I’m really frustrated! Why? simple: I was watching the damn build keynote and it stopped…right in the middle of the whole JS app for Windows 8…oh well, it’s probably a sign that it’s time to go back to my blog… As you probably recall, in the […]
As promised, today I’ll start presenting some interesting guidelines you should follow when working with exceptions. If there’s one guideline you should *always* follow, this is it: don’t catch every exception there is…especially if you’re developing libraries which will be used by other developers. It’s important to realize that whenever you catch an exception, you’re […]
When someone with lots of experience in Win32 programming starts using .NET, they tend to be shocked with the regular use of exceptions. In fact, they tend to ask why do we define APIs which don’t return error codes and rely heavily on exceptions. Well, it’s a matter of “culture”. Notice that .NET and OO […]
In one of the previous posts, I’ve mentioned that the CLR allows an instance of any type to be thrown for an exception (notice that this isn’t allowed by the CLS). In practice, this means that you should be able to throw ints or strings from CLR languages which allow you to write non-CLS compliant […]
As I’ve said before, you’re supposed to throw an exception when a method cannot complete its task in the way it’s supposed to do it. Before throwing an exception, you should consider two things: which type of exception should you throw? What’s the message that you’re going to pass into the Exception constructor? The first […]
In the previous post, we’ve started looking at how to use exception in .NET. Even though the CLR allows an instance of any type to be thrown for an exception (more about this in a future post), the truth is that all CLS compliant languages can only catch and throw Exception derived exceptions. That’s why […]
After a great month of vacations, it’s time to go back to work. And this time, I’ll write a couple of posts about exceptions and exception handing in .NET. In .NET, we should generate an exception when a member (method or property) fails to complete its task correctly. Did you noticed the “fails to complete […]
As I write this, I’m getting ready for enjoying month away from my daily job. I hope it’s enough for resting, but what I’d really love is to hear from you, my faithful reader . I know I haven’t really posted much in these last couple of weeks, but I’ve been really busy updating my […]
Ah, the joy! Almost in vacations, but still one day to go! We’ve already covered a lot of ground in this delegate series. As we’ve seen, creating a delegate is rather easy: we just need to provide a compatible method and pass it to the delegate constructor which is being initialized. However, there might be […]
I’ve ended the previous post by saying what we can chain several method calls and that is what we’ll see in this post. With chaining, we can combine several delegates so that calling one of them ends up invoking all of them. A quick example is the best way to see this feature in action […]
As we’ve seen in the previous post, delegates are really easy to use: you create a new delegate definition and then instantiate it through the new operator, passing it a compatible method reference. However, there’s a lot more going on behind the scenes and that’s what we’ll start seeing in this post. The first thing […]
If you’re an experienced Windows developer, then you know that Windows has always relied on callback methods/functions for doing several things (ex.: window procedures). In unmanaged code, this was typically achieved through the use of callback functions which, in practice, referenced only a memory address that “had” some code which should be executed when something […]
After all, I’ve decided to write another post about custom attributes. In the last post, I’ve mentioned the use of the CustomAttributeData type. Since I’ve received a couple of questions about its use, I thought it would be a good idea to show an example of how one can use this class to check for […]
Whenever people ask me what I think about the JavaScript wrapper objects (ex.: String, Number, etc.), I tend to tell them that it’s better to forget that they exist and simply use the literal values (and simply let the runtime perform the conversions between literal an wrapper object automatically and whenever it’s needed). I tend […]
Now that we already know how to create new custom attributes and how to restrict its use, it’s time to wrap up this series with a final post that shows how to rely on custom attributes to change the behavior of your code at runtime. One of the first things you’ll need to do (if […]
After another long blogging pause (for a good cause, I must say!), it’s time to go back to our .NET attribute series. In the previous post, we’ve starting looking at how we can build new custom attributes. We’ve already met several restrictions (ex.: inherit from the Attribute base class, limitations applied to the types used […]
In the previous post, we’ve started looking at how we can use attributes to improve the metadata of a type. Even though we’ve looked at some attributes and seen how the C# compiler reduces the required typing by allowing us to skip the Attribute suffix, I didn’t really got into details about how attributes are […]
To celebrate the release of the new Kinect SDK beta, MS Portugal has launched a new context on the Kinect PT’s Facebook page. To enter the contest, you need to live in Portugal and send a 140 chars message with an idea for creating something with the new SDK. The two most voted entries automatically […]
We’ve already covered a lot of ground on the basics series…but guess what? There’s still a lot more to cover Today, we’ll start looking at how we can improve our .NET code with attributes. With attributes, we can add custom metadata to our types (and/or a type’s members). After adding extra information to a type […]
As we’ve seen, we’re limited quite limited when you need to define a new enumerated type: we can only specify the enum base type, the symbolic names and its associated values. That means that you can’t add new instance methods to an enum (which doesn’t really make sense because, as we’ve seen, enums are mapped […]
Fantastic! Never has an Apple store looked so sexy 🙂