Generics article

  • Thread starter Thread starter Ludwig
  • Start date Start date
Without having read it - I see no particular reason why it needs to be
a PDF rather than HTML. It would be easier to use as straight HTML,
IMO.

Converting my doc to pdf preserves lay-out. Converting to HTML, well,
it's not the same anymore. Therefore, it's a pdf.
 
Ludwig,
if you want readership (which I guess you'd like, since you've been kind
enough to post about it on this group) I'd recommend you offer the article in
HTML, with an option to download as PDF. As with everything in life, there
are trade-offs. HTML means more readership and - these days - it also means
better indexing by the search engines; not a small matter at all.
Peter
 
Ludwig,
if you want readership (which I guess you'd like, since you've been kind
enough to post about it on this group) I'd recommend you offer the article in
HTML, with an option to download as PDF. As with everything in life, there
are trade-offs. HTML means more readership and - these days - it also means
better indexing by the search engines; not a small matter at all.
Peter

I uploaded the html version:
http://www.coders-lab.be/Technical documents/CTGArticlesGenerics/index.html

There's a link to the pdf version.
 
Ludwig said:
Converting my doc to pdf preserves lay-out. Converting to HTML, well,
it's not the same anymore. Therefore, it's a pdf.

Not being exactly the same isn't necessarily a bad thing though. For
instance, I've got a wide screen laptop - having a fixed width layout
means most of the screen is wasted. PDF is really useful when the
layout is absolutely vital - but I don't see why it is in your article.
The code needs to be preserved as it is, and that's easy to do, but
everything else can be more flexible in HTML.
 
Ludwig said:
Hi,
I wrote an article about generics in C# 2.0; you can download it at
http://www.coders-lab.be/Technical documents/CTG_Articles_Generics.pdf
Suggestions and feedback always very welcome,
kind regards,
Ludwig

"Boxing and unboxing are very timeconsuming operations and should be
avoided, because they degrade performance. This effect of boxing/unboxing
can be quite significant in scenarios where you must iterate over large
collections. The solution to these problems is creating strongly typed
collections."
How does a strongly typed collection avoid boxing / unboxing of primitive
types (you are talking about .Net 1.1 in this part of the article)?

SP
 
SP said:
"Boxing and unboxing are very timeconsuming operations and should be
avoided, because they degrade performance. This effect of boxing/unboxing
can be quite significant in scenarios where you must iterate over large
collections. The solution to these problems is creating strongly typed
collections."
How does a strongly typed collection avoid boxing / unboxing of primitive
types (you are talking about .Net 1.1 in this part of the article)?

You can create a strongly typed collection which uses an array of the
appropriate type underneath the covers (int[], DatTime[] or whatever).

I would take issue with the idea that boxing and unboxing are "very
timeconsuming operations". The problem is that you tend to do them an
awful lot, so even though individually they're cheap, they can mount
up...
 
SP schreef:
"Boxing and unboxing are very timeconsuming operations and should be
avoided, because they degrade performance. This effect of boxing/unboxing
can be quite significant in scenarios where you must iterate over large
collections. The solution to these problems is creating strongly typed
collections."
How does a strongly typed collection avoid boxing / unboxing of primitive
types (you are talking about .Net 1.1 in this part of the article)?

SP

Oeps yes, this is confusing, I'll change it. Thanks for the remark.
 
Ludwig said:
I uploaded the html version:
http://www.coders-lab.be/Technical documents/CTGArticlesGenerics/index.html

There's a link to the pdf version.


I know you are looking for criticism, but all I have is praise.

The only other reading of this level that I had done was a free
download, Chapter 10 Understanding Generics from Pro C# 2005 and the
..NET 2.0 Platform by Andrew Troelsen. Your discussion meets and
surpasses the chapter from this book. Probably because your discussion
of IComparable<> and sorting is in a different chapter of his.

I would recommend changing the title of the article to reflect that
sorting and IComparable<> is covered. Having recently implemented a
ComnpareTo in a 1.1 application, the subject was on my mind.
Immediately when I saw you sort Person by calling name.CompareTo(), I
wondered to myself, "Self, what if I wanted to give the programmer
choice on what property to compare and sort." You immediately answered
with your addition of the enum.

Excellent job!
 
SP schreef:


Oeps yes, this is confusing, I'll change it. Thanks for the remark.

Jon Skeet replied to the original question. I was playing the devils
advocate really because you followed with an example that was using
CollectionBase which of course incurs boxing/unboxing with primitive types.
On a second read I did see you mentioned ArrayList but you should probably
mention that inheriting CollectionBase would be for non primitive types.

SP
 
I know you are looking for criticism, but all I have is praise.

The only other reading of this level that I had done was a free
download, Chapter 10 Understanding Generics from Pro C# 2005 and the
.NET 2.0 Platform by Andrew Troelsen. Your discussion meets and
surpasses the chapter from this book. Probably because your discussion
of IComparable<> and sorting is in a different chapter of his.

I would recommend changing the title of the article to reflect that
sorting and IComparable<> is covered. Having recently implemented a
ComnpareTo in a 1.1 application, the subject was on my mind.
Immediately when I saw you sort Person by calling name.CompareTo(), I
wondered to myself, "Self, what if I wanted to give the programmer
choice on what property to compare and sort." You immediately answered
with your addition of the enum.

Excellent job!

Thank you for your kind remarks. The following days I'll
correct/extend the article, and also an english-speaking person will
verify the syntax; because English is not my mother tongue :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top