C# In-Depth
Bergkamp10 from ComputerWorld writes "Microsoft's leader of C# development, writer of the Turbo Pascal system, and lead architect on the Delphi language, Anders Hejlsberg, reveals all there is to know on the history, inspiration, uses and future direction of one of computer programming's most widely used languages — C#. Hejlsberg also offers some insight into the upcoming version of C# (C#4) and the new language F#, as well as what lies ahead in the world of functional programming."
Why must they make me trawl through 8 pages of ads?
Give a man a fire and he's warm for a day. Light a man on fire and he's warm for the rest of his life. - Terry Pratchett
I beg you to use this link instead of flipping thru all 8 pages
I am a sad case and find much amusement in the fact that the "correct" name for the # symbol is octothorpe, which means "C#" should not be pronounced "C-sharp" but Coctothorpe.
Imagine my joy on discovering that they've scoured the alphabet and have managed to find a new initial letter that makes an even funnier name.
Ladies and gentlemen, let us welcome the new language, F# or Foctothorpe.
Could it be that C# is one of the most widely used simply because of the installed base of windoze machines all over the world and not because of any technical merit? Most current languages have compilers and interpreters that run on windoze; what makes people choose C# over the others? Just how much impact has C# had on computing sciences as a whole, anyway?
>>one of computer programming's most widely used languages.
I highly doubt that a language that has only been around for a few years is the most "widely" used computer language. Cobol, fortran, or standard C , maybe.
Really? Is that actually true? I thought it was still relatively obscure. I'm not sure I've ever even met more then a handful of people who have done any real work with it. Am I just totally out of the loop? Has C# truly surpassed C, C++ and Java?
They should really have called the successor E#
Today's weirdness is tomorrow's reason why. -- Hunter S. Thompson
"Microsoft's leader of C# development, writer of the Turbo Pascal system, and lead architect on the Delphi language..."
Well, that explains everything. Turbo Pascal was the source of endless problems on the PC, and not just because it was really "Turbo Something Kind Of Like Pascal". It seemed like 90% of the time when I came across a badly behaved application that ignored command line redirects because it went straight to the BIOS just to write its copyright banner, and wouldn't run on anything but a perfect clone, or wouldn't run under DoubleDOS, or (later) required the most stringent DOS emulation under Windows, it was in Turbo Pascal.
Why anyone thought that was a good thing to happen by default, I don't know, but it drove me bonkers. No wonder C# and .NET is its own little universe that only deals with other software at the end of a ten foot pole.
It's closer to Java than C++. Much closer. Would you call Java a 'slightly altered and nonstandard and proprietary' version of C++?
Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
I'm curious, what gives you the idea that C# fragmented "the whole programming scene"? As far as I can tell, C# has really just replaced C++ on the Windows client side, where Java never had a foothold to begin with.
So, where is this fragmentation you speak of?
I think C# is one of the better languages I have used. I think M$ has done a good job (as they usually do) of stealing the concept and making it easier for the user (in this case, developer). I do understand that as far as M$ is concerned, it is only meant for Windows. However, that does not diminish the fact that it is a good language. I have friend who work solely on Java. Their target deployment servers are linux. But they do all their development on Windows.
The Roctothorpe!
*insert headbanging graphic here*
Either a troll, flamebait, or spoken in ignorance.
Languages evolve, and anyone that knows c++ and c# knows that what you have stated is patently untrue. Not interested? Then don't bother, but until you do your research, please refrain from throwing in your apparent 2 cents worth...it's not really worth that much.
As has been stated already, the CLR is in fact a standard, and c# has more in common with Java than with c++. It's an evolutionary language, and it is very popular for a lot of very good reasons. But you'd know that if you cared to bother looking into it.
No Comment.
Perhaps you meant C++/CLI?
Well there is fragmentation produces as they introduce YET another language.
You currently cannot say C# replaces C++ on Windows platform as using any DirectX components for example is nightmare through C#. Which I think is a rather major obstacle if you have an application that would like to use something other than simple sound output facilities. (Reasons for this might be as simple as choosing a sound output device, on at least .NET 2.0.)
More on the major downside of writing .NET applications is that you cannot guarantee that the stuff I work on my Vista workstation works on my co-workers XP workstation. This is a very sad "feature" that has been bugging as even with very simple applications. (Side note: We have tried to code using all the best practices you can find from MSDN.)
Also, GP's point 3 sounds very interesting. Can it be a success when it cannot be used to produce major parts of their own operating system. (No, I'm not talking about writing their kernel with C#).
Though, the GP doesn't list any sources for point 3, which at least I would be very interested to read as I seem to have missed those articles.
and a very nice language it is too! (coming from someone who pays the bills using it) I've still got a soft spot for c++ but I haven't had to use it in an age, and probably wouldn't unless I needed absolute technical control over a project, for perf reasons.
According to this: http://www.langpop.com/ , C# is only the 9th most popular language, only competing with scripting languages.
It comes nowhere close to the more popular programming languages in terms of usage.
while(1) attack(People.Sandy);
Check out the Programming paradigm page on wikipedia which has a good load of information on what differentiate a language from another. Java is absolutely not the same as C++.
The fact that not much people actually writes C++ (as opposed to, say, C with class) has something to do with the common belief that Java is alike, but look further than mere structural construct and you'll see why they are worlds apart.
Of Code And Men
(2) Who decided to make C# just enough like Java to fragment and muddle the whole programming scene?
http://en.wikipedia.org/wiki/Anders_Hejlsberg
He was/is the lead architect behind c-sharp.
Like Silverlight? http://raghuonflex.wordpress.com/2008/09/23/silverlight-app-uses-flash-to-work/
Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
Well there is fragmentation produces as they introduce YET another language.
So? That's a problem for Windows developers. Why should a Java programmer care? In the realms where Java is popular, C# has had basically no influence. So MS has, at worst, fragmented the Windows development ecosystem... big deal. :)
You currently cannot say C# replaces C++ on Windows platform as using any DirectX components for example is nightmare through C#.
...
More on the major downside of writing .NET applications is that you cannot guarantee that the stuff I work on my Vista workstation works on my co-workers XP workstation.
But none of this has anything to do with fragmentation to begin with. You're getting off-point. And that's ignoring the fact that, once again, this is a problem for MS... the rest of the programming world doesn't care one whit how hard DirectX is to integrate with C#.
Can it be a success when it cannot be used to produce major parts of their own operating system.
Last I checked Java wasn't being used to write operating system components, yet no one claims it's a failure. Now, that's not to say C# and .NET are unbridled successes, but that's a pretty crappy metric for making the call.
Yeah, but people hated C# and love Java about like they do now before Java was open sourced.
Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
You have too much respect for C++?
LOL
Mod me down, my New Earth Global Warmingist friends!
I'm a little surprised at the ease to attack C# but not much. It actually does a few of the things that C++ folk would like over Java, but I can understand the comparisons with Java.
Anyways, I've been fooling around with it for a while via an O'Reilly book and so far it's not too bad. That said, I don't see it much use beyond the Windows .Net Framework. Then again, that's all employers seem to want to see on the resume nowadays when it comes to development. And who can blame them?
I do have a cause for concern though....
The fact it feels like he's faking the enthusiasm, as he did for most of this dumb interview, is slightly scary. The followup question confirms that
Lastly...
It is possible to build alternate implementations. We are not building .NET for Linux, because the value proposition that we can deliver to our customers is a complete unified and thoroughly tested package, from the OS framework to databases to Web servers etc.
Ummm....just because it's possible to build an alternate implementation doesn't mean it will work the same way. It would absolutely kill me to use a language that implements two things differently because MS wants to hold back special class $VERY_IMPORTANT_FUNCTION that is the paramount to the language, such as database or socket connectivity.
I seriously hope that Java being opened helps chop block this. With open code, my hope is more places will buy into the language, showing MS that a "industrial-strength" language can be free.
import system.cool.Sig;
i think you mean "standard encumbered with patents, and not covering the whole libary" and while it is true that it is a interpreted language like java, its syntax is a lot like c++. Although, your probably right. I really shouldn't compare it to c++. thats a insult to c++. Its more like visual basic.
Your reply indicates you have new clue what C# is. C# is not a direct descendant in design from c++. C# is a child language of Java more than anything. You could probably convert 90% of C# code directly to java with a simple find/replace regex for keywords.
C# is also not non-standard. The C# language has a published standard, which, while not open source, is not the same as non-standard. A number of other implementations exist for both the virtual machine level(e.g. mono, boo) and the compiler/ide level(e.g. sharpdevelop)
C# more tolerable than java in terms of ease of design and naturalness of the language, and good for a similar scope of projects.
I like the ability to release windows binaries without having a headache about version compatibility, the irrationality of the underlying windows API, or memory leaks in trivial portions of code.
C# is not the best language for all sorts of problems, but when it comes to banging out a GUI .exe for windows users to use quickly, I don't think there are better choices.
I'm just curious how C# is said - anyone?
Thanks!
Be careful of your thoughts; they could become words at any minute...
Not only that, but the "standard" is of the type anyone with cash can buy.
The .NET "standards" weren't submitted to peer review, in a fashipn like IEEE. Instead, they were handed in a manilla folder to a cashier with a whole lot of money.
Voila, parts of .NET become a "standard".
Basically getting .NET "standardized" was fancy marketing campaign.
Mod me down, my New Earth Global Warmingist friends!
For our reference, please post an example of how C# is "more tolerable" than Java.
Please provide the reference with code samples for both languages.
Mod me down, my New Earth Global Warmingist friends!
How exactly is C# not open sourced?
My blog
Curious....
.net (3.5 right now) ? I believe you can download the current framework for use on XP if that is the case.
Is the issue you mention between Vista and XP a C# issue? Or an issue of the XP user not being on the latest and greatest release of
Besides, this is slashdot, why would anyone on slashdot be promoting MS Vista?
"C# is not the best language for all sorts of problems, but when it comes to banging out a GUI .exe for windows users to use quickly, I don't think there are better choices."
Delphi - Simpler, Faster, less overhead, By the same author!
Puteulanus fenestra mortis
Java hasn't been an interpreted language in a long, long time.
Considering that C# and Visual Basic have the same byte-code (nowadays), it's a fair assumption.
Adventure, Romance, MAD SCIENCE!
Yeah, it only took twelve years for that to happen. I guess C# just won't get around to it for another five years.
Oh goody. Another mindless Microsoft-basher who wants to try to whore up some free karma by saying untrue things like "slightly altered" and "nonstandard" about C#. Oh goody.
"16MB (fuck off, MiB fascists)" - The Mighty Buzzard
I think the fragmentation is mostly on the Web application side. Prior to C# and .NET if you wanted to develop a web app with Microsoft technologies you were probably using the pre-.Net version of ASP, which has various drawbacks.
.Net was as good as J2EE.
Microsoft smartly realized that they needed a framework for Web applications that included object oriented programming. They also realized that Java was very successful with its use in J2EE Web Development (Servlets, JSP, EJB).
So for their push into the Web world, they "copied" Java to some extent, thereby luring some Java programmers into their world, and also providing argument that
Well there is fragmentation produces as they introduce YET another language.
So? That's a problem for Windows developers. Why should a Java programmer care? In the realms where Java is popular, C# has had basically no influence. So MS has, at worst, fragmented the Windows development ecosystem... big deal. :)
Correct, but I was trying to write this as my position of part-time Windows application programmer. The point that I was trying to make was Microsoft could had just attempted to follow the latest and greatest with C++, not create fragmentation.
I believe that the issues with C++ are there but could had been fixed. Many people are/have been fixing those issues. To name a few the guys from Boost and Trolltech.
You currently cannot say C# replaces C++ on Windows platform as using any DirectX components for example is nightmare through C#.
More on the major downside of writing .NET applications is that you cannot guarantee that the stuff I work on my Vista workstation works on my co-workers XP workstation.
But none of this has anything to do with fragmentation to begin with. You're getting off-point. And that's ignoring the fact that, once again, this is a problem for MS... the rest of the programming world doesn't care one whit how hard DirectX is to integrate with C#.
Correct again, off-point and all that, but when you have to implement this part of your "solution" with C++ and that over there with C# I'd call that fragmentation.
For writing programs with GUI's the sad thing for ISV's is that you really cannot do it in many other ways. With C# anyone can do it (I guess opposed to C++) meaning it's as simple as Java. But Java cannot use because customer does not want to install JRE on every desktop.
Can it be a success when it cannot be used to produce major parts of their own operating system.
Last I checked Java wasn't being used to write operating system components, yet no one claims it's a failure. Now, that's not to say C# and .NET are unbridled successes, but that's a pretty crappy metric for making the call.
Well last time I checked I use some kind of mix between GTK and Java GUI on simple thin-clients at my University, which are backed by large SUN server doing all the hard lifting. I'd call that writing at least some of the operating system components with Java, GTK running as the painter for the UI. Then again I might be wrong on this one too.
I think the fragmentation is mostly on the Web application side.
I disagree. I think those that have chosen C# and .NET would've chosen a pre-.NET version of ASP, anyway, because they're already married to the Windows development stack and ecosystem. And those that would've chosen Java are still choosing Java because, in the end, it's a proven enterprise platform.
Meanwhile, there was *always* ASP versus Java... now there's ASP.NET versus Java. I'm not sure I see where that introduces fragmentation that wasn't already present in the marketplace.
C# and VB.NET both have compilers that compile them down to the same byte-code you mean. VB and VB.NET don't share much in common besides some syntax similarities, its more a ploy to lure in VB programmers than anything.
Excellent point.
.NET. And if you're using .NET, you're probably using C#.
I have to wonder where C# would fall on a "popularity list" if you were to exclude maintenance activities. In other words, look only at new development projects when assessing its popularity.
Forgive me for saying so, but much of the "C# SUX TEH BIG ON3" sentiment strikes me as being from the anti-microsoft crowd. The group of people who would bash Microsoft, even if they cured cancer. The fact of the matter is, if you're writing a Windows application, you're probably using
I'm sorry, gotta disagree right here. I absolutely hate Delphi, it feels like retarded VB compared to my work with C#. Granted this is opinion, but I know I'm not alone in this train of thought.
"Now you know, and knowing is half the battle!"
Delphi - Simpler, Faster, less overhead, By the same author!
But nowhere near as well integrated into .NET. I've used both, and although I usually advocate the B&D of the Pascal family of languages, I'm with the GP -- C# is a really easy language for knocking out a medium-sized, non-mission-critical GUI-intensive program for the .NET platform; much easier than Delphi. On the other hand, Delphi is better at preventing certain classes of bugs, C++ is better for multiplatform programming, Ada is better for preventing bugs and multiplatform programming but has a steep learning curve, and so on. No language is ideal for all purposes, but C# is a fine language for some purposes.
Quidnam Latine loqui modo coepi?
I was not going to reply to this until I saw the sentence on the but lets clear this up (while it was rather off-topic).
Is the issue you mention between Vista and XP a C# issue? Or an issue of the XP user not being on the latest and greatest release of .net (3.5 right now) ? I believe you can download the current framework for use on XP if that is the case.
The issue were with .NET 2.0, on both workstations. I believe Microsoft is calling those .NET 1.0, 2.0, 3.5, so that when I write code that depends on .NET 2.0 it will work on my friends computer that has .NET 2.0, regardless of the operating system..
Besides, this is slashdot, why would anyone on slashdot be promoting MS Vista?
Heh... As not everyone here does all their coding just for fun they do it because they have to – in order to get payed.
I'm happy that the most I've been doing lately have involved more server side Java than anything related to .NET.
I think this sums up how I feel about C#.
I'm curious, what gives you the idea that C# fragmented "the whole programming scene"? As far as I can tell, C# has really just replaced C++ on the Windows client side, where Java never had a foothold to begin with.
So, where is this fragmentation you speak of?
Well, C# is being used for ASP.Net development. It may be pulling attention away from J2EE by providing an alternative for the "ewww...basic" crowd.
Simple, encapsulation of private variable. Java:
C#:
The implementation is about the same in both languages, but using it is much nicer and cleaner in C# than in Java.
"16MB (fuck off, MiB fascists)" - The Mighty Buzzard
Because that's not an MS product. OSS Java implementations also existed before Java itself was opened.
"Gold still represents the ultimate form of payment in the world." - Alan Greenspan, 1999
I think that one of the most interesting developments of C# and most mainstream programming languages is that they keep borrowing long-established elements of functional programming.
All and all this is a positive development. The only irritating aspect about it is the number of Microsofties who think M$ is inventing new stuff and being "innovative(TM)". A good example of this is F#: while the language is basically an adaptation of Ocaml to the .NET environment (to the point that simple programs are indistinguishable), I've seen plenty of people touting F# as the best thing since sliced bread, but completely failing to mention its roots, or the fact that Ocaml is a well-established language with a long history, and perhaps the most successfull (in terms of actual usage in the industry) of functional programming languages.
(Though I give credit to the interviewee in this particular article for being an exception to this rule, and for acknowledging F#'s pedigree).
Incidentally, this has long been a burning question for me: why is a language like Ocaml ignored to such an extent within the mainstream open-source community? It already has a small but vibrant community, excellent coverage in terms of libraries, performance comparable to C++, and the safety and cleanness that comes with functional programming. I even see Linux people excited with F#, seemingly oblivious to the fact that we *already* have a language better than F# that runs natively under Linux!
(Note: I consider Ocaml to be superior to F# because in the process of transforming Ocaml into F#, Microsoft removed two of the most interesting and powerful features of Ocaml: functors and polymorphic variants)
Forgive me for saying so, but much of the "C# SUX TEH BIG ON3" sentiment strikes me as being from the anti-microsoft crowd.
Agreed. And you know what? Traditionally, I've been one of those people. I say this up front because what follows is gonna seem sycophantic... but my background is Unix development, and I've had to grudgingly admit a few things about .NET and C#.
First, he simple fact is, compared to writing Windows apps in C++, C# is a *godsend*. 'course, that's really an indictment of MS's C++ APIs, but the reality is that C# did exactly what they wanted: it allowed them to make a clean break from their old APIs, allowing them to replace them with new, cleaner (though still decidedly crufty and poorly designed in a *lot* of places) APIs. 'course, it sure ain't perfect (.NET's timezone support is, frankly, embarassingly bad), but it's lightyears ahead of what came before.
Second, C# is, I must grudgingly admit, a nice language. Is it incredibly derivative? Yup. But it does bring together, in a single package, a very nice feature set, over and above the stuff they copied wholesale from Java. Native generics, closures, real annotations... C# has got some very nice stuff in it.
Lastly, the very fact that C# is so feature-rich has forced Sun to really kickstart the Java development process once more. And that demonstrates that, rather than fragmenting the development community in a negative way, C# has actually improved the situation by providing competition and contrast (though I maintain that C# and Java don't *actually* operate in the same niches, so that competition is more in the realm of bragging rights).
when it comes to banging out a GUI .exe for windows users to use quickly, I don't think there are better choices.
I've got a Q and a t who think otherwise. Product page: http://trolltech.com/products/qt/ Wikipedia: http://en.wikipedia.org/wiki/Qt_(toolkit)
8 of 13 people found this answer helpful. Did you?
I *really* doubt that. I strongly suspect that the people choosing ASP.NET would've never considered Java, as odds are they're already invested in MS kit, while those choosing Java would've never considered ASP.NET as the former is a proven enterprise platform, while the latter is not.
For anyone interested in programming in C# but don't know any good reasons to actually get into it, I give you one: http://www.runuo.com/ - You're welcome. =)
I use Windows... like a two dollar wh.. why don't I just go ahead and not finish that sentence.
Having spent the last seven years using Qt and C++, and the last two comparing that with C#, I'd agree with the original poster: C# is a better choice for fast productivity to a GUI .exe for Windows.
Throw other platforms into the mix and my decision changes, but that's not what he stated, is it?
Qt lost a lot of points in my book for just how much time was destroyed in porting our code to Qt4. Two years later, and we're still asking for bugfixes.
(First off, Java was ALWAYS open source, just not OSI-compliant)
But the difference is that Microsoft has committed developer resources to work with the Mono team at Novell. Sun never committed any resources to work on GCJ.
My blog
> one of computer programming's most widely used languages -- C#
Any link to back this ?
(no, I didn't RTFA)
Votez ecolo : Chiez dans l'urne !
You have too much respect for C++?
LOL
C++ vtables are the foundation of COM, and COM is the foundation of OLE.
How can you not respect OLE? ;-)
echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
A quick search yielded this site:
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
The implementation is about the same in both languages, but using it is much nicer and cleaner in C# than in Java.
That really is a matter of opinion. In Java, it's pretty clear that you are requesting or modifying a property of the object. In C#, you are using assignment to represent that mechanism so you might be accessing a public member variable directly or calling a method to achieve that end. To me, the Java method is more explicit and therefore less prone to error.
Cheers,
Toby Haynes
Anything I post is strictly my own thoughts and doesn't necessarily have anything to do with the opinions of IBM.
Well Java was also multi platform as well. Mono makes C# closer to muli-platform than it was.
Java has much better resources on line than C# under mono as well.
Java has two really good IDEs available NetBeans and Eclipse.org.
I have yet to get into Mono all that much. I have tried and I have found the online documentation really lacking compared to what I can get for Java.
I am going to write an app under Mono just so I can learn it and so I can give it a fair shake.
See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
I took a 2D and 3D graphics class at college using DirectX. My 2D group decided to use C++. My 3D group used C#. C# was by far easier to implement. So I don't know where you got your "using any DirectX components for example is nightmare through C#" statement.
-SaNo
.Net is just yet more churn in the Microsoft shit-factory of APIs and languages.
.Net, I'll stay away from .Net. They took a great tool, MMC-based Enterprise Manager, and ruined it.
If the whole comctl32 debacle isn't fresh enough in any of your memories, give it a quick google. If SQL Server 2005 Enterprise Manager is any good representation of C++ vs.
Ultimately, I think you're right, but I think I'll be happy sticking to C++ and one of the myriad of really good windowing frameworks available.
After a month or so of line by line code inspection the team discovered that the C# code they used had inherent memory leaks and the problem was not repairable
Actually, they did fix the problem... since it was an issue with their code and not C#. C# was doing what it was supposed to.
That really is a matter of opinion.
That about wraps it up.
First of all, C# is a Java competitor, not a C/C++ competitor. It has an underlying layer of middleware, garbage collection, and just-in-time compilation, like Java. It exists because Microsoft didn't like developers using a Sun-developed standard. Something was needed for business application developers that wasn't as hard as C/C++, and was closely tied to a Microsoft platform. That's C#.
We still don't have a good replacement for C or C++. The big problems with C are 1) the language doesn't know how big arrays are (the cause of most of the buffer overflows in the world), 2) the language has no clue about concurrency or locking (the cause of most of the race conditions in the world). Those aren't fundamental problems of a low-level language; Ada and Modula 3 addressed both problems.
C++ doesn't fix either of those problems; it just papers them over with a layer of templated wallpaper. The mold underneath keeps seeping through the wallpaper. C++ has hiding without safety, the only major language in that space.
The original article has some interesting points. It had never occurred to me that a programming language should be designed to support command completion. Personally, I think an environment that displays the parameters of a function when you start to type a call is more useful.
You would do well in government.
"Gold still represents the ultimate form of payment in the world." - Alan Greenspan, 1999
And, for that matter, C# has never (at least since its public release) been an interpreted language.
This just in: preexisting apps with huge established codebases didn't switch to a new programming language! Film at 11.
Idiot.
"You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
In Java, it's pretty clear that you are requesting or modifying a property of the object.
Really? The paranthesis after the method name inclines me to think of it as a function, and I prefer using assignments vs a function call; it's easier to read and debug.
eg. blah.Prop = someFunct(); is easier to read than blah.setProp(someFunct());
In C#, you are using assignment to represent that mechanism so you might be accessing a public member variable directly or calling a method to achieve that end.
Which is kind of the point... a property is exposed as if it were a public member. I don't /care/ if I'm assigning to a property or a public member.
To me, the Java method is more explicit and therefore less prone to error.
What? Can you give me an example of how it is less prone to error?
I program in Java too, but I prefer c#. I see c# as an improved version of java. The designers of c# learned from their mistakes.
$7.95/mo, 200 GB disk, 2TBxfer, MySQL, PHP, RoR.
Um, C# is an ISO standard (ISO/IEC 23270) just like C++ (ISO/IEC 14882).
I don't know Delphi but if you think it's a retarded VB, then that's pretty bad because I've always though of VB as a retarded version of Pascal, which I dropped cold after learning c++.
VB has that feel that it was designed for 6 year-olds learning to program.
$7.95/mo, 200 GB disk, 2TBxfer, MySQL, PHP, RoR.
Hogwash. Anyone who has spent any time whatsoever with C# in Visual Studio knows the difference between a property and a public variable when they try to assign it. And if you have intellisense off, then the only people who will get confused are those who don't follow any sort of naming conventions. And in that case, they are likely to get confused no matter what language they are in.
ISO's meaningfulness is diminishing.
I agree with you (though I've been in the Windows world for years and not an MS basher), and I'll even throw in some specifics.
The Win32 APIs reflect the fact that C/C++ have no built in string type. Anytime string data has to be returned to the caller, you had to answer questions about who allocated the data, how it was terminated, how long it needed to be, etc. The most common method of handling this (and yes, not all APIs do it the same way) required two API calls - once to ask how big the data is, and a second one to actually get the data. And of course the caller still had to allocate and free the data.
Compare that with .Net - it has a built in string type, so no confusion over how the data is represented. And with a single garbage collected allocator, the API can allocate the needed data and return it to you. So instead of multiple calls and an allocate/free, you can just call an API that returns you an object of type string.
Even better, since .Net has built in collections, the APIs are free to return things like arrays or lists of strings or objects. In Win32 that was exceedingly cumbersome.
WinForms and WPF are both dramatic improvements over the Win32 dialog resources, which is still the defacto standard for Windows C++ applications.
Defining event callbacks/handlers is simple and expressive in the .Net language, compared to the huge preprocessor macros for things like BEGIN_MESSAGE_MAP ON_WMHSCROLL, ON_COMMAND, etc.
Back to strings: strings in .Net are immutable, and string.Format is a static member of the string class, that returns a string. So instead of declaring a char buffer or a CString or std::string and then initializing it, you can do it all inline: MessageBox( string.Format( "Enter %0 password", "Bill's" ) ); That expressiveness makes it simpler to write code without having to stop and backup when you realize you need to create a string object somewhere.
Little tiny things in C# (and Java I believe) like the fact that when using enumerations they are prefaced with enumeration name. Not only does this cut down on errors, it makes it much easier for the IDE to autocomplete for you.
Did you not read the post?
Mod me down, my New Earth Global Warmingist friends!
I gotta say it - Python (and Ruby) is the best language to date. I don't see why you'd ever invent another language that scores lower on the benchmarks of what makes a language good.
Those are:
Those are just off the top of my head.
Speed isn't a concern because it is often cheaper to buy faster hardware than it is to use an unproductive language. When you think about it, one day of developer time can justify a CPU upgrade that is 2x as fast. How many hours a year do you spend updating headers, tracking down bad pointers, missing memory de-allocations?
Slashdot's rate-of-post filter: Preventing you from posting too many great ideas at once.
Why not? It certainly meets your criteria, why shift the goalposts? Moreover, the more basic something is, the more important it is that the functionality be better, because you will be using it all the time. You're not only shifting the goalposts, but your logic for doing so is completely backwards.
"16MB (fuck off, MiB fascists)" - The Mighty Buzzard
We still don't have a good replacement for C or C++. The big problems with C are 1) the language doesn't know how big arrays are (the cause of most of the buffer overflows in the world), 2) the language has no clue about concurrency or locking (the cause of most of the race conditions in the world).
Objectve-C fits both criteria. You use the found class NSArray for pretty much everything so you don't get buffer overflows, and you have a decent threading model with runloops and Java style @syncronized statements for threading, along with a lot of useful functionality to do common things with threads (like detaching a thread, having a thread run a method after a short delay, etc.). Further helping desktop aps at least is garbage collection, but even when you can't use that the memory model of release/retain is still more easy to use and less prone to having issues.
And, you can always fall back to C or C++ as needed.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
Because you're talking about things that take less than a second to do in either case.
This isn't an optimization any real developer would really sing the praises of.
Whats next? ".NET has one less letter in its name. It makes it so much easier to remember and more tolerable than Java."
Mod me down, my New Earth Global Warmingist friends!
Pretty sure that music precedes unicode, dude, and they write the sharp sign using anything that looks like a tiny smooshed tick-tack-toe board.
At any case, you're both wrong. "E#" is pronounced "eff" - there is a half step between E and F, and the "#" sign denotes "do this note, except take it up half a step."
E#==F.
That's actually not entirely true.
It is true that going a half-step up from E gives you F. However, in certain keys you'd still refer to the note as E#.
Bow-ties are cool.
Your reply indicates you have new clue what C# is. C# is not a direct descendant in design from c++. C# is a child language of Java more than anything. You could probably convert 90% of C# code directly to java with a simple find/replace regex for keywords.
Once upon a time there was Java and it was good. Then Microsoft embraced it and extended it and provided the msjava vm in Windows.
But Sun didn't like that and sued. Especially since it wasn't exactly compatible. Microsoft lost, packed up, and went home.
Like two weeks later Microsoft announced "C#".
I would imagine that MS just did a Find/Replace to change their java implementation to C#.
Does the name Pavlov ring a bell?
Incidentally, this has long been a burning question for me: why is a language like Ocaml ignored to such an extent within the mainstream open-source community? It already has a small but vibrant community, excellent coverage in terms of libraries, performance comparable to C++, and the safety and cleanness that comes with functional programming. I even see Linux people excited with F#, seemingly oblivious to the fact that we *already* have a language better than F# that runs natively under Linux!
(Note: I consider Ocaml to be superior to F# because in the process of transforming Ocaml into F#, Microsoft removed two of the most interesting and powerful features of Ocaml: functors and polymorphic variants)
I can't exactly answer why other languages don't get more play - but I can lament that the .Net platform has been responsible for draining some of the life out of every language they touch. I still remember a very excited Eiffel proponent being very excited about Eiffel# when it first came out - not realizing it was a gateway for Eiffel users to flow to pure C# programming.
Perhaps F# is a true move by Microsoft to switch everyone to functional programming, but it could just as easily be a trick to get people using the .Net platform and then through convenience get them to move naturally to C# from there...
"There is more worth loving than we have strength to love." - Brian Jay Stanley
Making code cleaner and more readable is not in the least trivial. Any "real developer" will sing the praises of something that makes it easier for him to read another guy's code all day long.
"16MB (fuck off, MiB fascists)" - The Mighty Buzzard
Better than C#? Well, how many platforms can you name that C++ is not available for? If you're willing to go back to an early version of C++ it compiled via C (may be possible even for current versions, I've never bothered looking into it), so at least some version of C++ would run on anything that runs C (and had enough resources).
Quidnam Latine loqui modo coepi?
The language may be, but doing most anything remotely interesting is going to create platform-specific issues. Such is the curse of a bare-metal language.
Most modern architectures, though, have some level of Mono (or, for that matter, Java) support; I don't see why you'd go to C++ unless you're writing highly fugly elevator controller code or something (and even then, it'd be smarter to go to C).
"You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
"C# ... is very popular ..."
By "very popular" I take it you mean less popular than Perl or Python, but more popular than Delphi.
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws-Plato
Which has bugger-all to do with the standard held-up, which is quick to bang-out a usable GUI for Windows users. .Net is not necessary (and, arguably, is often not desirable) for that.
The platform referred to was Windows, not .Net: "C# is not the best language for all sorts of problems, but when it comes to banging out a GUI .exe for windows users to use quickly, I don't think there are better choices.". Windows and .Net are two different things, though recent versions of Windows include .Net.
Actually, they did fix the problem... since it was an issue with their code and not C#. C# was doing what it was supposed to.
and in related news, C++ is not hard, its just that you're not intelligent enough to use it. And javascript is not slow, its just that you're using it for applications with incorrect performance requirements, and java isn't memory-hungry, you're just running it in a constrained environment :-)
If you say that C# is working fine, its a problem with the coders, then my points above are equally true.
I've been looking through stackoverflow recently, and there are a lot of questions along the line of "my .net app uses too much memory", its one of the inherent problems of a GC architecture that you need to be aware of, just like C#'s other language features. I believe its a big issue that needs more visibility - as you say, its not the GC that's at fault, its the whole understanding of how to properly code in a GC environment.
Unfortunately, most .NET coders are drawn to the language because it has features like this that are designed to make it easier for them to code, so they don't usually want to know that it is harder than they expected.
C# is not the best language for all sorts of problems, but when it comes to banging out a GUI .exe for windows users to use quickly, I don't think there are better choices.
Yes, basically, if you're in a situation where you would been stuck with VB, you now have C#, which appears to be somewhat less unpleasant.
If you're not in such a situation, there doesn't seem to be any good reason to use this language.
"Not an actor, but he plays one on TV."
True, I hate developing mono in anything other than Visual Studio - there isn't yet a good alternative IDE that I found.
Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
With recent releases of GTK#, C# is a fine language for knocking out a quick and dirty UI in linux as well. I haven't tried the mono implementation of winforms yet (I'm not sure it's even useful currently), but GTK# is a lot nicer to work with than Swing.
C# is a damn good language, the only problem is that it's a Microsoft technology, and people are rightly a bit weary of it.
A Free Market requires informed intelligent consumers, such people are rare, we're in trouble.
more ignorant posts about how a language works then nearly all the posts about C# in this thread.
You people are just talking from brief sound bytes, ignorance, and misinformation.
Morons.
The Kruger Dunning explains most post on
And I have no desire to use Visual Studio. I like developing mainly under and for Linux for my own projects.
The program I am planning on doing in Mono is going to run only under Linux anyway.
See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
True, I hate developing mono in anything other than Visual Studio - there isn't yet a good alternative IDE that I found.
I hate to develop mono anywhere. Getting sick sucks.
If microsoft really wanted C# to be used in more places, they make or allow someone else to make a cross platform IDE for it.
Turbo Pascal might have been great for a DOS-only programmer, I don't know, I didn't use it because I needed to write software that would work on more than just DOS... that's not the point.
And, though this is not the point either, I would say the first IDE was Smalltalk, and Interlisp-D and UCSD Pascal both provided an IDE before Turbo.
The point is that the resulting program you got after you pressed that button was a badly behaved program. The end user doesn't give a damn whether you built the program by pushing a single button, or even if that button was pushed at the factory before you got it.
The end user had to deal with the fact that Turbo Pascal programs crashed on their computer because they didn't have one of the three video cards or two UARTs that Turbo's "too hell with MS-DOS and the BIOS, we're gong straight to the hardware" runtime knew about. The end user had to deal with the fact that when they ran a Turbo Pascal program, it clobbered their TSR text editor and wrote all over the other screen of DoubleDOS. The end user had to deal with the fact that Windows stuttered whenever they were running a Turbo program in a COMMAND window because they had to use a PIF that let the Turbo "I own the computer" program write straight to the hardware. Because whether or not Borland provided a way to build well behaved programs, no Turbo programmer in creation bothered to use it. Turbo was its own little world.
Well, that's certainly one way to spin it.
Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
The platform referred to was Windows, not .Net
True, so I'll go with "C# and .NET is a really easy combination for knocking out a medium-sized, non-mission-critical GUI-intensive program".
Quidnam Latine loqui modo coepi?
TextWriters closing the underling steam when they are disposed is just plain crazy
thank God the internet isn't a human right.
I agree. The way I see it Microsoft is actually promoting competition. The real battle isn't Java vs C# but JVM vs CLR. One of the things that is interesting is the fact that the flexibility of CIL and the CLR has allowed not only the native OO languages to be developed but also functional and dynamic languages. The JVM has similar capabilities but some things like tail recursion optimization are not as good. But because of the competition I suspect that the JVM team will not surpass what MS has as they already do in certain aspects.
Im getting to dislike all those curly braces.
De gustibus non erat disputandum. A lot of people have big problems depending on indentation alone for nesting.
Lisp is the best language to date, and it's been the best language since the '60s. I don't see why you'd invent a language that isn't derived from Lisp.
That is actually negative from the object oriented point of view. As someone using the object, you have no right to information regarding the implementation - the less you know the better. In C# you might be doing who knows what at an implementation level, but the interface is the same no matter what. And it is infinitely more convenient.
I've never actually used C# but until finding out about this feature I'd been wondering why it hadn't been implemented in Java. I hear great things about C# but it isn't worth .NET...
> If microsoft really wanted C# to be used in more places, they make or allow someone else to make a cross platform IDE for it.
Microsoft DOES allow others to make cross platform IDEs. I'm pretty sure I've found one or two. They just happened to suck. Googling "C# IDE" brought up a few results immediately.
Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
Don't forget IntelliJ on the IDE department.
Closer? Wasn't it originally J++?
Far be it from me to tell you how to spend your time, but you're not really giving Mono a fair shake if you're not attempting to write cross-platform code. And if it's not cross-platform, there's really no reason to use Mono, except maybe to attract Windows developers. But don't let that stop you. I wrote a webapp that uses model-level validation using Django. Pointless, but enlightening.
Well Mono is supposed to be a good development environment under Linux. If you are not going to use it under Linux then why not just use .net?
This one app is going to run on a Linux box. This is a donated box and I don't have a spare Windows license and I am not buying one. So I figure that it would be a good time to learn C# and Mono and help somebody out all at once.
See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
> Last I checked Java wasn't being used to write operating system components .....
Everyone accept the Kernel of the OS is best written in C/asm even C++ if appropriate higher level stuff to get raw performance from optimization and a consistent scheduling requirement (which garbage collection language's don't provide - hence Sun's warning not to use Java in life critical environments like nuclear power stations)
However the GUI and tooling parts of the OS are and have been written using Java for Sun Solaris and Sun's Desktop also much of HP and Oracle's tooling is also Java. So this really is a care of eating their own food, but I agree I don't see much of XP SP3 or Vista based on DotNET.
So maybe "last I checked" you were talking of Windows, I can only suggest you go out and see the world a little more.
Yeah, that was what I thought before I started using C#. I am a 10+ year veteran of the Java world, and have spent the last year or so on a large C# project. C# has much better syntax in every way that it deviates from Java. Properties are quite clear, since VS does a nice job. Under the covers, there is *no* difference between a property with an implicit getter/setter (i.e. you didn't provide one, so you access the variable directly)--the bytecode creates a synthetic get_ and set_ method, allowing things like AOP to work even if no explicit getter/setter is provided.
The Java method results in much more verbose boilerplate code. This also causes many developers to do more cut-and-paste, another source of potential error. The Java method makes tech like AOP much harder, as there is no synthetic method call surrounding access to public member variables. The Java method is, in short, not object oriented, as it does not properly abstract away property access, so Java tacked on this stupid getXXX/setXXX naming convention in the JavaBean standard.
There are many reasons why Java is a superior platform than .Net/C# (maturity of 3rd party libraries, the open source community, the quality of design in the provided libraries). But the language itself is not one of them. I cannot think of a single area where Java bests C# in terms of the language itself. C# really is the next generation of Java, and has learned from Java's mistakes.
--Be human.
Well Mono is supposed to be a good development environment under Linux.
I've heard differently. I suppose once they work the bugs out and play catchup it'll be OK, but right now it's kind of buggy and outdated.
If you are not going to use it under Linux then why not just use .net?
Why use either mono or .net if you don't need the code to run on Windows and Linux?
I'm not saying don't do it. It's just kind of pointless given the current state of Mono.
Well, the majority of C# use isn't specific to Mono.. the bits that are, generally are centered around writing GTK# applications. If you are doing web application development, or windows forms development, many people tend to just stick to Visual Studio, and test on Mono. A large number of applications will run on Mono with minimal, or no modifications.
.Net (not Mono specifically), and it's generally far easier to get a grasp of than working with Java.
I've written a couple of applications for Mono use, that worked out well. Support for various database implementations are generally good to great as well.
As to documentation for Mono lacking compared to Java, I couldn't disagree more. Look for anything related to doing something in
Michael J. Ryan - tracker1.info
MonoDevelop is pretty decent. Though so are Eclipse and other IDEs... However VS is leaps and bounds ahead of any other IDE I've used, in many ways. Don't let that discourage you. Mono/.Net have a lot of advantages over Java. P/Invoke is far easier to use than JNI. The GTK# interfaces are nicer (IMHO) than the Java GUI options out there, and ASP.Net is far nicer than most alternatives.
I've been playing around with using the DLR stuff lately, which is pretty nice. The ability to use it cross-platform is nicer still, there are still a few areas where I need to work on things, but overall it's got some nice features.
Michael J. Ryan - tracker1.info
My take on this is: Java is more clear about what it is doing, C# has a nicer sintax, the code looks better, but a reader can be deceived by it.
I would go with Java, its better to have ugly code that is easy to understand
-- dnl
On my ATARI ST :
_GFA Basic (automatic syntax correction, automatic indentation, folded procedures, etc ...)
_Omikron Basic (reset resistance)
_or even 68000 assembler were light years ahead in terms of ease of use that the MS-DOS Turbo pascal 3.3 I had the utter disgust of using.
Showcase :
_Turbo Pascal 3.3 on 8MHz 286 dual 3"5 floppy
Aim : display math graphics on screen.
After the 3rd time the program runs, error message : graphics not initialized.
WTF ? What do you mean not initialized, what the hell did you just display 10 seconds ago ?
_Reset PC
_Reboot MS-DOS from floppy
_Reload Turbo Pascal
_Reload program source
_Recompile & run
_Try again another equation.
Compare with this :
_Omikron Basic on ATARI ST, 68000 @ 8MHz
Aim : Screw around with the xbios functions about display addresses
ATARI ST crashes
_Reset ATARI ST
As soon as your finger leaves the reset button :
You are still under the OS
You still have the Omikron Basic interpreter loaded
Your source code is still in memory
All you have to do is run it again.
Similar results could be obtained with GFA Basic and a reset resistant RAM-disk.
And why, oh why the heck did that piece of crap turbo pascal had to use only ONE fricking pass for compiling ?
Even my 68000 assembler used two :
First one for syntax error, second for actual compile.
The first pass will list you ALL syntax errors and you will navigate from one to the other at will (not to mention with mouse and GUI).
Compare this with (TEXT mode) Turbo-Pascal that will STOP compiling on the very first syntax error it encounters.
30 semicolons omitted in your source ? That's 30 recompiles, one correction after the other.
AMIGA and ATARI ST were light years in almost all respects compared to the clunky and pain in the ass platform that was the PC.
If you have to use legacy libraries (dll/so), then you will definitely like .Net over Java. That's my single biggest gripe with Java, is the pain that is JNI. I also find that development in VS is far easier than using any of the Java IDEs I've tried. Not to mention that ASP.Net, Dynamic Data, and MVC frameworks are easier than anything in the Java side of things to get up, running, and debugging at runtime. Java is more portable, that is a given. But I still prefer C#/.Net.
Michael J. Ryan - tracker1.info
.Net 2.0, 3.0 and 3.5 all share the exact same runtime - 2.0.50727. The additions in .Net 3.0 and 3.5 are either just parts of the Framework, or updates that the compilers handle so it still runs on the same runtime.
It hides from the developer that you are actually doing something that could be costly.
For example, that innocent "item.price" could actually be calling an stored procedure that makes all kind of querys to get the right price for the current session customer.
In Java, item.getPrice() would be a hint to this fact. In C#, someone could abuse the property, in different instances of the same item, unaware that he should cache the value to avoid performance hit.
Of course, there are ways to prevent this, but are mostly related to procedures the developers must follow.
Actually, while I really like C#, LINQ, and Visual Studio on the whole (I'm quite happy developing with it), I'm starting to understand why Java had some things that forced the programmer to be explicit about what his/her code did. Not forcing you to catch or throw exceptions means, for example, that methods that couldn't throw an exception (according to it's definition) actually throw them. And you didn't put a try catch because it was a simple call and there were no methods that could throw...
I stand by my comment that Python is the best OOP
There's OO Lisps.
But if you want a good object oriented language, and you aren't interest in Lisp, you're going to have to try pretty damn hard to beat Smalltalk.
Why does being born at the same time God was conceived make you an expert in C%?
It's meaningless. C# is used a lot in the enterprise application arena. I don't know why you would think "TIOBE" would have any insight into what Fortune 500 companies are developing internal automation and business software on. I get the hiring thing, but it doesn't mean a lot.
Answer: F#%$
Or is System.IO.Directory.GetFiles not what you're looking for? I can't think of any kind of file system-related calls that aren't somewhere in System.IO.
Perl - $Just @when->$you ${thought} s/yn/tax/ &couldn\'t %get $worse;
The typical implementation/use is interpreted. Unless you consider JVM to be your operating system.
t
I think the java community has been talking about this kind of syntax for a long time but still not get it. does anyone know why? is it because of some MS patent on it?
If your goal is ugly code, then Java is the clear winner.
I should really use monstrously long words and about 38 more lines to explain this, but Java is not my preferred writing style.
t
In the fine article, it says:
So C++ I think is a fantastic example of a very appropriate evolution of an existing language. It came right at the dawn of object oriented programming...
Well, lets see, according to wikipedia C++ appeared in 1983. Smalltalk started development in 1969 and was publically available in 1980. And simula appeared in 1967.
So I guess that means that 1983 is the dawn of 1967... I think this guy forgot what object oriented means, and has drank too much C++ coolaid.
If your goal is large code, Java is good too! Very verbose language :-)
-- dnl
Before .NET large companies would probably go with J2EE for a web application. Pre-.NET ASP was never a great solution.
.NET and C#, many companies that were potential J2EE candidates ended up going with the Microsoft stack (where they probably would not have gone with pre-.NET technologies). Thus continuing and exacerbating the fragmentation that existed before .NET.
.NET and the company they merged with was J2EE. So now our programmers and even managers are sort of at odds with each other. Do we build the next app in .NET or Java ??
.NET and C# I don't think that kind of fragmentation would be as common.
Now with
My company for instance merged with another company. The parent company was
Without
To learn Mono for one thing.
I could develop it in Java and still only target this one PC running Linux.
Or I could use QT and C++
The choice of language is for learning how to write cross platform c#.
See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
Java: Properties are private variables/methods exposed through a public method. Seems unnatural and tedious when accessing a guarded variable, e.g.
Line.GetWidth(); Line.SetWidth(10);
Two different calls for accessing a single property.
C#: Properties are private variables/methods exposed through a public variable. May be cause for surprise e.g. when
Line.Width++
increases width and executes statements outside the scope of width increase.
For exposing a (guarded) private variable I prefer the C# way, but it's too easy to mix data with flow.
I don't feel a property can be accessed as either a variable or a method, because it isn't and adds to confusion.
Without .NET and C# I don't think that kind of fragmentation would be as common.
That's just it. I really don't think it is. *shrug* I'm sure there are a few cases here and there, but I really don't think the market fragmentation issue is so large as to overwhelm the enormous advantages caused by increased competition in the space (just look at how Sun has reacted, added new features to Java at a record pace relative to their previously essentially stagnant progress).
But, fair enough, I'll concede that, yes, .NET may have contributed to some additional fragmentation on the enterprise side of things (although, as you yourself point out, the space was already crowded). I just don't think the effect is that great.
I had a bad experience with .NET 2, where in order to open an old project in Visual Studio it insisted on converting to .NET compatibility apis. The rather simple program then ran insanely slow, so slow that the interface was sluggish and it was useless for its purpose (automation).
So maybe "last I checked" you were talking of Windows
Yeah, you're right, that tiny fraction of Java tools that Sun, HP, and Oracle have written completely defeats my point.
Last I checked, neither Windows, nor Linux, nor MacOS, the dominant desktop OSs out there, had a large population of Java applications. And the number of tools on the Sun, HP, and Oracle side written in Java is vanishingly small relative to their native applications. Hell, in all my work on Sun boxes, I don't think I've *ever* used a Java app.
So, yeah, just like there are the odd Windows apps out (like, say, Azureus) that are written in Java, the reality is that number is *incredibly* small. The fact is, Java has made it's name in the enterprise web application space, not on the desktop or in the OS, and I've met no one who's credibly attempted to challenge that fact. And that includes you.
Thus, I believe my original point still stands. Just because MS hasn't migrated SQL Server or Office to .NET doesn't make it a failure, any more than Java is a failure because Sun hasn't rewritten their Unix userland in Java. It just means that they're smart enough not to rewrite multi-million-LOC projects in another language just to prove they can.
C# is a child language of Java more than anything. You could probably convert 90% of C# code directly to java with a simple find/replace regex for keywords.
Wrong, C# is much more powerful since you can use unmanaged code in your managed apps with the unsafe keyword. I made a real-time computer vision application in C# for a robot and before that I tried Java, let me tell you this, C# was 20x faster because I could directly access the memory of the image acquired by the webcam.
Sigs are for morons... Wait a minute...
I'd call any language more popular than Javascript "very popular", yes.
Beware: In C++, your friends can see your privates!
Nah, because Qt isn't free if you want to develop commercial code (see Visual Studio Express or even Microsoft's free standalone compilers for an alternative IDE), and besides, tries to hack C++ for its signals and slots. I like Qt a lot as an open source cross-platform development library, but if you want to develop 1) commercial software 2) pretty much just for Windows (like the guy you're replying to), I don't think it's that competitive. It's a C++ library too, so it doesn't do RAD quite as well.
Beware: In C++, your friends can see your privates!
Well there is fragmentation produces as they introduce YET another language.
Meh.. As for Windows development, I think .NET did a lot of good things. Most importantly, made a .NET developer easily understand and switch between C#, VB .NET or heck even something else .NET based that would come up later. The difficulty in a new language lies usually not in the syntax, but in learning the API. .NET was a great gift for the Windows developers in that regard. No more.. "Uhmm, MFC if you do C++ or VB6 if you want VB"... As for Microsoft's offerings. Eek. Things were *ugly* in the past. And hell of a lot more fragmented.
Beware: In C++, your friends can see your privates!
C# v3 is not a standard.
From TFA:
Do you expect C#3.0 to become an ECMA and ISO standard, as previous versions have?
We're certainly open to that. There's no ongoing work in the standards committee at the moment, but it's really more a question of whether the community of industry partners out there would like to continue with that process. I should also say that the standards for C# explicitly do permit implementers to have extensions to the language, so though C# 3.0 is not standardized, it is certainly a complete implementation of the C# 2.0 standard. It is 100% backwards compatible, as all versions are.
And? If C# 1.0 and 2.0 were standardized, I damn well imagine 3.0 will be. It would be rather odd to imagine otherwise.
"16MB (fuck off, MiB fascists)" - The Mighty Buzzard
It hides from the developer that you are actually doing something that could be costly.... there are ways to prevent this, but are mostly related to procedures the developers must follow.
You mean like reading the documentation and/or the source code of the class you're using? If you don't know how or where the object is getting its data, then you're just as in the dark whether it's data passed via a C# get/set or a Java method. Granted the Java method approach is a "clue" that it's not just a member int being set, but I'm not sure that's the ideal way to "get a clue"...
I understand what you're getting at with all this, but at some point familiarity with the road is going to serve you better than guardrails all over the place.
If a job's not worth doing, it's not worth doing right.
My take on this is: Java is more clear about what it is doing, C# has a nicer sintax, the code looks better, but a reader can be deceived by it.
I would go with Java, its better to have ugly code that is easy to understand
That being the case, you might want to check out assembly language. It's a LOT uglier, but you will never be deceived by assembly.
Seriously, there's so little difference between C# and Java that arguing the a gnat's hair's less abstraction is any easier to understand merely illustrates that you're conditioned to looking at Java code. Look at C# code for 6 months and you won't even notice anymore.
If a job's not worth doing, it's not worth doing right.
This is only half-true, but really only because of an incorrect belief more than anything. The JVM initially interprets opcodes until that section of code is picked for JIT, after which the executed code is native code, not interpreted opcodes.
This, however, is different than how the .NET platform works, where all MSIL (on a function level) must be JIT'd prior to execution, so in .NET there is never a point where MSIL is interpreted.
Just as long as you don't try to do any database access from your app. Mono's implementation of the ADO.NET libraries are broken :S
1178161 is prime...
C# is also not non-standard.
double non-positives don't not make baby jesus not non-cry.
you've not been unwarned.
-- Sex is the antonym of pringles. Once you pop it's time to stop.
but so do F# and managed C++. And so does Boo and IronPython. So what exactly is your point?
Depends on one's metric. In terms of potential jobs C# is about par with C++, and well below Java.
Hotjobs, title search
Java: 577 jobs
http://hotjobs.yahoo.com/job-search?kwchanged=1&kw=Java&search_title_only=title&ui_kw_type=kwall
C++: 246 jobs
http://hotjobs.yahoo.com/job-search?kwchanged=1&kw=C%2B%2B&search_title_only=title&ui_kw_type=kwall
C#: 213 jobs
http://hotjobs.yahoo.com/job-search?kwchanged=1&kw=C%23&search_title_only=title&ui_kw_type=kwall
Monster, title search
Java: 2016 jobs
http://jobsearch.monster.com/Search.aspx?re=0&brd=1&jsnonreg=1&q=java&rad_units=miles&pg=1&vw=b&jto=1
C#: 889 jobs
http://jobsearch.monster.com/Search.aspx?re=0&brd=1&jsnonreg=1&q=C%23&rad_units=miles&pg=1&vw=b&jto=1
C++: 806 jobs
http://jobsearch.monster.com/Search.aspx?re=0&brd=1&jsnonreg=1&q=C%2B%2B&rad_units=miles&pg=1&vw=b&jto=1
"I see c# as an improved version of java. The designers of c# learned from their mistakes."
The designers of C# actually learned from Delphi, which had properties in 1995:
type Foo = class
private
FdontTouch : integer;
function GetDontTouch : integer;
procedure SetDontTouch(const NewVal : integer);
public
property DontTouch : integer read GetDontTouch write SetDontTouch;
end;
Hjelsberg wrote the original Turbo Pascal compiler, and was chief architect of the first three Delphi versions before leaving Borland to work at MS, so there's a lot of Delphi in C#.
I'm not going to change your sheets again, Mr. Hastings.
In C#, the syntax allows to disambiguate it all easily. You can slap an attribute on the property as a whole, on either of the accessor methods, and you can further disambiguate explicitly where needed.
Granted, it's not something major; but it's nice to have the concept represented in the language syntax cleanly and orthogonally.
"C# has really just replaced C++ on the Windows client side, where Java never had a foothold to begin with."
It's actually replaced VB, Delphi, and a bunch of proprietary 4GLs that were previously used for corporate development and specialist low volume third-party stuff -- shrink-wrap software (including Microsoft's offerings) is still written in C++ or one of the now very small number of other compiled languages for Windows.
I'm not going to change your sheets again, Mr. Hastings.
That is just you. When I learned OOP, the term was "sending a message". As in "ourFoo.setDonTouch(5) means: send a message to object ourFoo that it should set something to value 5".
If you are a glutton for punishment go to VB.NET and code in that horrendous language structure, but still be able to do all the things you could in C#.
Actually, there are quite a few features of C# that aren't supported by VB .NET. E.g. anonymous methods/types, implicit getters/setters, a *real* ternary operator, etc.
Mostly its stuff that you can still do, but takes longer/more code. But it can be very annoying when you're writing a program in VB.NET and discover that you have to do a lot of stuff the long way - VB.NET is bad enough even with the missing features.
Most human behaviour can be explained in terms of identity.
For example, that innocent "item.price" could actually be calling an stored procedure that makes all kind of querys to get the right price for the current session customer. In Java, item.getPrice() would be a hint to this fact
Complete bollocks as well you know. The first thing any Java programmer does with any variable needed in the outside world is to write getXXX() and setXXX() precisely so they can change the behaviour of get & set operations. Don't get me started on EJB, at least the old style anyway.
I agree with you on exceptions BTW.
Unfortunately, most .NET coders are drawn to the language because it has features like this that are designed to make it easier for them to code, so they don't usually want to know that it is harder than they expected.
Trust me, I know... I've worked with people like this :-)
That's not true. The fact that 2 things are ungly and one of them is deceaving doesn't make the other one deceiving too. Java is ugly and expressive. One is not the cause of the other.
As far as C# goes, I do like the language. But IMO an equals means I am making an attribution. I dont't expect it to be "rejected" by a checker function. Note that I am not saying Java is better than C#. I am just telling you my opinion about this specific topic regarding both languages
-- dnl
Amen. Exactly what I've been saying for a couple of years. There are only two things I would like to add:
1) You missed an important factor in Java's favor: The availability of far superior IDEs. I have left the Java world, but I can tell you that VS2008 is still inferior to Intellij Idea 3.5 (of 2002).
2) You probably mean (what the grandpa forgot) auto-implemented properties:
int XXX { get; set; }
which makes the equivalent Java look like an exercise in boilerplating.
In C#, you are using assignment to represent that mechanism so you might be accessing a public member variable directly or calling a method to achieve that end.
Welcome to the wonderful world of C-derived languages like C++, C# and similar language where you can make up as you go new meaning for any operator you wish. Let's play our favorite game : "Guess what is this week's meaning for '&' operator !".
Disclaimer: I like C++ and like the line-noise alike structure it enables. I felt deeply deprivate now that I can't create operator ? with GNU.
PS: Love Perl too.
"Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
You know, I'll just call it Fucktothorpe, because getting 3/4 the way past sly innuendo and then turning back just makes me irritable.
Depending on the size, it may have been better to create a new solution/project, and just bring in the class files from the original... yeah the conversion/upgrade projects sucked... but that is a VS issue, not specifically a .Net or C# language thing.
Michael J. Ryan - tracker1.info
The real story is that "professionals" (here in the U.S.) lost interest in Pascal. The people behind the FreePascal and Lazarus projects seem to be Brits, Germans, Russians, and so on.
The one area I would fault Delphi/Pascal is not keeping up in the area of collections (the domain of the STL) and other libraries. What enhancements to Pascal have come out of Borland have made it more of a Windows-specific language than something that could run elsewhere. This is probably more driven by waning interest in Pascal rather than the lack of such things driving people away from Pascal.
To learn Mono for one thing. I could develop it in Java and still only target this one PC running Linux. Or I could use QT and C++ The choice of language is for learning how to write cross platform c#.
It's Qt damn you! Qt! Hehe. I just find it interesting that people refuse to accept correct spelling and pronunciation of proper names. Qt is pronounced "Cute", it's not "cue tee" - the same way Id in Id Software is a word, not "Eye Dee". I'm sure you can tell who's written in Qt4 before ;)
only to your mind, not to that of a business executive who feels the need to protect his company's intellectual property and maximise further corporate innovation through aggressively pre-empting market share downward factors to further enhance shareholder value. (and his bonus).
what you or I think should happen is nothing when it comes to making money.
Qt lost a lot of points in my book for just how much time was destroyed in porting our code to Qt4. Two years later, and we're still asking for bugfixes.
Just curious -- why did you port your code?
8 of 13 people found this answer helpful. Did you?
Why the overhead of .NET ?
Delphi on Win32 is faster simpler cleaner smaller
Puteulanus fenestra mortis
If you mean the final code, probably. If you mean the development cycle then I have not found it so, because under Delphi I was constantly having to reinvent wheels that are provided by .NET.
Quidnam Latine loqui modo coepi?
Compare like with like ....
Like C and C++ the Delphi language does very little - the libraries are where the action is ...
C# is the same it's just that so much is in .NET as standard ...and I can use all these from Delphi
C# is not .NET it's just without .NET it is useless ...
There are plenty of libraries for Delphi the same as there were plenty of VB controls/libraries that did all the real work
Puteulanus fenestra mortis
As far as I am concerned, it's about getting the job done. I get Windows GUI jobs done much more quickly and effectively when using C# than when using Delphi. The particular set of factors that goes into that (access to libraries, language characteristics, personal programming style, whatever) is interesting, but when I have a job to do I'll pick up the toolset that is most effective for that job.
Quidnam Latine loqui modo coepi?
The language may be, but doing most anything remotely interesting is going to create platform-specific issues. Such is the curse of a bare-metal language.
If you have the language, at least you can isolate the platform specific code and only have to rewrite that. If you don't have the language, you're stuffed.
Quidnam Latine loqui modo coepi?
That statement is simply untrue. Java's libraries have had their source available, but not the JVM. Now we have Java source redistributable under a true OSS license and most importantly the JVM source is as well.
Alexey
The laundry list of limitations in Qt3 driving the move have long since faded from my memory (though I seem to recall Vista support being a fairly large motivator.) But apart from that, ongoing commercial development requires active support, and Trolltech's support services have long since dropped support for Qt3.
Porting from Qt2 to 3 was a breeze, compared to the move to Qt4. The automated porting tools didn't do much for us, and the Q3Support layer-- while it gave us a good stepping stone-- eventually had to be ripped out almost entirely because we kept hitting all sorts of esoteric bugs that couldn't be solved without porting the code all the way.
To be fair... I like Qt a lot, and it's still my first choice for multiplatform GUI development. (Before many of the platforms sank into obscurity our app suite built from a common C++/STL/Qt codebase onto Windows, Linux, Solaris, HPUX, AIX, Irix and OSF, which still impresses the crap out of me. :) )
Or you can write it in a language that abstracts that stuff away. There are not many platforms these days where you're a) writing interesting code, and b) not able to use the JVM or Mono's CLR. (Yes, I realize both are written in C++, but that's the point--they do it so you don't have to. There's a place for C++, sure, but it's not that big and it's not in portability.)
"You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
The thing is, in C# it's your choice whether you want to use a property or function. In Java, there is no choice. If you prefer to make things more clear using a function, you're perfectly capable of doing that in C#.
The whole point of properties is that you can control access with them. Suppose i have some code that accesses a public member, and i later want to make sure that you can never assign a null to it. You either have to change all references to the member in your code, or in C#, just turn it into a property and put your check there. No other changes needed.
All language features have the potential for abuse. It's a good programmer that makes sure you don't abuse them.
If you need web hosting, you could do worse than here