C # unveiled II (what is the master?)
First declare this article is a collection of nature, which is recommended to those who like DOTNET technology. Before this, I turned O'Reilly's interview with C #. O'Reilly has always been public with technology and comments. Their editor usually has a deep technical background and skill (so the book is more expensive ", so that the entire popular technology, there are many Java related And this article is a few masters inside the MS chat, involving the scope of the last interview, and there are some very novel terms and many problems. In addition, I think this article is very helpful for people who have been very familiar with COM , ASP and Window DNA (N-layer structure) and thinking to new DOTNET system migration.
Anders Hejlsberg is a very strange person, from him, you don't feel the fanatics of a program language, but it is easy to feel the firm and deep and deep of the technical language to the program. understanding. I really like him in the previous interview record: "Language IS A Funny Thing: It's A Matter of Taste. Language IS Almost A Religious Thing, And It's A Lifestyle Choice For Programmers." But I know this sentence. Not himself. There are also some people in this article: Brian Harry, Peter Golde, Scott Guthrie (ASP Old Blame), Mark Anders. With these people, Microsoft is blessed.
The god of the small gas 2001.09.24
Conversations on .net
Derived from ON-Line Chats with Our Early Adopters, A Series of Conversations With Microsoft Engineers, Designers, And Developers Look at Issues Involving C #, ASP.NET, AND THE COMMON LANGUAGUAGE RUNTIME.
http://msdn.microsoft.com/library/default.asp?url=/library/techart/dotnetconvers.htm
Summary: What Follows IS A Series of Conversations With Microsoft Engineers, Designers, And Developers, Looking At Issues Involving C #, ASP.NET, AND THE Common Language Runtime. (10 Printed Pages)
A conversation with
Anders
HEJLSBERG
and
Peter
Golde
On C #
Anders
HEJLSBERG
is a Distinguished Engineer in the Developer Division at Microsoft Corporation. He is the chief designer of the C # programming language and a key participant in the development of the .NET Framework. Previously,
Anders
WAS The Architect For Visual J and The Windows Foundation Classes.
Peter
Golde
is a Software Design Engineer in the Developer Division at Microsoft Corporation. Peter has worked on development tools at Microsoft for over 10 years, contributing to products such as Microsoft C, OLE Automation, Visual Basic, Visual Basic for Applications, and Visual J . Q :
Peter
You attendeded the ecma meetings in march. Can you disclose anything About What's going on there? new?
Peter
Golde
:. Sure As some of you may know, Microsoft, Intel, and HP jointly submitted two specifications to ECMA for standardization via the ECMA process These two specifications are the C # language and the common language infrastructure (CLI), which is a subset of. The .NET Framework. We're Meeting with a Number of Companies Every Month As Part of The Standardization Process. It's Difficult To Predict The Schedule with Absolute Certainty, But We Hope That E
CMA
Will Be Able To Complete Standards for Both Parts by the end of 2001.
Q: How does The CLI COMPARE TO THE CLS AND THE CTS?
Anders
HEJLSBERG
: CLS Stands for Common Language Specification, CTS Stands for Common Type System. The CLS IS A Specification Of What Features Any Programming Language Implement On The .NET Platform Must Support.
Q: OK, The CLS is Less Than The CTS. WHERE Does The CLI FIT?
Anders
HEJLSBERG
: The CTS is basically another word for the type system in .NET, ie a specification of what a class, struct, enum, or such is CLI is really just another word for the large subset of the .NET Framework that we submitted to. ECMA.
Peter
Golde
.
Q:
Anders
After Your Work ON
Turbo
Pascal
,
Delphi
, Visual J and now C #, How do you see programing language? Evolving today?
Andershejlsberg
: Jeeez, had to ask an easy one, eh I guess I'm becoming less and less of a believer in revolutionary approaches to language design It really is amazing how much the capabilities of computing have evolved, yet we're basically still?. Using The Same Kinds of Programming Languages. It Gives Me Hope That We Can Go Even Further With An Evolutionary Approach Where We don't just invalidate all the work today went before.
Q: HAVE YOUGHT MUCH ABOUT MOVING TOWARD AN INTENTIONAL Programming Model?
Anders
HEJLSBERG
:.. Can not say that we have As I see it, one of the problems of intentional programming is that you're basically creating a new programming language for every domain specific application I really am more of a believer in having a core set Of Abstractions (SUCH AS CLASS, Methods, Properties, And Events) and then Applying Them IN Each Domain-But in A Way That Preserves Familiarity.
Q: Customers looking at the .NET Framework for their application development efforts have asked whether or not the common language runtime (CLR) is a virtual machine (VM), and if so, what limitations or penalties associated with VMs (performance and so forth WILL FOLKS NEED TO Consider In Their EFFORTS?
Peter
Golde
: Yes, I think that the CLR can be considered in the broad class of things that one might call a VM As to performance, though, I do not think that this classification says much of anything interesting about performance You should judge performance.. By Measuring Performance On The Applications That You Are Interested In. Don't try to prejjudge Performance based on Your Preconceptions About What Will and Won't be Slow-Just Test IT!
Q:
Peter
Are there anyk..
Golde
: In Terms of What Applications I Wouldn't Write, I Would Say That "HARD Real-Time" Kinds of Programs Probably Wouldn't Be a Good Fit (At Least Right Now), Because We don't make strong Guarantees About ...................
Q: Can you discuss Any Advantages C # Would HAVE OVER VISUAL BASIC (VB) in Terms of The Framework?
Anders
HEJLSBERG
: Regarding C # vs. Visual Basic, it really primarily comes down to what you already know and are comfortable with It used to be that there was a large perf difference between VB and C , but since C # and VB.NET use the same execution. Engine, You Really Should Expect the Same Perf. C # May Have a Few More "Power" Features (Such as unsafe code), and vb.net may be skewed a bit more Towards Ease of Use (EG LATE BOUND Methods Calls), But The Difference 40..
Q: OK, Can You Contrast C # with VB.NET? Questions Usually Come In The Form of "i know you do the display, but c # WAS Designed for the CLR, SO I DON ' T Believe You When You Say VB.NET IS JUST As Good. "
Anders
HEJLSBERG
: Regarding C # versus VB.NET, the reality is that programmers typically have experience with either C or VB, and that makes either C # or VB.NET a natural choice for them The already existing experience of a programmer far outweighs the small differences between. the two languages.Q: It has been said a few times that C # is the language designed for the CLR Considering that all the languages that Microsoft will ship with the VS.NET will be able to target all the features of the CLR, what. Makes C # More CLR "Friendly" THAN THE OTHER?
Peter Golde: I do not think that C # is necessarily any more friendly to the CLR than other languages The CLR has been designed to accessible via be multiple languages However, you will probably find that C # is more strongly focused on the CLR than.. other languages like C , which have a number of other facilities that are less oriented toward the CLR. By designing C # in conjunction with the CLR, we have the "luxury" of not having backwards compatibility constraints.
Q: Is there i = = = =?
Anders Hejlsberg: For two reference types (classes), the default Equals () method is the same as == But for value types (structs), there is no == operator unless you provide an implementation in the value type..
Q: Is Lock (this) SIMILAR TO THE SYNCHRONIZE KEY WORD IN JAVA?
Peter
Golde
: Yes, lock (
Q: We mostly want the COM benefits of memory caching, independent process space, etc .; we do not need to worry about database transactions Is this a valid reason to place CLR components into COM , or is it better to just let the. CLR HANDLE IT? Anders
HEJLSBERG
: I Would Look at .NET Application Domains and not use card in That Case.
Q: Can you elaborate on .NET Application Domains?
Anders
HEJLSBERG
:... Sure An Application Domain is sort of like a light-weight process Two application domains will share the same GC heap, but the CLR provides automatic and transparent marshalling between the application domains It allows you to protect light-weight processes from each Other without taking the fairly large overhead of an os process.
Q: Is The Application Domain a Similar Concept to the java package?
Anders
HEJLSBERG
: NO, A Java package is a different thing. The Closest Analogy IN .NET IS An Assembly.
Q: What are the plan to allow allow c # code to run on a pocketpc?
Peter
Golde
: We've announced that we'll have a ".NET Compact Framework" that will be optimized for portable devices Obviously there are limitations in terms of the scope of the class library, memory limitations, and so forth compared to the desktop or. server. I should add that one of the focuses of the ECMA standardization work is to standardize a library framework that is appropriate in size and scale for portable devices. There is obviously a large amount of interest in this from many companies.
A conversation with
Mark
Anders
and
Scott
Guthrie
ON ASP.NET
Scott
Guthrie
co-founded the ASP.NET Team and leads the design team responsible for architecting the product His individual technical contributions include:. ASP.NET Web Forms Page Architecture, ASP.NET Web Services Infrastructure, ASP.NET Compilation System, ASP.NET
Distributed
Session
State
Infrastructure, ASP Deployment Architecture, ASP.NET Reliability System, and the asp.net http runtime architecture. Prior to asp.net,
Scott
Was a member of the Iis and windows nt teams.
As The Microsoft Product Unit Manager of The .NET Framework,
Mark
Anders
leads the team that designs and develops the .NET Framework, including ASP.NET, Windows Forms, Base Class Libraries, and other class libraries. Prior to this, he co-founded the ASP.NET team and held lead positions in program management as Well as development.
Q:
Scott
,
Mark
, if you had to pick one thing, what do you think?
Mark
Anders
: Well, I'll tell you the feature that gets the most applause:!. ". The coolest thing I've ever seen" it's tracing Seriously, it's almost a spontaneous standing ovation One guy who I showed it to said that it was (Note, I Wouldn't Go That Far!) Actually, My Favorite Feature IS Server Controls.
Scott
Guthrie
:. I think the partial page output caching feature that we are going to ship in Beta2 is probably the coolest developer feature, because it can dramatically impact the performance of literally any site The xcopy deployment features (no restart on DLL updates) we have I Think also are pretty close.
Q: Tracing is a great feature. One of the qustions We get a Lot: is there any penalty for haVing all the Tracing code But Turning IT OFF WHEN GoING INTO PRODUCTION? Scott
Guthrie
: There should not be any noticeable performance difference when tracing is turned off (but code left in) One thing to keep in mind, though, is that if you have expensive "trace calculations" that you output as part of tracing, then. You Should Scope It With An "IF (TRACK.ENABED = True) The" Block. When Tracing is turned off, "trace.enabled" Will Return False
Mark
Anders
: Note That we don't gather all of the statistics if trace == false.
Q: could you discuss the security of the config files. I have seen a lot of concern That Since They Are Simple XML Files, They Can Be Hacked Into Easily.
Scott
Guthrie
:. We do block all access to the config files from remote users However, I think the concern people have is whether a rogue user who gets access to the config file can modify and take over things Note that this problem exists with ASP today as. well, in that the metabase APIs can be written to, which would effectively do the same thing. However, there are some things that you can do to reduce this problem. Specifically, with ASP.NET we support the ability to "lock down" . settings at a parent directory For example, you might want to lock down the security identity of the worker process (ie: the username it runs under) at the machine level and then restrict sub-applications' abilities to override it.
Q: I see confusion as to whether to mimic the Windows DNA model by creating ASP Presentation interfaces talking to COM components, or in the .NET era to just write code behind and stick Dynamic Link Libraries (DLLs) in the / BIN and be done With it.mark
Anders
: I Would Say That Services Provided by Com Are Still Required if you want
Scott
Guthrie
: In General I Would Recommend Continuing to Logically Partition Your Application Code (Which Was One of the Things Windows
DNA
suggested). For example, putting all of your data access logic within modular classes that you then call them from pages-like we do from the IBuySpy applications. ... In general, you should not use COM transactions unless you are actually doing Distributed Transactions Across Multiple Data Store Machines. If you are Just Updating a Single Database, The Transaction Capabilities With IT.
Q: What if you are planning on using remoting to communicate between our first and middle tiers, and you've only gotten C # working Are there any known issues today with using remoting to communicate from ASP to Visual Basic (VB)??
Scott
Guthrie
:.. There should not be any problems doing remoting from VB (like C #), although you should be a little careful about how to use remoting In many cases it is best not to do the extra network hop There is a big performance penalty to going to the other machine, so you should not look to do it for either performance or scalability reasons. It does make sense if you are connecting to a different application or data center, where for org / technical or political reasons you need code to run elsewhere.Q:? What if you want to use it to communicate from Web servers that are hosted at an outsourcer across a firewall back to the network where the databases are For security reasons, we will not put the database out in the DMZ.
Scott
Guthrie
: One other possible solution you might also investigate for that would be to leverage ISA (Internet Security and Acceleration) server, where you would put ISA in front of the firewall, and then ASP.NET and the database behind it We actually just finished. doing some benchmarking numbers with that solution and saw really great results. It is also really easy to set up and administer, and might be easier to ultimately deploy and manage going forward. One nice thing about ISA is that it does not require any ASP .NET CONDE CHANGES To Leverage It, SO IT IS Pretty Easy To try out and evanate.
Q: Could You Comment On Interoperability (VIA Session Objects, Query Strings, etc.) BetWeen ASP and ASP.NET? ANY GOTCHAS?
Mark
Anders
: There Are A Few. First, We've Made The Object Models As Close As Possible. However, IF for Example You Store Com Objects (Not New Clr Objects) In Sessions, And You Want Those To Be Out of Proc, They Won 'T Work. You NEED TO HAVE NEW Objects That Can Be Serialized. ONE Thing to Note Is That ASP and ASP.NET WILL Run SIDE BY SIDE ON A BOX, BECAUSE AT An Application Level ASSONS. Q: I'VE Seen a Lot of Concern That Data Can Be Passed Page to Page (ASP to and from ASP.NET).
Mark
Anders
:.. Since we really use standard Web techniques, passing info page to page should not be a problem However, page to page in ASP and ASP.NET typically assumes services that are provided by each, such as session and application state These services are NOT Shared, And So You Can't Rely on Them.
Scott
Guthrie
.
1. Use only a single language within the ASP application. Do not intermix VBScript and JScript together in the same page (in general a bad programming practice with ASP, but also a migration issue for ASP.NET in that we now require only one Inline <%%> Language.