Linked by Eugenia Loli-Queru on Sun 15th Oct 2006 04:56 UTC
.NET (dotGNU too) Matthew David introduces the new .NET 3.0 Framework, comparing it to previous releases and pointing out the fancy new features we can look forward to using.
Order by: Score:
Only?
by rayiner on Sun 15th Oct 2006 05:26 UTC
rayiner
Member since:
2005-07-06

Microsoft has released code that demonstrates CardSpace integrated into a PHP application. (It only took 200 lines of code.)

I find this statement pretty entertaining. You can write the core of a lot of useful apps in 200 lines of code. Think compressors, physical simulations, etc. The fact that it's got the word "only" prepended to it basically summarizes everything that's wrong with Windows programming.

RE: Only?
by n4cer on Sun 15th Oct 2006 06:32 UTC in reply to "Only?"
n4cer Member since:
2005-07-06

It's web programming, not Windows programming.

This is most likely the sample code to which the article refers:

http://www.identityblog.com/?page_id=430

Stu
by mallard on Sun 15th Oct 2006 10:53 UTC
mallard
Member since:
2006-01-06

Last I heard, .NET 3.0 was just .NET 2.0 + WinFX... Has anything changed? If not, the only "fancy new features" would be WinFX.
Has MS decided to introduce some new language features, or even some new classes outside of WinFX?

RE: Stu
by NotParker on Sun 15th Oct 2006 18:28 UTC in reply to "Stu"
NotParker Member since:
2006-06-01

Last I heard, .NET 3.0 was just .NET 2.0 + WinFX... Has anything changed?

.NET 3.0 adds 4 new system to .NET 2.0

Windows Presentation Foundation (WPF)
Windows Communication Foundation (WCF)
Windows Workflow Foundation (WWF)
Windows CardSpace (WCS)


Workflows is going to be tremendously useful to anyone programming enterprise applications.

The whole paragraph made me laugh
by RandomGuy on Sun 15th Oct 2006 10:59 UTC
RandomGuy
Member since:
2006-07-30

The problem with these solutions is that they’re inherently very loose and insecure. How often have you heard people sharing usernames and passwords? When this occurs, you do not know who the person authenticating really is.

So the problem is people sharing their identities, right?

The new Windows CardSpace is a step toward changing this situation. Unlike previous attempts at managing security, Microsoft took a bold step with CardSpace and did something almost unprecedented—asking security experts outside Microsoft what security should really look like.(emphasis added)

Now THAT made me laugh my a** off!
Must be the way he put it...

The response was simple: Any user can create and share his or her unique identity. Windows CardSpace is Microsofts version of this new solution.

WTF?!?
Maybe it's just because English is not my native language but this is how i got it:
problem: people share identities - that's unsafe!
solution: people may share identities - that's cool!

Does anybody know what he _really_ wanted to tell us?
I just don't get it.

And, of course, the phrase "only 200 lines of code" made my day.
I mean, we're talking about web sites, right?
Not some monstrous do-it-all enterprise app.
Just a web page whose only purpose is to get the identity of a given user.

fixed some errors in html display

Edited 2006-10-15 11:01

Marcellus Member since:
2005-08-26


And, of course, the phrase "only 200 lines of code" made my day.
I mean, we're talking about web sites, right?
Not some monstrous do-it-all enterprise app.
Just a web page whose only purpose is to get the identity of a given user.


Why not take a look at those 200 lines of code to see what it actually does, and then point out why it's bloated?

RandomGuy Member since:
2006-07-30

Because the code was not there, did you even bother to read the article?
I'm not gonna search every single page on MS-servers just to point out exactly why it's bloated.
Judging from the article, 200 loc referred to the part
of the code that was used to somehow interface with
Windows CardSpace.
This smells like boilerplate code for something that should be small and simple.

If you really want to improve security make it simple.
Otherwise people won't use it.
Just look at PHP's GET and POST method and guess which is more popular...

In addition, I did not say it was bloated - I only said it was not all that small by website standards.

rayiner Member since:
2005-07-06

We know what those 200 lines of code do: it's code added to a PHP app to integrate with this new security mechanism. It should not take 200 lines of code to do something like that, period.

As RandomGuy rightly pointed out, it's quite likely mostly boiler-plate. Why? Because that's what nearly every Microsoft API is like. That's why it takes dozens of lines just to create a winow in Win32, and why just setting up a DirectDraw window takes pages of code. That's why you see multi-volume thousand page tomes about individual Windows APIs, and why things that are very simple in other APIs (say mmapping a file), is a multi-step, multi-function procedure in Win32.

Marcellus Member since:
2005-08-26

http://osnews.com/permalink.php?news_id=16173&comment_id=171804

Let's assume the example linked to in this post is the one referred to, or at least equal to the example referred to.

In the php-listings I see a LOT of error handling code.
And various comments.

If we cut out error handling and the comments, we can probably cut the code by at least 50%, if not more.
It can probably be reduced even more if we reduce the example to a special case and assume other things as well.


I haven't coded enough Win32 to comment on that, but for .NET you don't need a lot of code "just to create a window". Especially not if you reduce the window to use default settings for everything, and don't bind any event-handlers to it.
Does other API's magically know what you want to do with them? I'd really want to know, because I have tons of ideas that I could use such an API for.

Get a Life Member since:
2006-01-01

No. Indeed, creating a window with an empty event loop in Win32 does not take that much code. It takes more code than if you wrote some simple abstractions that make assumptions about what you want done--the so-called sensible defaults--but that is true of any low-level API. Creating a GL context with GLX and then doing some event handling with Xlib for matrix transformations is not exactly concise.

In practice doing either is rarely your problem, but then Rayiner really likes to complain about Microsoft's terrible, awful APIs. Oh for shame, MapViewOfFile, for shame.

The Win32 API isn't really that great, and well MFC was just a down-right bad direction for a class library, but Microsoft has a lot of APIs and quite a lot of them aren't that bad at all. No, they aren't all "one function is all I need for my whole program," but that's because they're intended to be flexible; use a simplified interface abstraction and move on with your life. There's a lot of them, after all.

v No Checked Exceptions???
by MikeekiM on Sun 15th Oct 2006 13:11 UTC
RE: No Checked Exceptions???
by PlatformAgnostic on Sun 15th Oct 2006 14:54 UTC in reply to "No Checked Exceptions???"
PlatformAgnostic Member since:
2006-01-02

Checked exceptions are not all that great. In fact exceptions in general are far from perfect in highly-reliable code because they represent a jump through several frames of the callback and perhaps through some layers of abstraction. For a quick and dirty program, checked exceptions are a pain and for a serious app, they don't buy your much beyond what you get from having a team discipline around error handling. I'm an error-codes kind of guy myself and so is a lot of MSFT based on what Larry Osterman writes.

.Net 3.0 will run on multiple OS's: Funny.
by MikeekiM on Sun 15th Oct 2006 13:13 UTC
MikeekiM
Member since:
2005-11-16

.NET 3.0 is similar to the previous frameworks, in that it will run on multiple operating systems. At launch, .NET 3.0 will run on Windows XP, Windows 2003/R2, and Windows Vista. I haven’t heard any discussion about releasing .NET 3.0 for Windows 2000 or any other Windows operating system.

TBPrince Member since:
2005-07-06

Because I'm almost sure they won't be supported.

.NET 3.0 is built on foundation of Windows 2003 SP1 / Windows XP SP2 and thus only those operating systems will be supported. Including Vista, of course.

Changes made to W2003 SP1 and WXP SP2 are too radical to be backported. Anyway, this is a enhancement for initial project which was meant to make WinFX only available to Vista.

Of course, this is also done to shrink the range of Windows systems. Right now, there are quite too many W98 or WindowsNT/2000 systems. However, it would be really difficult to backport such wide changes to such old systems.

NotParker Member since:
2006-06-01

Right now, there are quite too many W98 or WindowsNT/2000 systems.

Onestat puts that number at less than 9%:

"The 10 most popular operating systems in the world on the web are:

1. Windows XP 86.80%
2. Windows 2000 6.09%
3. Windows 98 2.68%
4. Macintosh 2.32%
5. Windows ME 1.09%
6. Linux 0.36%
7. Windows NT 0.24%
8. Macintosh Power PC 0.15%"

Net Applications suggests around 10%.

http://marketshare.hitslink.com/report.aspx?qprid=2

TBPrince Member since:
2005-07-06

Hmmm... I'd have said those systems had a bigger market share. We always hear about how difficult was WindowsXP prenetration.

If those numbers are real, then it's clear why those systems are not supported.

dylansmrjones Member since:
2005-10-02

You do realize that those numbers are from a extremely limited scope of websites, rendering the numbers absolutely worthless?

NotParker Member since:
2006-06-01

You do realize that those numbers are from a extremely limited scope of websites, rendering the numbers absolutely worthless?

OneStat has 50,000 customers each with 1 or more websites.

NetApplications has 40,000 websites (different than the ones OneStat monitors).

I think the numbers are really useful.

Face facts ... 95% or more of home computers had XP installed on them for the last 5 years. Corporations may have installed Windows 2000 on their PC's for a few years after XP RTM'd, but surely over the last 3 years most would be XP.

The Beauty of CheckedExceptions...
by MikeekiM on Sun 15th Oct 2006 17:25 UTC
MikeekiM
Member since:
2005-11-16

For any new concept in Computer Science there's always a crowd who will fight for the status quo, and not admit there's a problem to be solved.

Checked Exceptions and jumping thru frames: When you leave the "TRUE" path, you're going to Leave the True path, whatever that entails, whatever method you choose.

Checked exceptoins give you:
- Hard Warnings you need to handle Probable Error conditions, before the code goes into production.
- The ability to Recover from an Expected Error Condition in Production.

True for small who-cares projects, checked Exceptions, UML, and Agile programming are over kill. But, it's strange( or is it ), that Microsoft can't see the benefit for Large software projects where Millions of Dollars are running thru your system on a daily basis, that you absolutely need these techniques to deliver the Quality Required for Enterprise apps.

Lazyness is no good excuse to drop a feature.

But, it's the C guys fighting this, and they've fought in the past:
- auto garbage collection
- string libraries
- Unicode - multilanguage support
- Decimal math libraries for accurate financial results.
So, why am I not surprised that Microsoft is fighting CheckedExceptions.

Microsoft needs to grow up not just target Dentist Office software.

Checked Exceptions
by NotParker on Sun 15th Oct 2006 18:32 UTC
NotParker
Member since:
2006-06-01

http://www.artima.com/intv/handcuffs.html

"Bill Venners: You mentioned scalability and versioning concerns with respect to checked exceptions. Could you clarify what you mean by those two issues?

Anders Hejlsberg: Let's start with versioning, because the issues are pretty easy to see there. Let's say I create a method foo that declares it throws exceptions A, B, and C. In version two of foo, I want to add a bunch of features, and now foo might throw exception D. It is a breaking change for me to add D to the throws clause of that method, because existing caller of that method will almost certainly not handle that exception.

Adding a new exception to a throws clause in a new version breaks client code. It's like adding a method to an interface. After you publish an interface, it is for all practical purposes immutable, because any implementation of it might have the methods that you want to add in the next version. So you've got to create a new interface instead. Similarly with exceptions, you would either have to create a whole new method called foo2 that throws more exceptions, or you would have to catch exception D in the new foo, and transform the D into an A, B, or C.

.... "

Very interesting read.

Versioning: What a Red Herring...
by MikeekiM on Sun 15th Oct 2006 19:12 UTC
MikeekiM
Member since:
2005-11-16

This is funny coming from Microsoft:
VB4, VB5, VB6, Com, DCom, C++, Java, J#, C#. .Net1.1 vs .Net2.0
- Feature move and rename in every os.
- ADO namespace changes with every release.
Microsoft is worried about software compatibility?
It breaks compatibility as part of it's BUSINESS MODEL!
The guys that stayed Cobol on the Mainframe are laughing all the way to the bank.

In Java, a jar file is a drop in replacement,
same with .Net dll's.
Especially for web/server based apps.

Secondly, if a signature break worries you, you write a new method with a different name, but, only if you want to keep the previous method alive.

PHP code
by deadmeat on Mon 16th Oct 2006 02:29 UTC
deadmeat
Member since:
2006-08-04

I looked at the PHP code linked in a comment and I agree its overly complex.

Their solution is technical overkill. It's a support nightmare. It's easy to tell someone that their username or password is wrong. How are you going to explain that their shared, signed, encrypted token file(?) is shared, signed or encrypted in the wrong way, or just mangled, expired, invalid, or belongs to someone else.

As usual MS has opted for something so complicated that people will mostly stick to simpler less secure methods like passwords.

RE: PHP code
by Bit_Rapist on Mon 16th Oct 2006 04:04 UTC in reply to "PHP code"
Bit_Rapist Member since:
2005-11-13

How are you going to explain that their shared, signed, encrypted token file(?) is shared, signed or encrypted in the wrong way, or just mangled, expired, invalid, or belongs to someone else.

Something like Outlook pulls when its encryption gets hosed.

"Your name was not found by the underlying security system"

or

"The messaging subsystem returned an error"

nice and clear for the end user. ;)

One line
by snowflake on Mon 16th Oct 2006 03:35 UTC
snowflake
Member since:
2005-07-20

>That's why it takes dozens of lines just to create a >winow in Win32,

Last time I tried (about 30 secs ago) it took me one line to create a window and another line to show it. I think its pretty much the same on most modern GUI frameworks?

RE: One line
by rayiner on Mon 16th Oct 2006 04:22 UTC in reply to "One line"
rayiner Member since:
2005-07-06

And how many lines to set up the message loop, create the window class, etc?

Just compare a few of the steps between Win32 and GTK+:

- Application setup: 1 call in GTK+ (gtk_init), 0 calls in Win32 (because WinMain wraps the relevant setup for you).

- Creating the window class: 0 calls in GTK+, filling out of about a dozen struct fields + 1 call in Win32.

- Creating the window: 1 call in both, but the GTK+ version has one parameter, while the Win32 version has 11.

- Showing the window: One call in GTK+, with one parameter, and two calls in Win32, with three parameters total.

- Initializing the message loop: one call in GTK+, with no parameters, a loop with three calls and half a dozen total parameters in Win32.

Or, consider something like handling an expose event. In GTK+, to handle an expose event, you have no setup. You connect the signal handler, GTK+ passes it everything you need, and you just draw. In Win32, you've got to get a PAINTSTRUCT and an HDC from BeginPaint, and finish drawing with EndPaint.

Yes, a lot of this is boiler-plate, but that's what we're talking about here. There is rarely a simple, quick way to do a given task with Microsoft APIs. To do one thing, you first have to deal with setup procedures that expose you to the full generality of the system. That's just bad API design.

Edited 2006-10-16 04:25

RE[2]: One line
by Bending Unit on Mon 16th Oct 2006 05:07 UTC in reply to "RE: One line"
Bending Unit Member since:
2005-07-06

Yeah, because comparing a low level API to a high level one is really relevant.

Try Win32 vs Xlib or .NET vs GTK.

RE[3]: One line
by Get a Life on Mon 16th Oct 2006 15:11 UTC in reply to "RE[2]: One line"
Get a Life Member since:
2006-01-01

This is where you compare creating a button control on a window in Win32 to doing the same using Xlib. Hohoho, I crack me up.

RE[3]: One line
by rayiner on Mon 16th Oct 2006 17:16 UTC in reply to "RE[2]: One line"
rayiner Member since:
2005-07-06

The Win32 widget API is at the same level of abstraction as GTK+: both are low-level procedural interfaces to conventional widget toolkits. Xlib is at the same level as GDI: both are low-level procedural interfaces to window-management and drawing functionality; neither deals with widgets. .NET is at the same level as GTK#, both are object-oriented wrappers over their respective procedural APIs.

RE[4]: One line
by Get a Life on Mon 16th Oct 2006 17:33 UTC in reply to "RE[3]: One line"
Get a Life Member since:
2006-01-01

The area of Win32 that you are discussing and GTK+ are not at the same level of abstraction--that's plain silly. Even when considering the use of common controls is a little iffy, because the event model of a basic Win32 program and GTK+ is completely different for example, and even message cracker macros do little to paper over that. You would be better off comparing MFC and GTK+ for terseness.

Xlib and GDI are not really on the same level. Xlib implements event handling, window management, atom management, and lots of other things not in GDI, because GDI basically just deals with device context tasks like drawing, some limited image stuff, and fonts. Parts of Xlib are the same level of GDI, but Xlib is larger. It clearly isn't comparable to the common control aspects of the Win32 API, which are more comparable to Xt.

RE[2]: One line
by Get a Life on Mon 16th Oct 2006 15:06 UTC in reply to "RE: One line"
Get a Life Member since:
2006-01-01

I'll do you one better: with Visual Basic all I have to do is create a project and my program creates an empty window by default. Take that, bad GTK+ design!

RE[3]: One line
by rayiner on Mon 16th Oct 2006 17:20 UTC in reply to "RE[2]: One line"
rayiner Member since:
2005-07-06

Real glib, but that's an incorrect comparison. If you bring code generation into play, as you're doing, any API can be as automatic as Visual Basic.