|
Re: Apple and Carbon.
If Carbon's so great, why did Apple feel the need to invent Cocoa? Carbon fills more or less the same role as Win32 - it provides continuity for software houses who already have a large investment in that API, but it is no longer the preferred API. Win32 and Carbon remain fully supported of course, because of the large amount of legacy software out there. It's just not how you're encouraged to write new software.
Re: "You get improvement of productivity not because of the language you use, ..."
I believe I did comment on that actually. I disagree - productivity is influenced by many factors - API, language and platform all play a role. The .NET API makes most things easier than the Win32 equivalent. C# makes most things easier than the C equivalent. The CLR platform does loads of things for you which in the Win32/C combo you have to do for yourself. And the platform influences the API - you couldn't produce a C version of the .NET API because not all the necessary features are present in C.
"Give me an environment aimed only to C WinAPI programming and my development cycle would speed up enormously."
You already have one of those - Visual C++... If you're saying that you want the benefits of the .NET Framework brought to C, the only way you could do that would be to replace the C runtime with the CLR. Such a language already exists by the way - it's called Managed C++. As with all C++ flavours you're not obliged to use the C++ features. So if you are determined to write C, you still can, and yet you can use the .NET framework.
So if you want to write C applications that use WinFX, that's how you'll do it. You will be obliged to use objects from time to time because that's how the WinFX API presents stuff. But you're not required to define any classes of your own for most API calls.
Re: "Win32 is just a very low level API implemented, " --> You didn't commented this.
Err, yes I did. But I'll comment again if you like. It's very low level. That's its problem. Higher level APIs tend to make things easier. That's why we have them.
Re: "I don't claim that the classical Windows API is perfect, it is not fully consistent for example, some parts of it could be implemented in a simpler and more readable way, but that's not because the language or the architecture is bad, but because of bad practices in Microsoft and something called backward compatibility, which is a very serious issue for Microsoft. My own opinion is that the basic modules kernel, user and gdi are an example of a good (commercial) OS implementation. As you can see the kernel of NT systems is excellent and that's because it's written consistently and with a smallest amount of backward compatibility, that's why Microsoft will build even their new Longhorn system on that kernel" --> You didn't commented this.
You're mistaken about how Longhorn will work - it won't be based on the existing USER32, and GDI32 components. These are destined to be deprecated because it is no longer possible to extend them in the directions Microsoft want to take the OS - they're reaching the end of their useful life. I wrote another article in this series about Avalon's composition system which explains what the problem with these components is and what's coming next.
As for the kernel itself (i.e. the bits that run in kernel mode), what does that have to do with application development. You don't write your applications using the DDK do you? As I already said, C is an appropriate language for writing interrupt handlers and other low-level kernel mode stuff. But this doesn't make it the right choice for building a GUI.
Re: "But why many simple programs written in MFC and in .NET reserve A LOT of system resources and don't free them until the end of the program when Windows walks their heaps and frees it? " --> You didn't commented this. And that's a (strange)fact i observed for a long time.
I did comment on this fact - I told you that it means you almost certainly have bugs in your code. At least I assumed that you were referring to the examples where you said you saw hundreds of megabytes being reserved.
Were you talking about something else? What other resources?
"About the .NET program -> it's certainly a shame to take 14MB of memory doing nothing more than trivial things, it would take a 1 to 2 MB of memory in Win32."
Who cares? Really? Who cares? 5 years ago, lots of people would have cared. But 14MB is negligible these days. A quick look through my Task Manager reveals that at 14MB, this application is amongst the most frugal of the GUI programs I have running right now.
What possibly benefit would it have been to me to spend 5 times as long writing the program to get it into a smaller working set? My machine has 510MB of available physical memory right now, so the 14MB that my little program is taking up really isn't hurting me.
As I have said before, hardware moves on. Back in C's heyday - the 1980s - 14MB was a huge deal - you couldn't even get desktop machines with that much memory. Today, my mobile phone has more memory than that.
What matters is that things run fast enough, and are cost-effective to build. Sweating over 10MB of memory on a PC application is not a cost-effective use of anyone's time these days.
(Are there scenarios where 15MB is a big deal? Sure - it matters in embedded systems. That would be a big deal if it were non-paged memory in a device driver. But for a front end app? No - we're long since past the point where it's worth spending a significant amount of effort on trying to reduce it. And in certain cases, it's necessary to support 10 year old hardware because in some market sectors, there's a lot of old kit around. And in these cases, yes, you do have to spend more effort on being frugal. In those cases, the .NET framework is not appropriate. But the simple fact that PC hardware decays means that this becomes a smaller and smaller niche every year. Longhorn is specifically targetting what will be mainstream in 2006/2007 - by that time, circa 1995 machines will be in a tiny minority.)
"The question - why .NET programs still run too slow on my 2.4 Ghz machine and reserve too many system resources like gdi resources for just a simple operation?"
This seems bizarre. First of all, .NET programs don't even use GDI. They use GDI+, which is an entirely unrelated component - GDI+ brushes pens etc. are completely unrelated to GDI32 brushes, pens etc. So I really have no idea why your .NET applications are taking GDI resources.
Secondly, my .NET apps work just fine on my 1.6GHz system, so I really can't explain why they're not working on your 2.4GHz system...
(Although Outlook, which is *not* written in .NET is pretty slow, and it is currently using 67MB of memory. I suspect that's another example of: it's what your program does, not what language you wrote it in that will dictate its memory usage.)
"My current Longhorn version performs just really bad on my powerfull machine"
Of course it does - it's pre-alpha code. None of this stuff has been through any kind of performance testing. Everything in it is slow. You'd have seen the same story from any version of Windows if you looked at such an early release. (It's just that Microsoft have never previously released anything to the public this early in the development cycle.)
At the PDC where this stuff was first released, they said time and time again that the performance was terrible because they hadn't done any work on the performance yet.
(Despite this, parts of it are pretty snappy - some bits work better than others. For example, some of the Avalon features let you achieve smoother, faster, and yet richer visual effects than are possible on GDI32 on current verrsions of Windows.)
"I think some people feel comfortable with one thing and other people - with another, that's a kind of own choice, philosophy, name it whatever you want."
True. And Win32 isn't going anywhere soon. But Microsoft can't make all APIs the primary API. They have to pick one. And people who try .NET tend to prefer it to C, so it would make little sense for them to keep Win32 as the primary API.
"I don't accept the notion of "last-ness" also, that is flying on the air with every new product or platform."
Neither do I. I don't think we'll see the last version of anything until Moore's law ceases to apply. The capabilities of the hardware continue to improve exponentially, so there was no way that Win32 could possibly have been the definitive API, and it therefore seems extremely unlikely that .NET will be either. But Microsoft do want it to be the primary API for the next 10 years or so.
Incidentally, on the "in the future all Windows funccionality will be provided via COM" thing, this is true for those determined to avoid .NET. The only way you'll be able to access new platform features without writing .NET code is to use interop. And guess how .NET objects are exposed in the Win32 world? COM objects! So for those who choose not to embrace .NET, that statement turns out to be true after all - COM is the only way you'll be able to use new platform functionality.
|
"you couldn't produce a C version of the .NET API because not all the necessary features are present in C." - I think all necessary features are present in C to produce any kind of code, it's just about good and bad API design. You can produce a very high level API in plain C and it would be as easy to wright as with current OO language API's, not to say easier. It's also about concept of the API. The concept of the Windows API is that it should provide a high level system funccionality and not a very high level user funccionality. As an effect you can wrap it in any language, any platform and provide a very high level user funccionality and that's why we have VB, Delphi and current .NET. that make it really easy to write a user app. I think the WinAPI gives more freedom to write any software because it is not targeted to a specific kind of applications, if i want to write plain C code i write it, if i want to write VB,Pascal,Java,C#, etc. i write it and there are no restrictions. With Longhorn if i want to write plain C code with a simple C compiler i can't, i should stick with an irritating hybrid known as "Managed C++" and COM which is a good concept but highly complex to write even a simplest thing.
"You already have one of those - Visual C++..." - I said that Visual C++ is not a convenient C WinAPI development environment, it's aimed to C++ and MFC, it doesn't provide to C API programmers many facilities that could be provided.
"You're mistaken about how Longhorn will work - it won't be based on the existing USER32, and GDI32 components." - Did i mentioned that Longhorn would use USER and GDI somewhere??? I said that USER and GDI are examples of a good (commercial) OS implementation and actually they are really easy to use because there is a firm and simple logic behind them. I said that the Longhorn kernel will be based on the current NT kernel which is considered by most people as excellent, even UNIX gurus agree on that.
"Who cares? Really? Who cares? " - Ok, who cares of one application reserving huge amounts of memory, but what about all applications reserving huge amounts? And after all it is not that simple, but that's another story.
"Although Outlook, which is *not* written in .NET is pretty slow, and it is currently using 67MB of memory" - I speak about very simple programs written in .NET, they could not be compared in any way with Outlook, they just show the performance overhead of .NET. And since for so many years my OS-es performed relatively slow because of the hardware and now my Windows 2000 just performes like a rocket i don't plan to degrade performance again with a new heavy OS. Will my productivity be boosted? By the possibility of rotate windows around??? Or play a video on the window surface??? Or all the effects that would only tire my eyes??? Or i would be writing a document and making a spreadsheet in a 3D space???? I even disagree with the concepts of the new UI design, it's irritating. In the heart of the UI is the concept that it should be consistent, so that all programs provide a well known, consistent user interface to the user and not forcing the user to be faced with different UI for every program he is working with. And Microsoft claimed on that for years. It is the very first thing you see in any book about UI design. That's why it is sometimes hard to change the look of the existing Windows UI, it is not about resource limitation but a good user experience. If i want to see something beautiful i would go outside home and there are plenty of beautiful things you can see outside. The UI of Windows (and Mac, and OS2,etc.) is a great success because 1.It is consistent. 2. It can express very well "states", 3. It is not irritating to the eyes, 4. It helps you to do your job without paying too much attention on it, so you can focus on your work, it is really an "interface".
Since Windows XP arrived, i've seen more and more people who previously said "i'm bored by the standard grey Windows UI" discarding the new UI and back to the "standard grey UI" and saying "you just can't stick for a long time with such a gaudiness, it just tires my eyes!", not to say that flat UI can't express "states" very well ! After all there was a progress from flat UI on Windows 1.0 to 3D UI on Windows 3.0 and full support of it on Windows 95.
"But Microsoft do want it to be the primary API for the next 10 years or so." - Are you sure that the .NET you see today would be the primary API for the next 10 years? I'm not sure. Another "paradigms" will raise and .NET will be another "legacy API", it's all about business, not about technology or preferences.
And guess how .NET objects are exposed in the Win32 world? COM objects! - It is really bad that all new funccionality will be provided to C programmers through COM. Like i said early COM is a good concept but extremely complex implementation. It's what i'm talking about - the new Longhorn API would restrict freedom of programming, not utilize existing programmer's knowledge well making existing programmer's life harder forcing them to relearn the same things, they already are skilled on, in a "new" way.