![]() |
|
Published 2007-11-17 Printer-friendly version
Advertisement
In this Frequently Asked Questions (FAQ) page I'll attempt to answer at least some of the questions that have been raised about Clarion.NET and Clarion#. If you log in you can post your own comments and questions below.
Recent additions are marked in red; recent deletions are marked with a strikethrough.
Terminology!
One of the problems in discussing Clarion.NET is finding a meaningful term for traditional (non-.NET) Clarion applications. Some developers use the term Win32, but that isn't always helpful since .NET applications can also be Win32 (or Win64).
For a while I described Clarion applications as WinAPI apps, but nobody really seemed to like that. In any case the convention now seems to be to describe traditional Clarion apps as simply "Clarion", and Clarion.NET apps as Clarion#, after their respective languages.
Isn't it too easy to confuse Clarion and Clarion#?
Probably. Oh well.
What's the difference between Clarion# and Clarion.NET?
Clarion# is the language; Clarion.NET is the new IDE. But that's potentially confusing too because the new IDE, when complete, will be used for both Clarion and Clarion# programming. Jan van Dalen suggested the new IDE be called "Clarion Studio" - I like that, and I hope it catches on.
Is Clarion.NET available now?
Yes, the first beta was released to subscription program participants on Saturday, Nov 17, 2007, and more betas have followed.
What is .NET, anyway?
From Wikipedia:
The Microsoft .NET Framework is a software component that can be added to or included in the Microsoft Windows operating system. It provides a large body of pre-coded solutions to common program requirements, and manages the execution of programs written specifically for the framework. The .NET Framework is a key Microsoft offering, and is intended to be used by most new applications created for the Windows platform.
I'll just add (for now) that .NET is an object-oriented framework which accommodates a great variety of programming languages.
Isn't .NET all about web development?
You might think so, given the name of the platform. While .NET contains many web/Internet-related classes, it also has extensive support for desktop development. As well, there's a version of the framework for mobile devices.
.NET is a comprehensive development and runtime environment suitable for most kinds of programming, but not usually for low level hardware-oriented stuff (although you can get an 80386 assembler that generates .NET code).
What's the difference between Clarion# applications and the Clarion applications I write now?
There are a number of differences. One of the biggest is that the Clarion language (for Windows) is highly dependent on the Windows API. For instance, when you open a window, that window is created by the Clarion runtime library via calls to the Windows API. When you create a new variable or class instance, memory is allocated via the Windows API. This is procedure-oriented coding, and procedure-oriented applications (and operating systems) tend to be hardwired - they have only set ways of doing things. For instance, the Clarion window formatter only has a specific set of controls available, and you can't add your own custom widgets. You can use add-on components like ActiveX controls, but as anyone who's tried it in Clarion can tell you, it isn't all that easy either.
In a Clarion application you often have to work hard to make different functional units of code work together because the Windows API isn't really geared to the concept of components.
Applications written for .NET, however, use the extensive .NET Framework class library rather than the Windows API. In .NET it's all about objects. You can assemble an application out of different classes and components much more easily because .NET provides a congenial framework for all these things to work together.
Is the .NET Framework that much better than the Windows API?
Yes, in almost every way. That's not toadying to Microsoft - it's just the evolution of programming. The Windows API is disorganized - you need to know what you're looking for or you'll get lost very quickly. The .NET Framework library is organized into namespaces. For instance, security classes are grouped together, as are diagnostic classes, data access classes, etc.
The .NET framework library is much more massive than the API and is growing larger. It provides a whole lot of code that you'd otherwise have to write yourself. There are many other benefits to the library but many of these are better described in the context of the Common Language Runtime (CLR).
Okay, I'll bite. What's the Common Language Runtime?
The CLR is an essential part of .NET. It's the layer that sits between you and the hardware, and which provides important services to your applications including, but not limited to: memory management; thread management; exception handling; garbage collection; security; introspection and reflection. The CLR means many tasks are easier in .NET. For instance, if you NEW something you don't (usually) have to DISPOSE it - the CLR's garbage collector will detect when the object is no longer in use and will clean it up automatically.
Are there any other weird acronyms I should know?
Well, there's CIL, the Common Intermediate Language (often just called IL). The CLR doesn't actually run the code you write; instead, all .NET language compilers translate their code into this CIL (IL) bytecode, and that's what the CLR executes.
So .NET is a giant interpreter? This seems like a step back from true compiled languages - didn't CPD generate pseudocode which had to be interpreted?
You're right - CPD did in fact generate pseudocode, and it's a fair analogy. The advantage of IL is that since all .NET languages compile to an intermediate language, they all share a common platform. You can take some classes compiled in, say, Fortran.NET (no, I'm not kidding) and easily use them in C# or Boo or Clarion#.
What is Clarion#?
Clarion# is the .NET version of the Clarion programming language. The Clarion IDE for .NET is, at least at present, called Clarion.NET. But a lot of developers already use the terms Clarion# and Clarion.NET interchangeably.
Clarion is both a procedural and an object-oriented language, but .NET is an OO framework - can I still write procedure code in Clarion#?
Yes, you can still write procedural code in Clarion#. Your procedures are converted to object-oriented code when they're compiled to IL code, but you don't need to know or care about that if procedural code is what makes you happy. You will, however, find it much more difficult to make the most of the .NET platform and all the available classes unless you are willing to learn at least a little object-oriented programming.
Are Clarion 7 and Clarion# the same product?
No, they are separate products, but they share the same integrated development environment (IDE).
Does that mean if I buy Clarion 7 and Clarion# I'll end up with just one installed IDE able to work with both platforms?
Most likely, although there may be some versioning issues that make that more difficult, at least during the beta process. So for a time you will have two IDEs installed.
What can I do with Clarion.NET/Clarion# beta in the first release?
The beta includes a template wizard you can use to generate a .NET application, but since those templates run in C6, not the new IDE (AppGen isn't ready yet), you can't yet create and maintain a .NET APP file in the same way you do in C6.
As of build 3040, the new IDE ships with a fully functionaly dictionary editor. The AppGen is scheduled to be demo'd at the Aussie DevCon at the end of May, and Bob Z has indicated AppGen will not be held if it's ready for beta release before then; meanwhile you can hand code not just desktop applications, but also ASP.NET and mobile applications.
There are a number of example solutions shipped with the beta. These include demonstrations of connecting to a database with ADO.NET, displaying a BLOB image onscreen, a mobile app, data binding, drag and drop, a FOREACH with QUEUE example, glass buttons, new listbox features, the SCHOOL application, mixing Clarion# and C#, a simple web service, a "Hello world" ASP.NET web application, a .NET remoting example, the PEOPLE app with data grid and browse procedures, and a screen capture utility.
Since Clarion# is a full .NET producer/consumer language you have full access to all of the .NET framework library as well as the rich supply of third party .NET tools.
What will I be able to do with Clarion.NET/Clarion# in the long run?
When complete Clarion.NET/Clarion# will include templates to generate desktop (WinForms) applications, web (ASP.NET) applications, and mobile (Compact Framework) applications.
What is the Compact Framework?
The Compact Framework is .NET for mobile devices, and includes about 30% of the full framework plus classes specific to mobile devices, and takes up about 1/10 of the space, mostly due to file compression.
What is ASP.NET?
ASP.NET is Microsoft's Active Server Pages web application framework for .NET. You create ASP.NET pages using a development approach similar to desktop development: you place controls on a page, and write code for those controls; ASP.NET then renders the pages accordingly and executes the code on the server side when data comes back from the browser.
How hard is it to write .NET applications?
Writing Clarion# applications can be both easier and harder than writing Clarion apps, and the comparison between the two brings to mind the differences between DOS and Windows API development. You could argue that Windows development was a lot harder because you had to do so much more to create even a simple Hello World application (at least in C, if not in Clarion). On the other hand, Windows provided standard capabilities like a windowing library; in DOS you had to write or otherwise obtain a windowing library to achieve a consistent, accessible user interface. In DOS you had to know how to talk to every printer you wanted to use; in Windows you talked to the printer driver, and the printer driver sorted out the back end. Similarly .NET does a lot of the heavy lifting you now have to code in Clarion apps, leaving newer and more complex tasks to your wily programming brain.
One big difference between the Windows API and .NET is that the latter is exclusively object-oriented. To get the most out of Clarion# apps you will definitely want some basic OO programming knowledge. With that knowledge in hand, I think you'll find .NET easier and safer to use than the Windows API. If you've had to deal with ActiveX or (heaven help you) directly call COM functions you'll truly find .NET an easier place to code.
.NET introduces some new language concepts that may take some getting used to, such as delegates, which are a sort of type-safe object-oriented callback mechanism.
Is .NET open source?
.NET is not open source, but Microsoft is in the process of making the source code for some parts of the framework public.
Will my third party tools work in .NET?
The majority of third party tools will need to be ported to Clarion#. Templates that don't generate any source code and do not depend on a particular template chain are likely to work without modification, but there aren't many that fall into that category. You're probably best off assuming you'll need new versions until you hear otherwise from the vendor.
I've often said that .NET is a two-edged sword for third party vendors. If what you provide is readily available as part of the .NET framework, then zing!! off goes your head as you step into .NET land. On the other hand, if you have a great product and you can port it to .NET, you're ready to carve a swath through a programming market that numbers in the millions of coders.
Will my customers want .NET and if so why?
Some customers will want .NET just because it's a buzzword. That's an easy sale.
Other customers may or may not know whether they want .NET. Clearly what they want is software that does what they need it to. If their needs run to eye candy or very unique user interfaces, then .NET presents some distinct advantages. There are a bazillion custom controls out there for .NET, all of which you can use with Clarion#. And there are many class libraries that handle important behind-the-scenes tasks as well.
I find it difficult to overstate the importance of ready access to all of that existing code. With Clarion apps you have to be concerned about prototyping functions, register passing conventions, the arcana of COM, etc. etc. With .NET you just drop in the library and start to use it, no matter what language it's written in.
.NET offers programming benefits as well. For instance, your code compiles to IL code which is run under the watchful eye of the CLR. That means the CLR can detect problems with your code and present far more detailed information to you than you get from, say, a GPF in a Clarion application. This makes debugging easier and faster.
Can I run .NET apps on Linux or the Mac? What is Mono?
Mono is a Novell-sponsored project to port the .NET platform's functionality to multiple platforms, including Linux, Mac OS X, Solaris, BSD, and Windows. Mono necessarily lags behind Microsoft's efforts, and currently has completed support for .NET 1.1 and mostly-complete support for .NET 2.0.
Versions? What are all these .NET versions?
Microsoft released .NET 1.0 in 2002, and 1.1 in 2003. You may see some computers with 1.1 as the latest version, (and some computers without .NET installed at all) but the standard at present is .NET 2.0, released in 2005. Clarion# targets 2.0 apps - there was talk in the early days of 1.1 being supported as well but the only reason I can see for supporting 1.1 is for Mono compatibility, given that Windows Forms 2.0 support is now scheduled for Mono 2.5, which does not have a release target.
For most of us, .NET 2.0 will be the minimum.
What about .NET 3.0? Or 3.5?
The first thing to keep in mind about .NET 3.0 is that it is not a replacement for .NET 2.0. It's a bunch of new stuff added to 2.0, including Windows Presentation Foundation, Windows Workflow Foundation, Windows Communication Foundation, and Windows Card Space. The base class library is unchanged from 2.0.
.NET 3.5 uses the same CLR as 2.0 but it adds some new stuff to the base class library, in particular support for the LINQ query language. 2.0 apps will still run fine on 3.5.
SoftVelocity is "adding support for 3.0/3.5" but no timeline has been indicated.
Will I need to learn C# or VB.NET?
You will not need to learn C# or VB.NET or any other .NET language, but you may want to. In particular there's a lot of C# source code out there, and you may want to adapt some of it to your own uses. If you can read object-oriented Clarion code you won't have much trouble reading C#.
What is ADO.NET?
ADO.NET is Microsoft's data access layer for .NET, and consists of data providers (i.e. drivers) and DataSets. A DataSet is a set of objects that model the database elements (tables, views, columns, rows, relations, etc.).
Will my Clarion (.clw) programs compile in Clarion#?
While much of the Clarion language is unchanged in Clarion#, it's unlikely that any single Clarion application big enough to do useful work will compile as Clarion# code without modification.
What will I have to do to port my apps to .NET?
Porting applications to .NET is a bit of a gray area at the moment. Theoretically it can be done; the question is, is it worth the work? Clarion apps are built on a traditional, client-server model. Is this a good approach to take into the .NET world? Do we really want ABC.NET? Perhaps a multi-tier design would be more appropriate, particularly one where you could easily reuse your business logic in desktop, web, and mobile versions of your application. SV has alluded to this kind of design but it isn't clear yet what kind of desktop application templates will be included with Clarion#.
Can I mix and match .NET objects with Win32 API objects easily?
You can include WinAPI code in a .NET app and vice versa. Easy is a relative term. See Wade Hatler's series of articles.
Can I get my Clarion 7 and earlier programs to use .Net components I create using Clarion# or other .Net languages?
Most likely you could (see the article series above) but I think this would be a stopgap measure at best.
How secure is .NET code? Can it be easily decompiled?
Code security is a legitimate concern in .NET and yes, IL code can be decompiled much more easily than native Windows executable code. .NET obfuscators alter label names and use various code scrambling approaches to make it very difficult for anyone to make sense of the decompiled result. Or you could just hire someone who's a natural at writing unreadable code.
I've heard .NET programs run slower than native code. Will I notice the difference?
.NET uses just-in-time (JIT) compiler technology, meaning that IL code is compiled to native code the first time that IL code is needed by the application. That means there is a small startup penalty but once the code is compiled it runs just like any other native code. Theoretically code produced by a JIT compiler can outperform code issued by a standard compiler because the JIT compiler can tailor the code to the hardware. That said, .NET applications often do seem to run slower and take more memory.
.NET uses just-in-time (JIT) compiler technology, meaning that IL code is compiled to native code the first time that IL code is needed by the application. If you take any two blocks of code that do the same thing in Clarion 6 and Clarion# you'll get approximately the same performance. On the one hand the JIT compiler can tailor its output to your computer's hardware, so you may see some performance improvements; on the other managed code may exact a penalty, usually no more than 10-15%.
Why then do some .NET programs actually seem to run slower and take more memory?
Without two functionally identical versions of the same program available for profiling, one .NET, the other not, it's almost impossible to say. Given that code execution speed is a wash the differences most likely come down to sloppy programming and/or feature bloat. You can write big, slow apps in just about any language.
Can I include a .NET runtime with my apps so I don't have to require my customers to install .NET?
There is a tool called the Salamander .NET Linker, Native Compiler and Mini-Deployment Tool that will do just this. It's a bit expensive, and I don't know how well it works. Apparently Thinstall will also create self-contained .NET installs.
If both new Clarions deliver desktop applications why should I buy both? Would Clarion# not be enough?
I'll assume here you mean after AppGen is released for C7 and Clarion#. While you can create real desktop apps already with Clarion#, most developers will want to use AppGen for larger apps.
So yes, you can create desktop apps with both. Why would you still want C7? Here are a few reasons:
Can a Clarion# class inherit from a C# class?
Definitely. And vice versa. The same goes for all .NET languages.
Does Clarion# support generic types?
Generics are supported, although there are still a few compiler bugs being ironed out as of March 2008.
What are .NET's minimum requirements?
According to Microsoft, the minimum requirements for the .NET 2.0 redistributable are:
As with most Microsoft platform requirements, you're probably not going to be very happy at the low end of the spectrum. I suggest you take the "recommended" values as the minimum values.
Supported x86-based operating systems:
x64-bit based systems
Itanium-based systems
Should I be learning C# or VB.NET, or some other .NET language?
Although Clarion is a full-fledged .NET language, it probably will be to your advantage to learn at least one other .NET language. There's a wealth of .NET programming information out there, and the vast majority of books and articles deal with either C# or VB.NET. So which language should you learn?
VB.NET in general has more Clarion-like syntax; there are certainly differences, but VB.NET is more of a "plain English" programming language. C# on the other hand has C-like syntax which isn't to everyone's liking. It's also easier to make non-obvious mistakes with C#. On the other hand, C# is the .NET reference language, so you can expect it to support all the latest .NET features, and it's generally a better source of programming examples.
If you have C, C++, or Java experience, choose C#. If you've never worked in a language with C-like syntax then you'll probably be better off with VB.NET. Carl Barnes recommends Programming VB .NET: A Guide For Experienced Programmers, which is also available as a free download - look for the Free eBook Download link on that page.
Clarion developers have enjoyed the benefits of code generation since the days of CPD 2.0. And when the Clarion# AppGen and templates are ready, I think it'll be easy to see the productivity advantage in Clarion#. But the Clarion# AppGen isn't ready yet, and there are no shipping Clarion# templates. Until that happens, why should you choose Clarion# over VB.NET or C#?
First, let me deal with the reasons to use VB.NET or C# instead of, or in addition to, the Clarion# beta. Obviously both those languages are available in gold release, and have been for some years, while Clarion# is, well, in beta. So you can expect fewer bugs in VB.NET and C#, and more complete support for many .NET features. And Visual Studio is a more evolved hand-coder's environment, at least at the moment, with extensive add-in support.
There are, however, some important reasons for choosing the Clarion.NET beta over (or at the very least in addition to) VB.NET and/or C#:
QUEUEs - although .NET has extensive support for collections, queues are still a dead-easy way to manage lists in memory, and a terrific feature of the language.SET/NEXT etc.) if you want to.ClaString class provides compatibility with Clarion string handling code.Are there bugs in the beta? Sure, it's a beta. Don't buy in if you're not ready to deal with that fact. But you can already do some pretty cool stuff with the first beta, and the compiler is pretty solid.
David Harms is an independent software developer and the editor and publisher of Clarion Magazine. He is also co-author with Ross Santos of Developing Clarion for Windows Applications, published by SAMS (1995), and has written or co-written several Java books. David is a member of the American Society of Journalists and Authors (ASJA).
|
Posted on Saturday, November 17, 2007 by Wolfgang Orth If both new Clarions deliver desktop applications - why should I buy both? Would Clarion# not be enough? It seems to be the most evolved as it covers Desktop, somehow Web-applictions and mobile devices. So the traditional Clarion 7 with its WinAPI-programming is oldfashioned history from now on, even before it got gold? Or am I wrong on this?
Posted on Sunday, November 18, 2007 by Dave Harms Thanks Wolfgang - see answer above.
Posted on Wednesday, November 21, 2007 by Carl Barnes A concern I don't think I see addressed in the FAQ are the system requirements for the End User computer for a Clarion# application.
Posted on Friday, November 23, 2007 by Dave Harms Thanks Carl - I've updated the FAQ. Posted on Thursday, December 13, 2007 by Robert Wright If one would have to more or less re-write ones apps (and learn clarion#) and it looks like C# and VB.Net are high as recommemded languages. What advantage or disadvantage does clarion.net have over visual studio 2005/8? Does any one have a feature comparisson. Posted on Thursday, December 13, 2007 by Dave Harms Robert - I've added a response to the FAQ.
Posted on Wednesday, December 19, 2007 by Robert Wright How does the tree control in clarion# compare with C6 Clarion, C# and VB.net?
Posted on Wednesday, December 19, 2007 by Dave Harms Robert,
Posted on Friday, March 28, 2008 by Stephen Ryan A clarion specific tree control exists inside the standard clarion list control for dot net.
|
To add a comment to this article you must log in.
Copyright © 1999-2009 by CoveComm Inc. All Rights Reserved. Reproduction in any form without the express written consent of CoveComm Inc., except as described in the subscription agreement, is prohibited.
Clarion Magazine ISSN 1718-9942
One year: $169
(includes all back issues since '99)
Renewals from $119
Two years: $269
Renewals from $219