473,836 Members | 2,132 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I've Had Enough

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.
Nov 16 '05
101 4005
Tim Jarvis wrote:
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.


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
{
}
}
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.

Nov 16 '05 #31
Chris A. R. wrote:
// 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 GetFontTagEleme nt()
{
FontTagElement result;
//...

if (length == SingleElementPa rtCount) {
if (arr[FirstIndex] == FontNameSpecifi er) {
string name = arr[FirstIndex];
result = new FontTagElement( name);
} else {
int size = TryStringToInt( arr[FirstIndex]);
result = new FontTagElement( size);
}
} else if (length == DualElementPart Count) {
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;'.
Nov 16 '05 #32
> 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.
Nov 16 '05 #33
Max Power wrote:
C# Learner <cs****@learner .here> wrote in news:#g9rpoAHEH A.2576
@TK2MSFTNGP11.p hx.gbl:

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. ;-)


"Very nice" *NERDS* definitions :)

http://www.urbandictionary.com/define.php?term=nerd&f=1
http://www.hyperdictionary.com/search.aspx?define=nerd
http://www.computeruser.com/resource...ml?lookup=2995

Marcin
Nov 16 '05 #34
Jon Skeet [C# MVP] wrote:
C# Learner <cs****@learner .here> wrote:
Out of interest, then, which of the top two code snippets would you go
for, only taking into account the code around the 'return' statements?
I think I'd use the first one, with the else clause.


Okay.
However, I'd recode the first part to:

if (length==Single ElementPartCoun t)
{
string name = arr[FirstIndex];
if (name==FontName Specifier)
{
return new FontTagElement( name);
}
else
{
int size = TryStringToInt( name);
return new FontTagElement( size);
}
}

etc

In fact, I'd probably end up declaring name right at the top, as it's
such a common expression in your code.


Oops, yes! Looking back on it, I can't've been fully awake when I wrote
that method :-)

Regards,
Tom
Nov 16 '05 #35
C# Learner wrote:
Tim Jarvis wrote:
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
{
}
}


I guess this just shows the language's heritage, in fact just like C++,
Delphi is not a "pure" oo language as it is an evolution from pascal (
like C++ is from C )

note, you don't have to write those non class/object routines though ;-)

Rgds Tim.
Nov 16 '05 #36
C# Learner wrote:
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;'.


It is important to note though, In Delphi the variable is actually
implicitly declared in every function and only when you have the
extended syntax enabled ($X+) although it is true this is the default,
so many programmers may not even realise that they have the extended
syntax on.

I said in another thread about how language preferences are a very
subjective thing, this feature that you miss in C#, is exacly the thing
that a guy I used to work with hated in Delphi, he hated the fact that
a variable was being declared for him in a hidden way...I must admit, I
haven't even given it a second thought in C#, I just accepted the C#
way of doing things, personally this type of issue for me is a very
minor thing, The thing that sometimes slows me down is I still find
myself thinking about doing things in the "Delphi way", but to be
honest this is more a VCL v's .NET framework thing rather than a
language thing in most cases.

Rgds Tim.

Nov 16 '05 #37
C# Learner wrote:

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.


I'll take the language any day. It is their sucky, buggy, deficient IDE that
gets my goat, day after day.

So far, their IDE can handle "hello world" class projects, but not much more...
Nov 16 '05 #38
Tim Jarvis wrote:
C# Learner wrote:
Tim Jarvis wrote:
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
{
}
}


I guess this just shows the language's heritage, in fact just like C++,
Delphi is not a "pure" oo language as it is an evolution from pascal (
like C++ is from C )


Also, I think some "old-school" Delphites might still want to use global
data/routines, and, secondly, this feature would seemingly help for when
converting to Delphi 8 code from older Delphi code.
note, you don't have to write those non class/object routines though ;-)


I guess I'm just concerned that if it's possible, lots of people will do
it :-) If there's a way, there's a will ;-))

Regards
Nov 16 '05 #39
Julie wrote:
I'll take the language any day. It is their sucky, buggy, deficient IDE that
gets my goat, day after day.

So far, their IDE can handle "hello world" class projects, but not much more...


The IDE seems pretty solid to me; but I guess it could be a case of
different machines, different setups, etc.

How about a deal: you take the language and I take the IDE ;-P
Nov 16 '05 #40

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

123
4013
by: C# Learner | last post by:
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...
8
270
by: Simon | last post by:
I've had enough of C# Learner. I've had enough of his complaining about using parentheses for every 'if' statement. I've had enough of his complaining about having to mix assignment of return value of methods with flow control, making writing code that's both readable and consistent, impossible. C# Learner is hindered by his complainging about C# being hindered by its predecessors and the Microsoft marketing department. If C# Learner...
0
9810
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10821
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10527
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10575
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10241
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5642
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4443
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4001
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3102
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.