Has MS given up on us (again)?

T

Tom Shelton

I did think of that and was actually going to write that it's like adding to
a list. But that would only make sense if you could use it to add to lists
throughout C#. AFAIK, this is the only list that you can add to in this way.


I can't say I'm a big fan of case sensitivity. I avoid defining 2 variables
of the same name with different case.

I also avoid that as well.. but I do do this:

public class MyClass
{
int someVar;

public int SomeVar
{
get{ return someVar;}
set{ someVar = value; }
}

}

Of course, in C# 3.0...

public class MyClass
{
public int SomeVar {get; set;}
}
 
H

Herfried K. Wagner [MVP]

Michael C said:
Possibly, although you still need to read all that extra code and have
longer lines of code.

I don't have to read the "extra code".

However, the extra code often reveals information which is not visible in
C#, such as which type of block ends or what exactly is done (generic '+='
vs. 'AddHandler', ':' vs. 'Implements'/'Inherits', ...).
 
M

Michael C

Scott M. said:
I'm sorry but I just don't believe that in one day an entire company's
development workforce completely learned the C# programming language.

I wrote up a list of how to translate most of the basic stuff from VB to C#
and emailed it around. We didn't know everything in your list in 1 day but I
didn't say that. As an example we didn't know all the details of safe/unsafe
code but we didn't need to. Possibly some people already knew it existed and
some didn't. I would imagine that some of the team still don't know what it
is or know that it exists but have never used it. I've only used it outside
of work myself.
Again, I'm not trying to say that switching is any kind of monumental
task. I just think you are either embellishing your company's true
experience in switching or your company doesn't know all they think they
do in C# yet.

The point is we were up and writing code in 1 single day and in addition to
that we did some actual work in that day. I really don't see the issue.

Michael
 
T

Tom Shelton

I don't have to read the "extra code".

However, the extra code often reveals information which is not visible in
C#, such as which type of block ends or what exactly is done (generic '+='
vs. 'AddHandler', ':' vs. 'Implements'/'Inherits', ...).

Is that the best you can do? Those are silly issues. Just say it and
be proud, you like VB syntax. I like C syntax. There, everyone is
happy :) We're one big happy .NET family...
 
T

Tom Shelton

I wrote up a list of how to translate most of the basic stuff from VB to C#
and emailed it around. We didn't know everything in your list in 1 day but I
didn't say that. As an example we didn't know all the details of safe/unsafe
code but we didn't need to. Possibly some people already knew it existed and
some didn't. I would imagine that some of the team still don't know what it
is or know that it exists but have never used it. I've only used it outside
of work myself.

I've only ever used unsafe code once (other then playing around) and
that was on Linux using Mono :)
 
M

Michael C

Tom Shelton said:
public class MyClass
{
int someVar;

public int SomeVar
{
get{ return someVar;}
set{ someVar = value; }
}

I can't say I'm a big fan of that myself. Too easy to get the wrong one I
reckon :)
Of course, in C# 3.0...

public class MyClass
{
public int SomeVar {get; set;}
}

I'm not sure I like all these new changes they're making. That doesn't seem
much different from just having a public var.
 
M

Michael C

Herfried K. Wagner said:
I don't have to read the "extra code".

However, the extra code often reveals information which is not visible in

If you didn't read all that extra code then how do you know all this extra
information :)
C#, such as which type of block ends

This is not really an issue, I don't go to the block ends to find out what
sort of block something is. It can be an issue if there are a large number
of block ends, sometimes it's difficult to tell where, for example, a for
loop finished if it's heavily nested in if statements. If it's a big issue I
can always comment the closing brace but I never find it necessary.
or what exactly is done (generic '+=' vs. 'AddHandler',

With the += it's easy enough to see that a delegate is being added.

':' vs. 'Implements'/'Inherits', ...).

Again this is very easy to tell as I'm yet to see a class that starts with I
+ another cap and an interface that doesn't.

Michael
 
M

Michael C

Tom Shelton said:
I've only ever used unsafe code once (other then playing around) and
that was on Linux using Mono :)

I wrote an imaging app which needed unsafe code to modify bitmaps. However,
if I didn't need to modify a bitmap I don't think I would have used it
either. It's generally not required with APIs.
 
M

Michael C

Michael C said:
I wrote an imaging app which needed unsafe code to modify bitmaps.
However, if I didn't need to modify a bitmap I don't think I would have
used it either. It's generally not required with APIs.

The silly thing is I need an unsafe block to use a pointer to wipe out
memory but I can call CopyMemory and do all sorts of damage with 'safe'
code.

Michael
 
C

Cor Ligthert[MVP]

Scott,

Don't forget that you as teacher have to deal with everything, as a user,
you have the choose what you use.

This different point of view can make a big difference, don't forget that VB
covers full the Net while C# does only a subset (and yes "unsafe" code). The
latter text does reminds me to the movie Miss Congeniality (Sandra
Bullock).

You can compare this with the natural language English, which is a language
consisting originaly from mainly the old language spoken around the whole
Northsea (Old England, Scotland, Danmark and Frysia (covering in past
current North Germany, the Netherlands and Belgium), England and Scottland)
and French (in fact Normandia). Be aware that the Enlish spoken in the USA
is more or less influenced by other languages, by instance the word "cookie"
is slang Dutch not English.

However this results that when non native English speakers from West Europe
use mostly English words conform their Latin or Germanic culture part (the
latter word has nothing to do with Germany, where a Germanic/Gallic language
is used)

But that is not for a teacher of the English language here, they have to
know everything and to speak it like is used in Oxford in Thames Valley.

This maybe a little bit to long text to show you that the point of view to a
language makes big differences.

Cor
 
R

RobinS

Herfried K. Wagner said:
Well, that's a general problem ASCII art programming languages suffer
from. Overloading in general (including operator overloading) is a great
feature, but it can be easily abused. I have seen an implementation of a
relational data access layer in C# which overloaded several operators C#
provides to allow the programmer to build queries. It was horrible
because the operators had certain semantics which differed completely from
their "general" semantics.

Phew. I'm glad I didn't inherit support of THAT application!!

RobinS.
GoldMail, Inc.
 
R

RobinS

Michael C said:
I can understand why you don't like it but this is the beauty of C#.
Something like Dim X as Integer is much clearer and easier to read but if
you're doing this as a full time job it's better to have the shorter
syntax. Same applies to implements and inherits keywords.


I'm yet to see a class start with an I so I don't think it's a big deal.


Actually in C# you have the option of calling it BeginEdit or
IEditableObject.BeginEdit. If you use the former then it is available your
objects interface as well as the IEditableObject. If you use the latter
then you need to cast to IEditableObject to call it. Again this is just
the shorthand style of C#.


I'm not sure += is ideal but I really don't like AddHandler at all. It
hides the fact that you're adding something to a list and gives a second
way to do the same thing.


That isn't easy in C#. :)


You might change your mind after working more with C#. I've got to like
the shorthand style of C# and really don't like all the extra typing in
VB.

Michael

I've been doing C# for over a year now. I type 120 wpm, so the extra words,
which provide more clarity, would not be a problem for me. :)

RobinS.
GoldMail, Inc.
 
R

RobinS

Herfried K. Wagner said:
Especially with VB 2008 I don't think there is a significant amount of
extra keystrokes necessary to archieve the same goal as in C# because of
keyword IntelliSense and automatic code generation.

Yeah. VB practically finishes your sentences for you!

RobinS.
GoldMail, Inc.
 
T

Tom Shelton

I can't say I'm a big fan of that myself. Too easy to get the wrong one I
reckon :)

I like doing that, never had a problem yet :)
I'm not sure I like all these new changes they're making. That doesn't seem
much different from just having a public var.

How? it is exactly the same as what I did above, it's just that the
compiler generates the backing store for you. It saves some typing,
that's all. If you need to do more then that, then you have to go back
to the traditional format.
 
H

Herfried K. Wagner [MVP]

Tom Shelton said:
How? it is exactly the same as what I did above, it's just that the
compiler generates the backing store for you. It saves some typing,
that's all. If you need to do more then that, then you have to go back
to the traditional format.

A code snippet could save more typing and will add the implementation code
automatically without the requirement of lots of additional keystrokes. I
don't like the shorthand syntax for properties because it will require
additional work validation code has to be added in the future.
 
T

Tom Shelton

A code snippet could save more typing and will add the implementation code
automatically without the requirement of lots of additional keystrokes. I
don't like the shorthand syntax for properties because it will require
additional work validation code has to be added in the future.

That large majority of properties do not do anything other then get/set a
value. Adding an implementation, yes would require more typing in the
future - but, isn't likely to happen anyway. One side effect of this is
that when a property is implemented in this way, then even the class it
is in must go through the property to access the value (because you
don't know what the value is called anyway). That's something I've
always wanted to do anyway, so this is a partial solution :)

Don't worry - I'm sure VB will get this feature in the next release :)
 
H

Herfried K. Wagner [MVP]

Tom --

Tom Shelton said:
That large majority of properties do not do anything other then get/set a
value. Adding an implementation, yes would require more typing in the
future - but, isn't likely to happen anyway. One side effect of this is
that when a property is implemented in this way, then even the class it
is in must go through the property to access the value (because you
don't know what the value is called anyway). That's something I've
always wanted to do anyway, so this is a partial solution :)

I do not access the "backing field" except in the property's 'Set' and 'Get'
parts too.
Don't worry - I'm sure VB will get this feature in the next release :)

I do not worry, I simply do not request this feature ;-).
 
M

Michael C

Tom Shelton said:
I like doing that, never had a problem yet :)

I agree these things rarely turn out to be a problem. When they are the
problem is very obvious (instant stack overflow). I still don't like it
myself :)
How? it is exactly the same as what I did above, it's just that the
compiler generates the backing store for you. It saves some typing,
that's all. If you need to do more then that, then you have to go back
to the traditional format.

Technically I don't think it's possible to pick a fault with it except for
the fact that we now have another way to do thing to add potential
confusion.

Michael
 
T

Tom Shelton

I agree these things rarely turn out to be a problem. When they are the
problem is very obvious (instant stack overflow). I still don't like it
myself :)

That's cool. I'm just weird that way...
Technically I don't think it's possible to pick a fault with it except for
the fact that we now have another way to do thing to add potential
confusion.

Again, that's fine. I personally like the feature :)
 
S

Scott M.

The point is we were up and writing code in 1 single day and in addition
to that we did some actual work in that day. I really don't see the issue.

My point is that if you don't know all the facets to the language, then "up
and writing code" could also mean that you've got poorly written code. But,
you wouldn't even know it.

Heck, you can write bad code in any language - that doesn't mean that you
"know" that language.

Also, when you say that you all had a laugh about how much of a non-issue it
was to switch, but yet admit that you don't really know all the facets of
the language, it strikes me as odd.
 

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

Top