Is [protected and/or internal] to be avoided?

  • Thread starter Thread starter Jeremy S.
  • Start date Start date
Jon Skeet said:
Yes, performance tends to be the point people don't like about it. I
would hate to develop without it these days :)

Does it work in VS 2008 B2?

Of course, I'd appreciate it if you'd redirect people to my book after
it's out :)

Guess we have to buy a few copies.
Indeed. I thought I'd be avoiding var like the plague, but I'm now keen
on it - only where it makes sense, of course.

I've seen it been abused with mixed datatypes. I would not do like this:

var circum = 3.14 * 2 * 7 + " is the circumfarence of 7";

Mixing doubles, ints and string could be confusing.
I would be explicit and write

string circum = 3.14 * 2 * 7 + " is the circumfarence of 7";
Ditto, ironically...

My task was to make some custom sorting on a list,
that is final containing objects I have no control over.

So I had to Copy/Convert all objects into instances of a class that
I can implement IComparable on, and put them all in a ArrayList.

Making a nested MySorter class , implement ICompare,
and new up my sorter in ArrayList.Sort();

Yuk. Way to Javaish for my taste.
I want Linq!

- Michael Starberg
 
Does it work in VS 2008 B2?

The latest version is a sort of "beta for Orcas" - I haven't installed
it against Orcas yet as I'm
not sure how well it works when it's *also* installed for VS 2005.
Guess we have to buy a few copies.
:)


I've seen it been abused with mixed datatypes. I would not do like this:

var circum = 3.14 * 2 * 7 + " is the circumfarence of 7";

Mixing doubles, ints and string could be confusing.
I would be explicit and write

string circum = 3.14 * 2 * 7 + " is the circumfarence of 7";

Absolutely. For plain numeric types, I definitely wouldn't use it.
Consider this:

var x = 2000000000;
var y = 3000000000;

x and y have different types, but that's not at all obvious from the
code.
So I had to Copy/Convert all objects into instances of a class that
I can implement IComparable on, and put them all in a ArrayList.

Making a nested MySorter class , implement ICompare,
and new up my sorter in ArrayList.Sort();

Yuk. Way to Javaish for my taste.
I want Linq!

I don't mind not having LINQ, but being able to use an anonymous
method in sorting is really handy.

Jon
 

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