C# - just making an observation
-
Not to start a flame war, I am simply relating my recent personal experience... So, over the last couple of years, I've forayed into Ruby, PHP, very recently Java, and this coming from a background of C, C++, Pascal, Fortran, even some COBOL, and of course assembly language and some things I don't or don't want to remember (BASIC, LISP and Forth come to mind.) In terms of "modern" programming languages, and especially after my recent foray in Java (granted, version 7, so I'm not able to take advantage of lambdas) I have come to the conclusion that, frankly, C# is the most elegant and well crafted language I've ever worked with. Yeah, I remember the C# 1.0 days when I was cursing the lack of templates/generics and the idiocy of single inheritance, but no more. I find that code that I write in C# can be elegant, well crafted, expressive, and just a pleasure to write. I don't have that experience with other languages, except perhaps for F#, once I get into the rhythm of FP. Marc
Imperative to Functional Programming Succinctly Higher Order Programming
I concur. I started on Assembler and FORTRAN, added Pascal, PL/1 and COBOL then on to C and C++ with a side order of umpteen variants of BASIC along with Rexx and some other scripting languages. I moved to C# when it was version 1.0 and railed against it's limitations while liking it's ease of use. With 3.0 it finally started being really useful. Like Griffy-babe says, it's become easier to abuse it with var, etc. - but I don't, and my team doesn't - we are like-minded, thank goodness - so most of the time, everything is peachy! C# - an exercise in trying to design the ideal multipurpose language that [almost] works perfectly. Well done Microsoft! ...in this particular instance.
- I would love to change the world, but they won’t give me the source code.
-
Marc Clifton wrote:
frankly, C# is the most elegant and well crafted language I've ever worked with
Yes, it is. Even though I still miss a QUICK compiler like Delphi had (and sometimes a linker), and aw, the joy of compiling your own VCL. Being able to allocate and deallocate by hand also seemed to be better than having the memory fill up until some lowpriority thread halts your app and starts cleaning up - even though NET4 does a good job at it, I'd rather still be doing it myself.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
I agree - but it does mean it's a lot harder to get leaky programs. Not impossible, but a lot harder. You remember what it was like before C# - morons not releasing memory until the whole PC judders to a halt... X|
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
-
I concur. I started on Assembler and FORTRAN, added Pascal, PL/1 and COBOL then on to C and C++ with a side order of umpteen variants of BASIC along with Rexx and some other scripting languages. I moved to C# when it was version 1.0 and railed against it's limitations while liking it's ease of use. With 3.0 it finally started being really useful. Like Griffy-babe says, it's become easier to abuse it with var, etc. - but I don't, and my team doesn't - we are like-minded, thank goodness - so most of the time, everything is peachy! C# - an exercise in trying to design the ideal multipurpose language that [almost] works perfectly. Well done Microsoft! ...in this particular instance.
- I would love to change the world, but they won’t give me the source code.
Forogar wrote:
Griffy-babe
Watch it sunshine! :laugh:
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
-
Until VS2008 (more I don't know) I found a flaw that I hate: it is impossible to separate definition and implementation in separate files. Also, it is slow to compile, it uses that crappy .NET framework with the crappier documentation and it is slow to compute unless you fill it up with unsafe. I AM biased because I really need low-level functionalities, the only time I ued C# was to create a VS add-in to view areas of memory as 8 or 16 bit images and apply some algorithms and infinite zoom (with no blurring, must be exactly a pixel per pixel representation). The areas of memory come directly from the VS debugger on a running process, and it has to understand variable names, pointers, raw addresses and some internal data structures. With C# it is painfully slow, where the older counterpart of this add-in, developed in VB6, is fast as a Thunder (btw Thunder WAS the codename of VB6 :D). It has some good points, i like the UI designer and its way of managing events, but stil... I will hate the day we switch off VB6 and turn to C#.
-
Forogar wrote:
Griffy-babe
Watch it sunshine! :laugh:
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
-
Python? It is the slowest language I've ever worked with. And the benchmarks agree[^]: Python is up to 100 times slower than C++ and consumes up to four times more memory.
Perhaps you've never used it... the interpreter is C++... so you can easily code C++ libraries and pull them into Python. Saying it's way slower than what you can use natively is not really knowing the perks of the language.
-
Python? It is the slowest language I've ever worked with. And the benchmarks agree[^]: Python is up to 100 times slower than C++ and consumes up to four times more memory.
Not to insult you (hope not anyway)... but this reminds me of some of the reference material for git that states outrageously wrong information about svn to prove it's better. Whoever wrote that clearly doesn't understand svn. We use python as the glue... guts are highly optimized C++. A lot of python code is set up that way. Of course, if you take pure python and do repetitive tasks without optimization of some sort, it will be as slow as any other interpreted language.
-
Perhaps you've never used it... the interpreter is C++... so you can easily code C++ libraries and pull them into Python. Saying it's way slower than what you can use natively is not really knowing the perks of the language.
Albert Holguin wrote:
Perhaps you've never used it...
I use it daily.
Albert Holguin wrote:
so you can easily code C++ libraries and pull them into Python
That's correct, but then we are comparing C++ to C++, not Python to C++. I am saying (and the benchmarks confirm) that native Python is way slower than C++, even in single-threaded applications. If we include threading, Python is even worse due to the Global Interpreter Lock.
-
Albert Holguin wrote:
Perhaps you've never used it...
I use it daily.
Albert Holguin wrote:
so you can easily code C++ libraries and pull them into Python
That's correct, but then we are comparing C++ to C++, not Python to C++. I am saying (and the benchmarks confirm) that native Python is way slower than C++, even in single-threaded applications. If we include threading, Python is even worse due to the Global Interpreter Lock.
Nemanja Trifunovic wrote:
native Python is way slower than C++
Yeah but I'd argue that it's not typically used that way. To each his own cup of :java: (there's no cup of tea but you know).
-
Are you saying you actually prefer VB6 to C#?!! :omg: :wtf: :confused:
- I would love to change the world, but they won’t give me the source code.
Aye. I'm strange, I know, but it is easier (and faster) to make communications between two native environments than managed-native. Also the easy access to COM, OCX and WinAPI provided with VB is somewhat lacking in C#. For projects that are no more than a boxed set of switches, VB6 is faster and easier. For project a little more complicated, .NET is bloated (to make I-don't-remember-which operation on a bitmap created in memory I would have to pin, extrapolate and use a ton of image converters between Windows.Media.Something.SomethingElse and Windows.Forms.Image forth and back. I solved wrapping GDI calls). Of course this is my opinion, and I'm far from being guru or expert. I just hope that M$ changes its mind and releases a VB7. Native, updated VB6.
-
Not to start a flame war, I am simply relating my recent personal experience... So, over the last couple of years, I've forayed into Ruby, PHP, very recently Java, and this coming from a background of C, C++, Pascal, Fortran, even some COBOL, and of course assembly language and some things I don't or don't want to remember (BASIC, LISP and Forth come to mind.) In terms of "modern" programming languages, and especially after my recent foray in Java (granted, version 7, so I'm not able to take advantage of lambdas) I have come to the conclusion that, frankly, C# is the most elegant and well crafted language I've ever worked with. Yeah, I remember the C# 1.0 days when I was cursing the lack of templates/generics and the idiocy of single inheritance, but no more. I find that code that I write in C# can be elegant, well crafted, expressive, and just a pleasure to write. I don't have that experience with other languages, except perhaps for F#, once I get into the rhythm of FP. Marc
Imperative to Functional Programming Succinctly Higher Order Programming
I agree.
-
I thought that way for a while too, until I had to use it. I wouldn't use it for apps that require heavy computation, but for business apps its nice and much much better than VB.
Jeremy Falcon
Jeremy Falcon wrote:
much much better than VB
Why, I converted to c# about 6 years ago and would not like to go back but that is mainly comfort and familiarity. When I was doing VB I though the same thing about c#, imagine a language that is case sensitive bleh.
Never underestimate the power of human stupidity RAH
-
Jeremy Falcon wrote:
much much better than VB
Why, I converted to c# about 6 years ago and would not like to go back but that is mainly comfort and familiarity. When I was doing VB I though the same thing about c#, imagine a language that is case sensitive bleh.
Never underestimate the power of human stupidity RAH
Well, to be fair, my comparison is really more about the bias I've built up against the typical VB crowd than the language itself. My first language was QBasic. I did a lot of classic VB. Never really had to use VB.NET all too much thankfully. It's a good tool for what it's intended for. But the main reason would be I just don't like the mentality of the typical VBer, which is lazy when it comes to learning how to effectively program. Not all VB devs are like that of course, but you get the idea. I have the same issue with FoxPro devs. I do think C#'s syntax is much cleaner and more elegant though. Which can lead to less typing errors. Which would be enough of a reason for me to choose C# over VB.NET, regardless of the typical VB crowd.
Jeremy Falcon
-
Sorry, DataSets and DataTables need to go - they are the spawn of Beelzebub himself.
Pete O'Hanlon wrote:
DataSets and DataTables need to go - they are the spawn of Beelzebub himself.
I find them (DataTables more so) quite convenient, though I can definitely imagine both simpler and more flexible approaches. As long as we're not treading into dreaded O-R-M territory. ;) Marc
Imperative to Functional Programming Succinctly Higher Order Programming
-
Not to start a flame war, I am simply relating my recent personal experience... So, over the last couple of years, I've forayed into Ruby, PHP, very recently Java, and this coming from a background of C, C++, Pascal, Fortran, even some COBOL, and of course assembly language and some things I don't or don't want to remember (BASIC, LISP and Forth come to mind.) In terms of "modern" programming languages, and especially after my recent foray in Java (granted, version 7, so I'm not able to take advantage of lambdas) I have come to the conclusion that, frankly, C# is the most elegant and well crafted language I've ever worked with. Yeah, I remember the C# 1.0 days when I was cursing the lack of templates/generics and the idiocy of single inheritance, but no more. I find that code that I write in C# can be elegant, well crafted, expressive, and just a pleasure to write. I don't have that experience with other languages, except perhaps for F#, once I get into the rhythm of FP. Marc
Imperative to Functional Programming Succinctly Higher Order Programming
-
_Josh_ wrote:
return to c++
Why am I reminded of Darth Vader? I've been doing some cpp11 work on the Beaglebone, it certainly has changed quite a bit and requires a lot of re-learning on my part. Marc
Imperative to Functional Programming Succinctly Higher Order Programming
-
I thought that way for a while too, until I had to use it. I wouldn't use it for apps that require heavy computation, but for business apps its nice and much much better than VB.
Jeremy Falcon
Jeremy Falcon wrote:
I wouldn't use it for apps that require heavy computation
I ended up re-writing a very computationally heavy app in C# from C++ and was quite surprised that the C# version performed as well, if not better, than the C++ version. Now, granted, I was using STL heavily in C++ and in the C# version, I optimized my data structures so I wasn't manipulating vectors and queues all over the place. Which just goes to show, that performance is less a function of the language than it is of the skill of the programmer. :) It would be interested to see how the code would fare in C++ now with the new data structures, but I'm a bit wary of STL's performance. Marc
Imperative to Functional Programming Succinctly Higher Order Programming
-
Ugh. Is it really that good? I've fiddlyfarted with it here and there, but I've never done any serious work in it. I've been a C++ guy since the 80s (with lots of everything in the interim.) Maybe it's time to suck it up and take a serious bite out of it.
mikepwilson wrote:
Ugh. Is it really that good?
Yeah, I think so. :) I think if I were to identify the features that I find most useful, they would be lambda expressions, anonymous methods, the Func<> and Action<> classes, and reflection. I stay away from "var" and LINQ can be useful but I usually prefer using the extension methods directly instead. There's a lot I have dived into to fully appreciate -- covariance and contravariance, for example, but the type inference is damn impressive. Marc
Imperative to Functional Programming Succinctly Higher Order Programming
-
:thumbsup: I started in BASIC back in the 80's, and made my way through C, Perl, Java, and some dabbling in TCL and Python... But I haven't found anything better than C#. Granted, Visual Studio has something to do with that... Haven't found a better IDE anywhere. The others I've tried all feel clumsy and weak. Well, I mean, Unity is several kinds of awesome, but that's a little different. Now if only they would switch Excel's scripting interface from VBA to .NET, I could stop hating MS Office too.
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels)Ian Shlasko wrote:
Haven't found a better IDE anywhere
The only IDE that comes close is the one made by JetBrains, which I use a lot for Ruby and Java stuff. Marc
Imperative to Functional Programming Succinctly Higher Order Programming
-
Until VS2008 (more I don't know) I found a flaw that I hate: it is impossible to separate definition and implementation in separate files. Also, it is slow to compile, it uses that crappy .NET framework with the crappier documentation and it is slow to compute unless you fill it up with unsafe. I AM biased because I really need low-level functionalities, the only time I ued C# was to create a VS add-in to view areas of memory as 8 or 16 bit images and apply some algorithms and infinite zoom (with no blurring, must be exactly a pixel per pixel representation). The areas of memory come directly from the VS debugger on a running process, and it has to understand variable names, pointers, raw addresses and some internal data structures. With C# it is painfully slow, where the older counterpart of this add-in, developed in VB6, is fast as a Thunder (btw Thunder WAS the codename of VB6 :D). It has some good points, i like the UI designer and its way of managing events, but stil... I will hate the day we switch off VB6 and turn to C#.
den2k88 wrote:
it is slow to compile,
Odd, I find quite the opposite to be the case.
den2k88 wrote:
it uses that crappy .NET framework
While there's some things about the framework I am happy to b*tch about, for the most part, I think it's pretty damn impressive.
den2k88 wrote:
it is slow to compute unless you fill it up with unsafe.
Again, not in my experience. I've written some very computationally intensive stuff in C# and have been very pleased with the performance.
den2k88 wrote:
because I really need low-level functionalities
Well, true -- for bit banging on hardware ports, definitely C, C++ or even assembly is the way to go. Marc
Imperative to Functional Programming Succinctly Higher Order Programming