I've Had Enough

C

C# Learner

I've had enough of C#. I've had enough of using parentheses for every
'if' statement. I've had enough of having to mix assignment of return
value of methods with flow control, making writing code that's both
readable and consistent, impossible.

C# is hindered by its predecessors and the Microsoft marketing
department. If Anders had his way, this language would be a one where
readable code isn't a near impossibility for non-trivial code; but no,
Microsoft marketing and C++/Java got in his way. The evidence is
blatently apparent in the language.

Microsoft, the company where money comes before technology, has struck
again. The repercussions affect us all.
 
D

Daniel Pratt

Hi C# Learner,

C# Learner said:
I've had enough of C#. I've had enough of using parentheses for every
'if' statement. I've had enough of having to mix assignment of return
value of methods with flow control, making writing code that's both
readable and consistent, impossible.

C# is hindered by its predecessors and the Microsoft marketing
department. If Anders had his way, this language would be a one where
readable code isn't a near impossibility for non-trivial code; but no,
Microsoft marketing and C++/Java got in his way. The evidence is
blatently apparent in the language.

Microsoft, the company where money comes before technology, has struck
again. The repercussions affect us all.

No language that I've encountered would I consider perfect. Not even
close. Any language that I've seen is either filled with compromises or is
practically useless (or both). Have you found a language you like better, or
are you considering another vocation?

Regards,
Daniel
 
C

C# Learner

Daniel said:
Hi C# Learner,


No language that I've encountered would I consider perfect.

I feel the same :)
Not even
close. Any language that I've seen is either filled with compromises or is
practically useless (or both). Have you found a language you like better, or
are you considering another vocation?

I've been a Delphi person for some years. Delphi's a language that, I
feel, makes writing clear code easy, and writing hard-to-read code
difficult. With that said, I don't feel Delphi is perfect.

I'm thinking of giving Delphi 8 (for .NET) a spin. Though there is a
problem with that (IMO): it allows global data/routines :(

C# is a nice language in some ways, but it's too inhibited by
C/C++/Java, IMO.

I think that the ideal language would combine the best parts of C# and
Delphi.

I may, at some point in the future, design such a language mainly for
fun, and perhaps even make an MSIL compiler for it. It'd probably be a
massive waste of time though, in the larger scale of things.
 
T

Trevor

C# Learner said:
I feel the same :)


I've been a Delphi person for some years. Delphi's a language that, I
feel, makes writing clear code easy, and writing hard-to-read code
difficult. With that said, I don't feel Delphi is perfect.

I'm thinking of giving Delphi 8 (for .NET) a spin. Though there is a
problem with that (IMO): it allows global data/routines :(

C# is a nice language in some ways, but it's too inhibited by
C/C++/Java, IMO.

I think that the ideal language would combine the best parts of C# and
Delphi.

I may, at some point in the future, design such a language mainly for
fun, and perhaps even make an MSIL compiler for it. It'd probably be a
massive waste of time though, in the larger scale of things.

"Different strokes for different folks". While you find Delphi readable
and C style (based on C syntax - i.e., C, C++, Java, C#) code unreadable, I
find Delphi code unreadable. There isn't much you can do except find a
language that you are comfortable with and stick to it.
 
M

Max Power

I've had enough of C#. I've had enough of using parentheses for every
'if' statement. I've had enough of having to mix assignment of return
value of methods with flow control, making writing code that's both
readable and consistent, impossible.

C# is hindered by its predecessors and the Microsoft marketing
department. If Anders had his way, this language would be a one where
readable code isn't a near impossibility for non-trivial code; but no,
Microsoft marketing and C++/Java got in his way. The evidence is
blatently apparent in the language.

Microsoft, the company where money comes before technology, has struck
again. The repercussions affect us all.


Actually, C#/C++/Java were developed by nerds. The real problem is nerds,
not MS. ;-)
 
J

Jon Skeet [C# MVP]

C# Learner said:
I've had enough of C#. I've had enough of using parentheses for every
'if' statement. I've had enough of having to mix assignment of return
value of methods with flow control, making writing code that's both
readable and consistent, impossible.

So use VB.NET instead - there's very little not to, if you don't like C
style syntax.

Why get annoyed by a language (and moan in an unconstructive way to
those who *do* like it) when there's a perfectly viable alternative?

Personally I'm very happy that C# is just the way it is, and wouldn't
like it to be any more like VB.NET (aside from having named indexers).
Isn't it a good thing that each of us can have a language which works
the way we want?
 
C

C# Learner

Jon said:
So use VB.NET instead - there's very little not to, if you don't like C
style syntax.

Well, that thought did pass through my mind; but then, it's too VB-ish
for my liking.

I /do/ understand that VB.NET is just an interface to MSIL, as is C#,
but I s'pose I'm prejudiced when it comes to anything VB or VB-like :p

There are more important reasons, though, that I mention in a moment.
Why get annoyed by a language (and moan in an unconstructive way to
those who *do* like it)

I s'pose I'm just interested in people's views on this.
when there's a perfectly viable alternative?

The thing with C# is that it's *the* programming language for .NET (or,
at least, I think so). I think that whenever a new feature is added to
the framework, C# will be the first to get it. C# will be the one that
sticks around longer. C# is the one that has more use in the industry,
and is more widely-used in general. etc.
Personally I'm very happy that C# is just the way it is, and wouldn't
like it to be any more like VB.NET (aside from having named indexers).

There are parts of C# that I like, but some parts are so annoying. The
most annoying and anti-readability element of any C-like language, in my
opinion, is the 'return' construct.

Here's an example of some code that demonstrates my point:

FontTagElement GetFontTagElement()
{
//...

if (length == SingleElementPartCount) {
if (arr[FirstIndex] == FontNameSpecifier) {
string name = arr[FirstIndex];
return new FontTagElement(name);
} else {
int size = TryStringToInt(arr[FirstIndex]);
return new FontTagElement(size);
}
} else if (length == DualElementPartCount) {
string name = arr[FirstIndex];
int size = TryStringToInt(arr[SecondIndex]);

return new FontTagElement(name, size);
} else {
return null;
}
}

To be consistent with simpler uses of 'return', the above code should be
re-written as:

FontTagElement GetFontTagElement()
{
//...

if (length == SingleElementPartCount) {
if (arr[FirstIndex] == FontNameSpecifier) {
string name = arr[FirstIndex];
return new FontTagElement(name);
}
int size = TryStringToInt(arr[FirstIndex]);
return new FontTagElement(size);
}
if (length == DualElementPartCount) {
string name = arr[FirstIndex];
int size = TryStringToInt(arr[SecondIndex]);

return new FontTagElement(name, size);
}
return null;
}

So one can choose either readability or consistency, but not both.

Here's the above slightly changed to show a more Delphi-like returning
construct:

FontTagElement GetFontTagElement()
{
//...

if (length == SingleElementPartCount) {
if (arr[FirstIndex] == FontNameSpecifier) {
string name = arr[FirstIndex];
result = new FontTagElement(name);
} else {
int size = TryStringToInt(arr[FirstIndex]);
result = new FontTagElement(size);
}
} else if (length == DualElementPartCount) {
string name = arr[FirstIndex];
int size = TryStringToInt(arr[SecondIndex]);

result = new FontTagElement(name, size);
} else {
result = null;
}
}

Voilà -- no loss of readability and no inconsistency!
Isn't it a good thing that each of us can have a language which works
the way we want?

That sounds great. If I ever believe to have found such a language,
I'll be sure to let the group know :p
 
R

Reginald Blue

C# Learner said:
I've been a Delphi person for some years. Delphi's a language that, I
feel, makes writing clear code easy, and writing hard-to-read code
difficult. With that said, I don't feel Delphi is perfect.

I'm thinking of giving Delphi 8 (for .NET) a spin. Though there is a
problem with that (IMO): it allows global data/routines :(

The one nice thing about .NET is that it allows for you to code in
"Delphi.NET" and someone to use your work in C# or whatever.

FYI:

http://www.gotdotnet.com/team/lang/

Lists all of the .NET languages that people are working on.

Supposedly here is the pascal work:

http://www.citi.qut.edu.au/research/plas/projects/cp_files/ComponentPascal.html

But their web site doesn't respond.

There may be one other Pascal.NET project out there somewhere.

Just promise us that you won't start coding in Cobol.NET.

--
Reginald Blue
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my
telephone."
- Bjarne Stroustrup (originator of C++) [quoted at the 2003
International Conference on Intelligent User Interfaces]
 
P

Philip Rieck

The thing with C# is that it's *the* programming language for .NET (or,
at least, I think so). I think that whenever a new feature is added to
the framework, C# will be the first to get it. C# will be the one that
sticks around longer. C# is the one that has more use in the industry,
and is more widely-used in general. etc.

Like edit and continue? VB.net got there first, after the CLR put in
support.

Like Generics? Both languages have support.

Like named indexers? VB has had it from the beginning.. C# still doesn't.

I'd disagree completely with the fact that C# is *the* language. I prefer
it in most cases, but that's no gague of which language is "it". .net is
specifically designed so that no one language is "it"..... other than MSIL.
And in fact no one language can utilize all capabilities of the CLR (other
than IL.)

I also disagree with the industry. Many places are going VB.NET because of
the number of VB and ASP developers they are retraining.
There are parts of C# that I like, but some parts are so annoying. The
most annoying and anti-readability element of any C-like language, in my
opinion, is the 'return' construct.
[...snip, as it's not's important]
Here's the above slightly changed to show a more Delphi-like returning
construct:

FontTagElement GetFontTagElement()
{
//...

if (length == SingleElementPartCount) {
if (arr[FirstIndex] == FontNameSpecifier) {
string name = arr[FirstIndex];
result = new FontTagElement(name);
} else {
int size = TryStringToInt(arr[FirstIndex]);
result = new FontTagElement(size);
}
} else if (length == DualElementPartCount) {
string name = arr[FirstIndex];
int size = TryStringToInt(arr[SecondIndex]);

result = new FontTagElement(name, size);
} else {
result = null;
}
}

Voilà -- no loss of readability and no inconsistency!


Why not do this yourself? put "return result" at the end, as many people
would recommend you do anyway? (In fact, many would say that you have much
too much control flow in this one function anyway) C# lets you do this, but
doesn't treat "result" as a keyword. Its sparseness of keywords is a
feature, if you ask me --- not a problem.

That sounds great. If I ever believe to have found such a language,
I'll be sure to let the group know :p

So create one. The compiler services in the FCL are more than adequate.
 
T

Tim Jarvis

C# Learner said:
if (length == SingleElementPartCount) {
if (arr[FirstIndex] == FontNameSpecifier) {
string name = arr[FirstIndex];
return new FontTagElement(name);
} else {
int size = TryStringToInt(arr[FirstIndex]);
return new FontTagElement(size);
}
} else if (length == DualElementPartCount) {
string name = arr[FirstIndex];
int size = TryStringToInt(arr[SecondIndex]);

return new FontTagElement(name, size);
} else {
return null;
}
}

Maybe I'm missing something here, but wouldn't the addition of just a
couple of lines of code, give you the intermediate Result variable and
the readability that you want.

I.e.

FontTagElement Result = null;
if (length == SingleElementPartCount)
{
if (arr[FirstIndex] == FontNameSpecifier)
{
string name = arr[FirstIndex];
result = new FontTagElement(name);
}
else
{
int size = TryStringToInt(arr[FirstIndex]);
result = new FontTagElement(size);
}
}
else
{
if (length == DualElementPartCount)
{
string name = arr[FirstIndex];
int size = TryStringToInt(arr[SecondIndex]);

result = new FontTagElement(name, size);
}
}
return Result;

Rgds Tim.
 
C

Chris A. R.

// Here is a *Very* common C/C++ pattern used for returning a
// value in a single place withing a method. If you prefer this kind of
// readability, then go ahead and use it. But you won't be unique in
this.

FontTagElement GetFontTagElement()
{
FontTagElement result;
//...

if (length == SingleElementPartCount) {
if (arr[FirstIndex] == FontNameSpecifier) {
string name = arr[FirstIndex];
result = new FontTagElement(name);
} else {
int size = TryStringToInt(arr[FirstIndex]);
result = new FontTagElement(size);
}
} else if (length == DualElementPartCount) {
string name = arr[FirstIndex];
int size = TryStringToInt(arr[SecondIndex]);

result = new FontTagElement(name, size);
} else {
result = null;
}
return result;
}

Chris A.R.

C# Learner said:
Jon said:
So use VB.NET instead - there's very little not to, if you don't like C
style syntax.

Well, that thought did pass through my mind; but then, it's too VB-ish
for my liking.

I /do/ understand that VB.NET is just an interface to MSIL, as is C#,
but I s'pose I'm prejudiced when it comes to anything VB or VB-like :p

There are more important reasons, though, that I mention in a moment.
Why get annoyed by a language (and moan in an unconstructive way to
those who *do* like it)

I s'pose I'm just interested in people's views on this.
when there's a perfectly viable alternative?

The thing with C# is that it's *the* programming language for .NET (or,
at least, I think so). I think that whenever a new feature is added to
the framework, C# will be the first to get it. C# will be the one that
sticks around longer. C# is the one that has more use in the industry,
and is more widely-used in general. etc.
Personally I'm very happy that C# is just the way it is, and wouldn't
like it to be any more like VB.NET (aside from having named indexers).

There are parts of C# that I like, but some parts are so annoying. The
most annoying and anti-readability element of any C-like language, in my
opinion, is the 'return' construct.

Here's an example of some code that demonstrates my point:

FontTagElement GetFontTagElement()
{
//...

if (length == SingleElementPartCount) {
if (arr[FirstIndex] == FontNameSpecifier) {
string name = arr[FirstIndex];
return new FontTagElement(name);
} else {
int size = TryStringToInt(arr[FirstIndex]);
return new FontTagElement(size);
}
} else if (length == DualElementPartCount) {
string name = arr[FirstIndex];
int size = TryStringToInt(arr[SecondIndex]);

return new FontTagElement(name, size);
} else {
return null;
}
}

To be consistent with simpler uses of 'return', the above code should be
re-written as:

FontTagElement GetFontTagElement()
{
//...

if (length == SingleElementPartCount) {
if (arr[FirstIndex] == FontNameSpecifier) {
string name = arr[FirstIndex];
return new FontTagElement(name);
}
int size = TryStringToInt(arr[FirstIndex]);
return new FontTagElement(size);
}
if (length == DualElementPartCount) {
string name = arr[FirstIndex];
int size = TryStringToInt(arr[SecondIndex]);

return new FontTagElement(name, size);
}
return null;
}

So one can choose either readability or consistency, but not both.

Here's the above slightly changed to show a more Delphi-like returning
construct:

FontTagElement GetFontTagElement()
{
//...

if (length == SingleElementPartCount) {
if (arr[FirstIndex] == FontNameSpecifier) {
string name = arr[FirstIndex];
result = new FontTagElement(name);
} else {
int size = TryStringToInt(arr[FirstIndex]);
result = new FontTagElement(size);
}
} else if (length == DualElementPartCount) {
string name = arr[FirstIndex];
int size = TryStringToInt(arr[SecondIndex]);

result = new FontTagElement(name, size);
} else {
result = null;
}
}

Voilà -- no loss of readability and no inconsistency!
Isn't it a good thing that each of us can have a language which works
the way we want?

That sounds great. If I ever believe to have found such a language,
I'll be sure to let the group know :p
 
T

Tim Jarvis

Chris said:
// Here is a Very common C/C++ pattern used for returning a
// value in a single place withing a method. If you prefer this
kind of // readability, then go ahead and use it. But you won't
be unique in this.

FontTagElement GetFontTagElement()
{
FontTagElement result;
//...

if (length == SingleElementPartCount) {
if (arr[FirstIndex] == FontNameSpecifier) {
string name = arr[FirstIndex];
result = new FontTagElement(name);
} else {
int size = TryStringToInt(arr[FirstIndex]);
result = new FontTagElement(size);
}
} else if (length == DualElementPartCount) {
string name = arr[FirstIndex];
int size = TryStringToInt(arr[SecondIndex]);

result = new FontTagElement(name, size);
} else {
result = null;
}
return result;
}

Chris A.R.


LOL.....snap.
 
T

Tim Jarvis

Tim Jarvis wrote:

Maybe I'm missing something here, but wouldn't the addition of just a
couple of lines of code, give you the intermediate Result variable and
the readability that you want.

I.e.

FontTagElement Result = null;
if (length == SingleElementPartCount)
{
if (arr[FirstIndex] == FontNameSpecifier)
{
string name = arr[FirstIndex];
result = new FontTagElement(name);
}
else
{
int size = TryStringToInt(arr[FirstIndex]);
result = new FontTagElement(size);
}
}
else
{
if (length == DualElementPartCount)
{
string name = arr[FirstIndex];
int size = TryStringToInt(arr[SecondIndex]);

result = new FontTagElement(name, size);
}
}
return Result;

Rgds Tim.

Although, please excuse the brain dead casing.... :-(
 
T

Tom

After reading your response, Mr C# Learner, I'm convinced you're smoking
crack. I don't find any of your code snippets to be particularly readable
nor significantly different nor unusable in current C#. I don't happen to
like your layout choices as far as brackets, but your either of your first
two layout choices would work.

You are, of course always at liberty to switch to Delphi.NET. However, my
advice would be to refrain from commenting about your perceived detriments
in C# in a C# newsgroup.



Tom
 
T

Tim Jarvis

C# Learner wrote:

I'm thinking of giving Delphi 8 (for .NET) a spin. Though there is a
problem with that (IMO): it allows global data/routines :(

What does that mean ? "Global data/routines", curious is all.

For what it is worth, I hold the same opinion as you, in that I don't
think that there is a perfect .NET language out there.

I guess I am lucky in that I have 5 .NET languages (and their IDE's) on
my desktop, actually 6 if you count ILASM. 3 of those I know quite well
and 2 I don't use much, but have on occasion. (see who can name the 5)

I think it comes down to personal preference, and to be frank, unless
as you say, you are willing to roll your own, if you want to do .NET
coding, you will just have to choose one (or mix them) that will get
the job done.

Cheers Tim.
 
C

C# Learner

Philip Rieck wrote:

[...]
So create one. The compiler services in the FCL are more than adequate.

A problem I see here with creating a new language is that I'd probably
also want to create an IDE for it, if I were looking to use the language
to write GUI applications in, using a form designer.

That'd make it:

- design language;
- create compiler; and
- create IDE.

I'd imagine creating an IDE for it would be extremely time-consuming.
 
C

C# Learner

Reginald said:
C# Learner said:
I've been a Delphi person for some years. Delphi's a language that, I
feel, makes writing clear code easy, and writing hard-to-read code
difficult. With that said, I don't feel Delphi is perfect.

I'm thinking of giving Delphi 8 (for .NET) a spin. Though there is a
problem with that (IMO): it allows global data/routines :(

The one nice thing about .NET is that it allows for you to code in
"Delphi.NET" and someone to use your work in C# or whatever.

FYI:

http://www.gotdotnet.com/team/lang/

[...]

Interesting, thanks!
 
C

C# Learner

Tim said:
What does that mean ? "Global data/routines", curious is all.

Meaning that one can create global variables and routines (procedures or
functions) in the way that one can in C++, for example.

i.e.:

void Foo() // global, declared outside of a class
{
}

class Class
{
void Foo() // non-global - a member of a class
{
}
}
 
C

C# Learner

Chris said:
// Here is a *Very* common C/C++ pattern used for returning a
// value in a single place withing a method. If you prefer this kind of
// readability, then go ahead and use it. But you won't be unique in
this.

FontTagElement GetFontTagElement()
{
FontTagElement result;
//...

if (length == SingleElementPartCount) {
if (arr[FirstIndex] == FontNameSpecifier) {
string name = arr[FirstIndex];
result = new FontTagElement(name);
} else {
int size = TryStringToInt(arr[FirstIndex]);
result = new FontTagElement(size);
}
} else if (length == DualElementPartCount) {
string name = arr[FirstIndex];
int size = TryStringToInt(arr[SecondIndex]);

result = new FontTagElement(name, size);
} else {
result = null;
}
return result;
}

Hi Chris,

Yes, this is what I often do, but I get blasted by C# gurus for doing
this, who tell me, "This is C#, not Delphi!"

For clarification, the difference with Delphi's returning mechanism is
that there's no need to declare the result variable, and no need to use
'return result;'.
 
G

Guest

I also disagree with the industry. Many places are going VB.NET because o
the number of VB and ASP developers they are retraining

terrible. generally speaking, I'd have more faith in Java & C developers than VB and ASP people. having experienced frustration of working with these VB and ASP people.
 

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