24 ms·
C# Language Specification 5.0
- mpyne 13y agoMS Word or Word Viewer to see the specification? Really? Good to see nothing ever really changes in Redmond.
- dangrossman 13y agoIs there something in this document that prevents you from reading it in your preferred viewer? The extension suggests it's just an Office Open XML doc. I can read it in QuickOffice on my Android phone.
- mpyne 13y agoGiven that my preferred viewer for this kind of thing is Okular, with a fallback to Firefox+pdf.js if necessary, it's already struck out twice. My Android doesn't have Quick Office, it does have ThinkOffice but I can think of no reason I would a) read a computer language spec on my cell phone, or b) ever use ThinkOffice on purpose.
- dangrossman 13y agoI think you've missed my point there. I wasn't suggesting you read it on your phone, I was demonstrating that you don't need Word using what was handy to me at the time (QuickOffice is owned by Google and was preinstalled). It's not a Word document. It's an office open XML document which dozens of free and commercial word processors and web apps can read and write. Not using your choice of previously-proprietary document formats doesn't make this an "oh, Redmond" moment.
- JoshTriplett 13y agoOffice "Open" XML is a proprietary format that got rubber-stamped as a standard to convey a sense of legitimacy. Significant parts of that standard say "do it like Word does" with varying degrees of indirection. Other office suites and viewers support it because they have to, not because the "standard" makes it any easier to do so. Comments like this one suggest that the rubber stamp does indeed convey some legitimacy, which I'd consider unwarranted. As a specification for a language coming out of Microsoft, it isn't unexpected to see it in Word format, and it's certainly possible to cope with it using any number of other tools without resorting to Word, but that doesn't make it a good idea. Use PDFs.
- mynameisvlad 13y agoBe happy it's not XPS.
- tzs 13y ago> Significant parts of that standard say "do it like Word does" with varying degrees of indirection That's not correct. What it actually does is reserve some markup for use by third parties that have reverse engineered various old programs (including programs that competed with Microsoft programs), so that if those people have workflows that depend on features of those old programs that cannot be represented in OOXML, they can still use OOXML as a storage format but add in the extra information they need. Here's the use case this is aimed at. Suppose I run, say, a law office, and we've got an internal document management system that does things like index and cross reference documents, manage citation lists, and stuff like that. The workflow is based on WordPerfect format (WordPerfect was for a long time the de facto standard for lawyers). Now suppose I want to start moving to a newer format for storage. Say I pick ODF, and start using that for new documents, and make my tools understand it. I'd like to convert my existing WordPerfect documents to ODF. However, there are things in WordPerfect that cannot be reproduced exactly in ODF, and this is a problem. If my tools need to figure out what page something is on, in order to generate a proper citation to that thing, and I've lost some formatting information converting to ODF, I may not get the right cite. So what am I going to do? I'm going to add some extra, proprietary markup of my own to ODF that lets me include my reverse engineered WordPerfect knowledge when I convert my old documents to ODF, and my new tools will be modified to understand this. Now my ODF workflow can generate correct cites for old documents. Note that LibreOffice won't understand my additional markup, and will presumably lose it if I edit a document, but that's OK. The old documents I converted should be read-only. Of course, I'm not the only person doing this. Suppose you also run a law office, with a WordPerfect work flow, and are converting to an ODF work flow. You are likely going to add some proprietary markup, just like I did. We'll both end up embedding the same WordPerfect information in our converted legacy documents, but we'll probably pick different markup for it. It would be nice if we could get together, make a list of things we've reverse engineered, and agree to use the same markup when embedding that stuff in ODF. And that's essentially what they did in OOXML. They realized there would be people like us with our law offices, who have reverse engineered legacy data, that will be extending the markup. So they made a list of a bunch of things from assorted past proprietary programs that were likely to have been reverse engineered by various third parties, and reserved some markup for each.
- kivikakk 13y agowhat on earth would you expect?
- 3825 13y agoPDF or Postscript. Word is not a format that you should share finalized document. Why does anyone need to edit a spec? If there is a good reason to edit, perhaps they should have made it an HTML document. Use LaTeX. Are they afraid the Office division will get them fired if they use anything other than Microsoft products?
- zanny 13y agoMaybe use epub then if you don't need the vector processing facilities of pdf. I find a mostly-text book will be 20% the size as an epub.
- kivikakk 13y ago> PDF or Postscript. Word is not a format that you should share finalized document. Why does anyone need to edit a spec? PDF, sure. Postscript, uh, maybe missing the target audience a bit there. > If there is a good reason to edit, perhaps they should have made it an HTML document. Use LaTeX. Are they afraid the Office division will get them fired if they use anything other than Microsoft products? hahahahaha. Perhaps they think it's a good wordprocessing product which can be used by many different roles in the business? And yes, there's a lot to be said for a company using its own products where they fit.
- Systemic33 13y agoWouldn't XPS be the best equivalent to PDF ?
- mpyne 13y agoI think that's the near-equivalent but I don't think that even Microsoft is trying to dogfood that anymore.
- biot 13y agoI recall years ago reading that the reason Microsoft releases their documentation in Office format (other than the whole eat-your-own-dog-food thing) is so that they have the ability to cryptographically sign the documents.
- mpyne 13y agoFair enough, but PDF can do that as well.
- ww520 13y agoBut don't you need Adobe Acrobat to sign it? I won't fault them for using their own tool.
- mpyne 13y agoIf we were talking about almost anything else from MS I'd probably agree with you. But this is the specification to a computer programming language, a language that MS has tried over and over to assuage the fears of open-source developers about. "Oh, it's standardized by ISO and ECMA!". "Look, Mono is proof it can be implemented cross-platform!", etc. And then they do stuff like this. On the other hand look at the excellent work done by Microsoft Research (and then look at what format that final work is usually published in).
- pjmlp 13y agoAs a regular reader of Microsoft Research papers, I can assure there are quite a few of them published in Word and PowerPoint formats.
- ygra 13y agoQuite a few of them are also LaTeX. Generally it's probably the same distribution of formats you see in academia as well. And often the publishing journal dictates what to use.
- yjh0502 13y agoHere's PDF version: https://www.dropbox.com/s/dt6xzum432zine0/CSharp%20Language%20Specification.pdf https://www.dropbox.com/s/dt6xzum432zine0/CSharp%20Language%...
- 3825 13y agoHere's another version: https://www.dropbox.com/s/4n6sg31v0v3nfok/CSharp%20Language%20Specification.pdf https://www.dropbox.com/s/4n6sg31v0v3nfok/CSharp%20Language%... 5.48 MB / Has bookmarks from document headers / For download and offline reading if you want to navigate to specific chapter quickly / Not for online viewing (the parent version is only 3.70 MB and is better if you're bandwidth-capped).
- samrift 13y agoA note to those that may be confused: C# 5.0 is the language version used by visual studio 2012, which was released in August of last year, alongside the .net framework 4.5. This is an updated revision, although a cursory look didn't reveal any differences to me. I'm sure a few people were wondering if this was to go alongside Visual Studio 2013, expected to be released in beta later this week.
- danbruc 13y agoC# 5.0 adds asynchronous methods [1] and caller info attributes [2] to the language. They also changed respectively fixed the way foreach loop variables are captured in closures [3] and changed the overload resolution algorithm [3] and argument evaluation order [3]. [1] http://msdn.microsoft.com/library/hh191443.aspx http://msdn.microsoft.com/library/hh191443.aspx [2] http://msdn.microsoft.com/library/hh534540.aspx http://msdn.microsoft.com/library/hh534540.aspx [3] http://msdn.microsoft.com/library/hh678682.aspx http://msdn.microsoft.com/library/hh678682.aspx
- samrift 13y agoI'm sorry, I meant that I didn't see any differences from the C# 5.0 specification released in August 2012 and the revision posted here, which was updated in June 2013. I am aware of the differences from c#4 to c#5. My point being that c# 5.0 is around 1 year old, and this spec is not new.
- danbruc 13y agoMaybe someone else will still find the information helpful. I also just noticed that the copyright still says 1999-2012 - maybe they just reuploaded it.
- sshconnection 13y agoI wish we had an accurate spec for Ruby. RubySpec project is great, but we still let the language be defined in terms of MRI implementation.
- seanmcdirmid 13y agoSun started the trend when Guy Steele and Gilad Bracha (among others) wrote the initial Java Language Specification. Microsoft has a strong team of PL researchers, including Mads Torgersen and many people at MSRC (who published a paper on formalizing Async in ECOOP 2012), to do this work, which I think is very useful.
- kailuowang 13y agoAsynchronous method... interesting. It seems to me that each version they just incorporate a little bit of some hot paradigms into this language that started as a sweeter(or less painful) java. I remember that during the ruby boom they added the "dynamic" feature into it. Together with linq, and lambda, is it me or all these attempts sometimes appear awkward and out of place?
- pixie_ 13y agoI program in a lot languages and C# is heads and shoulders above everything. It doesn't feel hacked together at all. It's like someone with a real vision put a lot of work into making a great language. Too bad project requirements usually dictate the language I have to use.
- kalininalex 13y agoOne of them is Eric Lippert. If you use C# you'll enjoy his blog, http://ericlippert.com/ http://ericlippert.com/.
- hosay123 13y agoAs a (hardened, old) unix dev, it seems to me you've spent little time with the language. C# is one of the most successfully evolved languages of recent times, no feature was added that didn't have a clear & concise story in the context of all other features. No Anders & co didn't just add whatever they felt fashionable, they've designed a language over the course of a decade with (to my knowledge) zero warts, bringing to the table more than 20 years of prior design experience (Turbo Pascal, Delphi). If it weren't for the stigma of being a Microsoft design, C# would be a hugely more popular language.
- frozenport 13y agoI felt it compromised C++'s low level compatibility in exchange for increasingly verbose expressions. Perhaps C# has nothing to offer except for Microsoft's ecosystem. Valid in 2005 but not today.
- skwirl 13y agoAn interesting change in C# 5.0 involves the handling of foreach iteration variables when used in closure scope. This is technically a breaking change, although it is really hard to think of a case where the old behavior was legitimately desired. Consider (stolen from the spec doc): int[] values = { 7, 9, 13 }; Action f = null; foreach (var value in values) { if (f == null) f = () => Console.WriteLine("First value: " + value); } f(); In previous versions of C#, there is a single value variable is in the scope of the entire loop, so the above code would actually print out the last value in the list because that was the value of value (sorry) when the loop finished. In C# 5.0, a value variable is actually in the scope of each individual iteration (so within the braces). So now if you use your iteration variable in a closure scope it won't change on you when the loop iterates and the above code actually prints out the first value. The same cannot be said for a for loop. It still functions as it always has.
- danbruc 13y agoHere is Eric Lippert discussing the pros and cons of making the change. http://blogs.msdn.com/b/ericlippert/archive/2009/11/12/closing-over-the-loop-variable-considered-harmful.aspx http://blogs.msdn.com/b/ericlippert/archive/2009/11/12/closi...
- gnaritas 13y agoShould have been that way from the beginning; having the loop variable have function scope was absurd to begin with and forced developers to copy the loop var to a local before using it in a lambda.
- skwirl 13y agoYeah, they could have made the change in C# 3.0. I just don't think anyone really felt the pain until the Task Parallel Library came along in .NET 4. Since the TPL API is lambda heavy people really started using lambdas for asynchronous tasks, which leads (or used to lead, anyway) to pain and misery when using a loop iteration variable. It could always be worse, though. Look at JavaScript. Simply copying the loop variable in the body of the loop doesn't work because all variables are scoped at the function level. So your "local" loop variable is actually a single instance for the entire function and you have the same exact problem. Instead, you have to actually create another function and immediately execute it with the loop iteration variable as an argument, and then use the parameter within the function to do whatever you wanted to do. Not cool.
- bsaul 13y agoAnyone knows if C# is used inside microsoft to buiild desktop app ( office ? Visual studio ? ) I remember it wasn't the case for a long time but stopped watching since.
- TheMakeA 13y agoThe Visual Studio IDE and Expression Blend are (or at least were) WPF... I guess there's a pretty good chance it was C# rather than VB.NET. Not sure if there is anything else though.
- rbirkby 13y agoVisual Studio since 2002 (.Net 1.0) has been partly written in C#/WinForms and then C#/WPF. Visual Interdev (from which the current Visual Studio lineage descends) was partly written in VJ++. It was these bits that were ported to C#/COOL for the 2002 release.
- rottyguy 13y agoIsn't part (majority) of their Singularity OS written in C#? I've been waiting to see if they were ever going to release the realtime GC as part of that project to the C# community at large.
- BillyMaize 13y agoWhy, if this is version 5.0, does the document it downloads say version 4.0? Am I the only one seeing this? The details also mention previous version 3.0 on the webpage.