67 points · by wubbfindel · 13y ago · 105 comments
It's got all the awesome features most of which are very elegantly implemented and accessible in a very streamlined fashion. Obviously if you hate C-syntax, C# isn't going to win any brownie points, but in terms of sheer power and flexibility, C# 5.0 steals the cake by a huge margin. Lambdas, parallelization, anonymous functions, interop with C functions, fast compilation, "fast" execution, awesome bytecode, and more. Constantly iterating, but not breaking with the original design goals.
It's borrowed the right features from the right languages, the right syntax from the right languages, and the right design choices from the right languages.
(Although I do dislike how the new dynamic keyword is implemented. It throws then catches too many exceptions under the hood and people really need to understand it before they use it. It was primarily designed to convert unknown/random JSON to a C# object on the fly and should not be abused. Many people coming from dynamically-typed, loosely-defined languages might think it's an easy way of adapting to the traditionally statically-typed and statically-defined C#... not so.)
(And, like it or not, it really is a cross-platform language. Mono does count and is pretty awesome. Esp. if you think about the compatibility of the language and not the framework.)
I'm still a die-hard C/C++ coder, but C# won my heart a long time ago.
C# 5.0? Take a look at this example code from the MSDN blog which is "showing off" the new features of C# 5.0. (It was formatted this way with no indentation on the blog). This example, not by coincidence, demonstrates how .NET interfaces with the web.
private async void
btnTest_Click(object sender, EventArgs e)
{
var request = WebRequest.Create(txtUrl.Text.Trim());
var content = new MemoryStream();
Task<WebResponse> responseTask = request.GetResponseAsync();
using (var response = await responseTask)
{
using (var
responseStream = response.GetResponseStream())
{
Task copyTask = responseStream.CopyToAsync(content);
//await operator to supends the excution of the method until the task is completed. In the meantime,
the control is returned the UI thread.
await copyTask;
}
}
txtResult.Text = content.Length.ToString();
}
What does that code do? It works behind a form running on the desktop, where you press a button to do an async HTTP request and display the content length of the response.First of all, why would I want to create an application that runs on the desktop, rather than build a web application that I can show to people with a link? Especially
If I were going to do the same thing with a web application then I would probably do something like this in CoffeeScript:
$.get $('#url').val(), (res) -> $('#res').val res.length
I'm sorry, but I don't see C# as being the most damn awesome all-around language. I like CoffeeScript, or maybe even better, LiveScript (http://livescript.net). Or failing that, plain-old JavaScript. var HtmlLength = new WebClient().DownloadString("http://news.ycombinator.com").Length;
or if you want the length in bytes: var ByteLength = new WebClient().DownloadData("http://news.ycombinator.com").Length;
Want to do it asynchronously? var ByteLength = new WebClient().DownloadDataTaskAsync(url).Length;
That code sample you posted is to demonstrate in a rather loquacious fashion the new C# 5.0 features.As for why create a desktop application rather than a web-based app, I'm not even going to dignify that with a response. Apples and oranges.
res.Text = (await new HtppClient().GetStringAsync(url.Text)).Length.ToString();
(Disclaimer: I work at MS.)
$.get $('#url').val(), (res) -> $('#res').val res.length
Or using LiveScript backcalls is even cooler: data <-! $.get '/x.html'
$ \.res .val data
Or in IcedCoffeeScript if you like 'await' await $.get 'documentation/css/docs.css', defer res
console.log res
Or check out the huge list of languages that compile to JavaScript at http://altjs.org/To take proper advantage of the hardware and provide proper integration with the operating system.
The browser is for documents.
Xamarin (the monodevs) are doing some really interesting stuff:
http://xamarin.com/evolve/2013
Frameworks such as MvvmCross allow you to target iOS, Android, Windows 8 Mobile, Windows 8 Store, WinRT, WPF all using the same codebase using the MVVM Pattern. Write your code business logic in a PCL and share it across all platforms, i.e. 80% code re-use on mobile, write your UI for each platform and link against your shared core business logic PCL.
https://github.com/slodge/MvvmCross
Oh, you can do all of the above, program for all those platforms (iOS included) in Visual Studio with either C# or F# using async/await and linq.
Disclaimer: I went to #evolve, if you use .NET and didn't go then sorry to say you missed out ;-)
Personal highlights from the conference include:
- C# async/await on iOS, Android announced and available in the beta update channel.
- Xamarin acquires Calaba.sh (lesspainful), announces the future of automated mobile phone testing: http://xamarin.com/evolve/2013#session-xcjpj20d6s
- 80% code reuse case study: http://xamarin.com/evolve/2013#session-shy07zqsoz
- Behind the scenes with the award winning game Bastion (monogame): http://xamarin.com/evolve/2013#session-mazw2c15qr
- (Scott Hanselman) How C# Saved my Marriage, Enhanced my Career and Made Me an Inch Taller: http://xamarin.com/evolve/2013#session-umfpnw90c9
- (Josh Collins - @GlobalMoxie) Buttons are a hack: can't wait for vid to be uploaded...
Open source is not the solution to every problem.
There are businesses that value the support, packaging, and overall completeness of the .NET stack. Yes, they cost money to deploy, but so do open source alternatives. People will argue that MS will lock you down. Yet, if you start developing under Rails or Django, its pretty hard to move away when things get going.
I loved Amazon EC2 too but Azure was far cheaper for high use Windows VMs.
Another option is to switch to mono and run your .net apps with EC2's Linux prices. Then it's even cheaper than Azure. This is what I did for my current project.
So where does that leave Windows for internet servers?
We're currently in the process of getting ready for a migration to Sharepoint Server 2013 which will cement the company with .Net for at least the next two to three years. We still have several sites on the old 2007 platform with no hint of moving those over any time soon.
I'm wondering what you see as viable open source alternatives to the .Net platform.
Also, we have a handful of .Net developers and they've all said a majority of the work they've had in the last year did not involve MVC3 or MVC4 so I'm also wondering what the future of this platform will be.
.NET vs Ruby is a whole holy war which I'm not going to get into, but there are a lot of people out there who like to get shit done, and find that .NET (and MVC) works just fine (great even) for that.
Incorrect assumption (source: developer at huge corporation on huge projects)
Point is, there was no huge shift to MVC after it was released. A ton of web projects are still made using WebForms and will continue to be. MVC will continue to be a minority framework.
Mono? http://en.wikipedia.org/wiki/Mono_(software)
Or going in a different direction with similar goals, Qt.
Don't get me wrong, Mono is awesome. But it's not about to be adopted by Fortune 500 companies across the world.
You are funny.
I used it for adding the boilerpipe Java library to navigate HackerNews by voice! Details at: http://blog.databigbang.com/voice-recognition-content-extrac...
Mono is pretty damn complete. The stuff I've found it to be missing are very Windows-centric stuff and wouldn't fit in a Unix environment anyway.
Meanwhile, in the real world, Microsoft posted these earnings:
"Server & Tools business reported $5.04 billion of revenue, up 11% from last year"
Inspite of competing products like Linux, Apache, Eclipse, Ruby, Java being given away for free, people are willing to pay for Windows Server, Visual Studio and IIS.
Does anyone have real data related to ".NET is dying" other than idle conjecture, short sighted "frog in the well" anectodes which sound like they're written and voted up by people sipping on a latte on a Macbook in a Starbucks in Silicon Valley?
Like the number of jobs posted? They seem to increasing every day.
Sigh, some people here just love these '.NET is dying' posts, perhaps some with a vested interest to scare startups from using it.
Again, any hard data will be appreciated that shows .NET is dying instead of the same paragraph upon paragraph of opinion and no links, references or data, we have enough HN comments of that already.
And I think that is one of the main reasons that many .NET developers who are a little bit familiar with open source and non-Microsoft technologies are starting to wonder if its worthwhile paying all of that money to have Microsoft make all of those architectural decisions for them.
Just start with the name, ".NET". What were they referencing there? The network. The web. Especially if you interpret that to mean the web, which I think it really is referring to, you have to ask yourself, is Microsoft or ANY one particular company really leading the way on the web? I think the answer is no. The leaders may be employed by some particular companies like Google, but they are mainly organizing projects on their own through things like github.
They chose that name for a reason. They knew if they wanted to stay relevant, they needed to focus on the web.
Does web development need Microsoft? Ask the average web developer. Personally, I don't think I can ever forgive them for what they have done (and continue to do) to Internet Explorer.
Does Microsoft need web development? Actually they are opposing forces when it comes right down to it. Microsoft makes too many billions of dollars through Windows-related products to really push the web platform forward. So they have actively been working to impede it by pushing out incompatible and underpowered browsers.
Can Microsoft's traditional licensing revenue streams survive a real conversion to open-source? LOL.
I don't buy that for a minute.
The Windows Server division is one of the fastest growing divisions inside of Microsoft.
From their last Q3FY13 report revenue from server and tools grew 11% driven by SQL server and Windows Server growth.
Based on those figures business is scrambling to buy into the Microsoft toolchain, not trying to leave.
With cross-platform compatibility, specifically mobile compatibility [on platforms people actually use, i.e., not Windows Phone], being a major sticking point, .NET is becoming less and less desirable on the surface level.
Microsoft is just like Oracle. Big fancy businessmen who know nothing about development automatically buy into the MS stack just because it's a big name and the labor is easy to retain. Hardly any technical considerations go into it, and then they're upset when they [eventually] learn that the end result won't work with the iPad.
What about the alternate explanation that Windows Server is growing because demand for the products that already use Microsoft's stack is growing, despite the stack itself? What about the explanation that people are buying more server licenses than they used to due to increasingly widespread virtualization deployments? Whereas people used to buy relative big metal and run one OS on it, now people are taking that hardware and deploying many small VMs across it, each requiring its own license?
There are plenty of interpretations of that data that aren't "people are flocking to .NET".
PS: I have seen it both ways, Java redeveloped in .Net and .Net redeveloped in Java. Generally things where better in the .Net world. I spent years as a Java developer and find the idea of going back is horrifying.
And the red herrings about the name .NET don't make any sense except if you look from the context of the prevalent buzzwords and jargon at the end of 90s. Like, say "dotcom".
So, yes, most microsoft products are incredibly damaging for a startup.
Not every startup has to work with the small amount YC hands out. I know of a fair amount of startups using an MS stack, and they are doing very well. Of course, they are not SV cool, but they are making good money. You should sit back and analyze what you just said, because it is a pretty strange point to make.
In my last employer (government), we didn't choose .NET, microsoft won the contracts. In the last update when I still worked there, we spent 250k USD to update our programmers VS to 2010 + windows 7. (I wonder if they will now update again). SQL Server prices are similar to oracle's with similar features.
In my startup (not a startup anymore) I had to spend 40k just to get the environment needed for a project (involving telephony) the only reason we had to use .NET was because the hardware manufacturer only provided driver+tooling for windows and some components were exclusively for .NET. Because we mostly use linux and macs, we also had to buy windows licenses. In my country, a Windows 8 license cost almost 2x the minimum wage.
We happened to have a discussion if we should give up or not a specific product because of the microsoft taxation on our business. The only reason we decided to keep using .NET is the cheap labor and the lack of hardware suppliers willing to provide us drivers and tools for linux.
So yes, microsoft damages not only startups, but companies in general.
(a) The money YC is giving isn't intended to solve capex problems like this. It's meant to make the first couple months of getting a minimal offering viable for small early teams. In the YC model, if the problem your business solves involves significant capex costs, you use YC to match your company with a next round of investors to handle that problem.
(b) The reality is that you do get enough money to fund a .NET stack when you get into YC, because YC comes with an assurance of immediate follow-on convertible note investment.
Neither of these two points makes .NET a better choice for early-stage startups than Rails or Django or PHP; Microsoft has to smooth over the expense problem with programs like Bizspark.
How you would do a startup in a world without BSD and Linux, just with commercial vendors?
There are more out there than just Apple and Microsoft.
In any case, if you want to work with the best tools, sometimes you have to pay a premium to get them. That's either damaging to people who can't/won't pay the money or it's an advantage for those with enough confidence in what they're doing to make the investment, depending on which side of the line you're on.
Prime example: Stackoverflow/StackExchange is built on the Microsoft stack.
So, they made in a year something around what Apple makes every quarter just from iPad sales? That's the rosy sign MS's "Servers and Tools" business is doing OK?
That's their server and tools revenue in a quarter, not a year. In your rush to compare it with an irrelevant and totally unrelated figure you've taken leave of facts and reality.
Why not compare the yearly figure now with how much Exxon makes by selling gas and then conclude the Server and Tools division is not doing okay? I mean that's what you want to conclude right?
Haven't taken out any facts -- the parent poster (you?) didn't add it was a quarter result in the first place. And the "X% up from last year" didn't help.
That said, it's totally unrelated only in that the end product sold is different. People still compare companies based on their revenue all the time -- including totally different beasts such as IBM and MS, or, indeed, Exxon and Apple. If you want to measure relative strength it's quite insightful.
>Why not compare the yearly figure now with how much Exxon makes by selling gas and then conclude the Server and Tools division is not doing okay? I mean that's what you want to conclude right?
No, I want to conclude that MS, and their enterprise sales specifically, which was once the huge behemoth of the computing industry, makes a not that impressive revenue compared to other players.
It might even be their best revenue ever. It still is worse compared to what they made vs what other companies made a decade or so ago.
In other words, the point I tried to make, maybe unsuccessfully, is that they might be billionaires, and they even might more than ever, but whereas once they used to own the town, now there are several other billionaires around, including some multi-billionaires.
Amazon's AWS, on the other hand, is estimated to have brought in between $1.5 and $2 billion (http://go.bloomberg.com/tech-deals/2013-03-07-what-if-amazon..., http://www.informationweek.com/cloud-computing/infrastructur...) during the same period.
So while Azure is still booking less business than AWS is, it's definitely a major competitor. Maybe the major competitor. And since the market for virtualized platforms is still in early days, there's lots of room for that revenue figure to grow substantially even if Azure ends up stuck at #2 behind AWS forever.
I see Azure as a cloud service for Windows dev, I might be wrong it, Azure may just have an image problem but it just doesn't ring a bell outside the Windows world.
I have worked for years as a .Net consultant, and I had no idea Azure had grown this quickly. A couple of years ago, I thought their entire set of literature was counter-intuitive, and I quit paying attention to them.
How on Earth did they grow to be in AWS's league so quickly? Surely just getting the "default Microsoft business" wasn't enough to put them at $1 billion ??
One month, web sites, another virtual machines, then Hadoop. Oh, wait, and mobile services. The list goes on; they've catched up with Amazon on offerings more or less.
Oh and let's not forget that Azure support is fucking awesome.