Milestone (Really): 100th Blog Post
I finally reached my 100th post today - by finally I really really mean finally.
This website's been running for about 5 years now, so I am not too sure if this is much of an achievement - especially seeing as some of my older posts resembles tweets more than posts.
Even though thats the case, I really do feel a sense of accomplishment, since this has been the first year I've been taking blogging seriously. (something every developer needs to take seriously)
This year I wrote majority of the posts you can find (at the moment at least) on this website (55 to be exact).
But why blog? Here is a list of my personal motivations.
-
Helping others
I find it extremely fulfilling when I find a comment on my site in which one of the posts actually managed to help someone - time is afterall by far our most precious commodity.
I feel we need to contribute as much as we can, freely give as you've received - just think about how many hours you've spent on the internet looking for answers to your questions - it needs to be a bi-directional action, don't be a parasite ;)
-
Being helped by others
It can also be a wonderful learning tool (find better/other solutions), if you've got a teachable "spirit" that is and not live under the false assumption that you know and understand all things (oh we're not worthy).
We can learn from anyone, I know criticism can be hard and we tend to be sensitive - especially if people get unnecessarily nasty, see it as something that you can use as part of your learning process. (perhaps change some of the misconceptions you might have - or potentially unfortunately improve on them - develop even greater misconceptions, hehehe)
-
Knowledge base
Chances are pretty good that you're going to forget a lot of the things you've learned in 5 years (if not 5 minutes) from now - your blog can serve as a personal knowledge base, where you can store concepts and ideas in your own language and funky logic (wish i started sooner - sigh).
-
Market yourself
It can also give potential employers an idea or approximation of who you are and what you can do, maybe even make your resume a little bit more colourful.
Now I know it can be quite difficult to put yourself out there, its scary - I still find myself holding back on a lot of things (blogging wise) - since we're scared that people might think we're a special kind of stupid. (expose our ignorance to the whole world)
But I can definitely recommended that if you don't have a blog, start one today - even if you only write tweet sized posts to start out with - go for it.
I've got an average of about 60 000 hits per month at this stage (nothing hectic) - excluding bots etc. So I just want to thank my loyal reader... uhm, loyal readers for visiting my website over the last few years, I hope to provide you with some quality posts in the years to come.
Posted by - Christoff Truter
Date - 2010-12-14 11:06:23
Comments - 1
Date - 2010-12-14 11:06:23
Comments - 1
C# Operators: Conversion Operators (implicit / explicit)
Within C# (among other languages) we've got the ability to overload implicit / explicit conversion operators.
Just to get everyone up to speed, an implicit conversion refers to an action that happens automatically (the compiler infers - decides what the appropriate type is to use) e.g.
Decimal d = 10.9M;
While an explicit conversion refers to the opposite - a developer needs to manually specify to which type they wish to cast an object e.g.
int i = (int)d; // d being the decimal value from the preceding snippet
In the following snippet we've got two structs, one represents kilograms (you know metric?) and the other one pounds.
struct Pound { public Pound(float value) { this._Value = value; } private float _Value; public float Value { get { return _Value; } } public static implicit operator Pound(float value) { return new Pound(value); } public static explicit operator Pound(Kilogram value) { return new Pound(value.Value * 2.20462262f); } } struct Kilogram { public Kilogram(float value) { this._Value = value; } private float _Value; public float Value { get { return _Value; } } public static implicit operator Kilogram(float value) { return new Kilogram(value); } public static explicit operator Kilogram(Pound value) { return new Kilogram(value.Value * 0.45359237f); } }
In the snippet above, our "base" value is a float, from which an implicit conversion happens e.g.
Pound p = 100; // public static implicit operator Pound(float value)
And we require the developer to do an explicit cast if they wish to convert pounds to kilogram e.g.
Kilogram kg = (Kilogram)p; // public static explicit operator Kilogram(Pound value)
But how does one decide whether an operator conversion should be implicit or explicit? As a rule of thumb we can use implicit casting when there is no risk of information loss and not throw any exceptions from our overload. (basically we want our implicit conversion to have expected results)
Loss of information? If you look at the explicit conversion in the second snippet in this post (decimal to int) - you will notice that the integer conversion's actually flooring the decimal - which means we're losing our decimals. (loss of information)
Posted by - Christoff Truter
Date - 2010-12-13 19:29:54
Comments - 0
Date - 2010-12-13 19:29:54
Comments - 0
First 6 7 8 9 10 11 12 13 14 15 Last / 62 Pages (124 Entries)