Mono: A Developer's Handbook
When learning a new language such as C#, or working with a new development environment such as Mono, it usually takes some time before you get up to speed in developing programs. Wading through the reference documentation and reading other people's source code often provides much-needed information on how to do certain things. Both, however, are very time consuming and tedious.
Enter Mono: A Developer's Notebook. This book provides a series of task-driven chapters which are thin on theory, but rich on practical content and example code. The featured code snippets are, in contrast to ones in books that teach theory and concepts, not solely designed to illustrate a specific theoretical aspect of programming. Each one is designed to perform a useful task that is essential in day-to-day application programming. What sets this book apart from the multitude of .NET books already available on the market? In order to answer this question it is neccesary to provide a short introduction on Mono.
Mono is essentially an open source cross-platform implementation of Microsoft's .NET development framework and implements the API's which are standardized by ECMA. It is, however, not an exact clone. Besides providing a (partially implemented) stack that provides compatibility with Microsoft's .NET API's, Mono adds a whole new API-stack of its own, consisting of open source technologies such as the Gtk+ toolkit and the Gecko HTML rendering engine. This makes it possible to develop cross-platform applications based on open source technology while (mostly) compiling from a single code-base. In contrast to most .NET books available on the market, which focus primarily on Microsoft's API's in the context of Visual Studio.NET, this book concentrates on the basic ECMA API's and Mono's own open source stack. A complete coverage of .NET and the Mono architecture is outside of this review's scope, so for more information you are advised to check the Mono Project's website.
Before we dive deeper into the content of the book, a short introduction on the Developer's Notebook series by O'Reilly may be useful. The books in this series are styled to resemble the kind of notebooks college students carry around during their classes in which to take notes or, more commonly, draw caricatures of their teachers. The 'notebook' theme persists throughout the look-and-feel of the book. The 278-page thick paperback has a glossy blue cover, complete with faux post-it note and coffee-stains. Inside, the pages are not clean white but lined like the pages found in math notebooks. In the margin, useful comments are scribbled in a font that resembles handwriting. At first I suspected that the 'busy' look would distract from the content, but in practice this was no problem, thanks to the thick black typewriter font in which the bulk of the text is printed.
The chapters in this book are referred to as labs. Each of them focuses on a specific set of tasks and/or features and is divided into several paragraphs. Most paragraphs consist of a number of standard sections following a rigid formula that help you understand a certain aspect of working with Mono. The most common sections are:
- How do I do that?: Often using a liberal amount of practical code, this section shows how to accomplish the task at hand, for example working with files.
- How it works: In this section, the code and concepts involved in the previous section are explained more in depth, step by step.
- What about...: Offers a short focus on more advanced topics or pitfalls.
- Where to learn more: If you are craving more information after reading the previous sections, you are often offered a helping hand on where to find more information, providing url's to relevant documentation such as MSDN and other websites.
The first chapter, Getting Mono Running, describes how to get Mono up and running on Linux, Windows or Mac OS X, and how to compile from source on other platforms. The installation instructions for Windows only describe how to install Mono and Gtk#. Integration of Gtk# only in an existing Visual Studio.Net installation falls outside of the scope of the book, but a recent blog entry offers some hints on how to accomplish this. Besides installation, the first chapter offers a short description of the individual tools that make up the mono development. After installation, you will want some kind of editor or IDE to work with. Both the MonoDevelop IDE and several other ways of integrating Mono into your existing environment as a Java or Windows developer are covered. Finally, the community is an important aspect of every open source project. Ways of interacting with the community as well as a guide on how to submit bugs and links to some working Mono/C# applications are part of this chapter.
The C# introduction in the second chapter, Getting Started with C#, is tailored towards people who have at least some proficiency in using an object-oriented language such as C++ or Java. Some differences between C#, Java and C++ are discussed, as well as the differences between value- and reference types, the basics of error handling, working with assemblies and more. Concepts such as classes, methods, inheritance and namespaces are assumed to be known territory. If you have no previous programming experience, Mono: A Developer's Notebook is only useful in combination with a book that teaches programming with C# such as The C# Programming Language by Anders Hejlsberg.
An important part of any modern language is its class libraries. The third chapter, Core .NET, provides an introduction to the standard Framework Library Classes, which describes essential everyday tasks that are part of every program, such as working with files, strings, searching for text patterns and handling collections of data. Besides those basic functions, the chapter also dives deeper into the internals of a compiled assembly, the handling of processes and easy multitasking using threads. Finally, the last paragraph explains how to use a .NET version of the JUnit Java Unit testing framework, Nunit, to test your code.
Developing Gtk-applications with Mono and C# is remarkably easy. Chapter 4, Gtk#, describes the basics of writing Gtk# applications. First, it's neccesary to remark that Gtk# might be a bit of a misnomer. Besides the raw Gtk+ toolkit functionality, Gtk# also includes most of the Gnome libraries like gconf, the gnome canvas, libglade and more. Chapter 4 describes functionality available in the Gtk namespace, the basic Gtk+ toolkit. Gtk+ is a constraints-based toolkit, which means that widgets are not positioned using absolute pixel coordinates but rather on basis of their logical relation to each other. This can be a bit confusing for novices, but this chapter provides a good introduction to the basic principles of writing layouts using Gtk#. The authors provide descriptions of essential operations that almost every application needs, such as creating menus and drawing pixmaps (or more advanced things like using the treeview widget and drag-and-drop), assisted by easy-to-read code snippets.
While chapter 4 introduces basic Gtk# functionality, chapter 5, Advanced Gtk#, delves deeper into more advanced features of the Gtk# library which also include functionality outside of the basic Gtk-namespace, such as the Gnome libraries. Working with Gnome button toolbars, the Glade user interface designer, storing your application settings in Gconf, setting up some preferences through the use of a wizard/druid, asynchronous operations and threading to increase responsiveness of your application while performing background tasks, rendering HTML in your application using the Gecko rendering engine and internationalisation and translation of applications are all described in this chapter.
The use of XML is tightly integrated throughout the Mono framework. It is, for example, the underlying format of the messages that web services use to communicate using the SOAP and XML-RPC protocols. The 6th chapter, Processing XML, describes the XML functionality available in Mono. It starts off by simple operations, reading and writing to an XML-file using relevant examples such as RSS and Dashboard clue-packets. It then proceeds to describe how to modify XML in memory, how to navigate and transform XML using Xpath and XSLT, how to constrain XML in several ways and how to serialize and deserialize objects into and from their XML representation. As in previous chapters, the information density is very high so it might take several reads to grok everything explained. The code examples and accompanying text however are very clear and concise.
The 7th chapter called Networking, Remoting, and Web Services describes the networking functionality available in Mono. The chapter starts off with ASP.NET. Mono's stand-alone XSP webserver and Apache integration with mod_mono are discussed, as well as the basics of writing a web application using ASP.NET's code-behind functionality which enables web applications to completely seperate presentation from the underlying code. Communication using plain tcp/ip, remoting using binary serialized objects and invoking remote procedures using XML-RPC as an alternative to SOAP are also described in this chapter. You might want to encrypt the data you send over the network, so a basic description of the Mono cryptographic API is provided. Finally, a short introduction to database handling using ADO.NET concludes chapter 7.
The 8th and last chapter titled Cutting Edge Mono starts off with an introduction on how to use the GNU Automake, Autoconf and the pkg-config tools to create an easy to build source package of your project. It then proceeds to describe various pitfalls and considerations in case you want to write cross-platform applications using Mono, such as filesystem layout, configuration storage and the calling of native code using p/invoke. A particularly cool project is IKVM, which translates Java bytecode into the Common Intermediate Language bytecode Mono uses. This enables Mono to run Java applications and allows Java and Mono code to inter-operate. A short introduction on the use of IKVM is provided, as well as some code examples on how to call Mono assemblies from Java and use the Java class libraries from within Mono applications. The chapter ends with some other cutting-edge functionality, like how to run a development version of Mono, a preview of the Generics (templates in c++) implementation available as featured in C# 2.0 and how to write Mono programs in Basic.
What is missing? The book doesn't contain a reference section on any of the described API's. If you need detailed information on the C# language specification or an API reference you will need to consult external resources such as the documentation provided with Mono, MSDN, or a separate book covering the topic to make optimal use of the information contained in this book. Fortunately, the book kindly provides pointers on where to find those. The information-density is much higher than you would expect from a book this size. This means the information contained in it is terse. Many topics are treated in a only a couple of pages and the book doesn't take time to explain a lot of programming concepts. The information gets you 'on the road' quickly however, which is exactly what this book is supposed to do.
The strength of this book is that it fills the gap between the earlier-mentioned reference documentation and the need to go out and try to read sourcecode to find out how a particular thing is done. The writing style is clear, concise and neutral. Some topics are clarified by the use of screenshots, which is especially useful in the chapters dealing with Gtk# widgets. All in all, if you are a developer with previous experience in object-oriented programming, Mono: A Developer's Notebook will provide you with an excellent introduction into many of the aspects of working with Mono, its associated libraries and programs.
More information and a sample chapter can be found at the book's homepage.
You can purchase Mono: A Developer's Handbook from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
It was only a matter of time before O'Reilly used them all up.
1. Why not use Java? 2. Does it run on Linux? 3. Imagine a beowulf cluster of these! 4. Keep up the good work Miguel! 5. Miguel you are a tool! 6. Why not use Java!
Tech, life, family, faith: Give me a visit
For me, Obj-C combined with Cocoa (*Step), is that same sweet spot. And sometimes Python, when a really high-level language is required. Naturally still together with Cocoa through PyObjC.
Am I the only one who immediately thinks of debilitating diseases whenever this project is mentioned?
bug.gd: error search engine. Humanity working together to solve all errors.
I had Mono in 7th grade, it sucked.
Mono: An Incubator's Handbook
Not quite. A better comparison,
.NET is Microsoft's implementation of this standard.
Mono is Novell's implementation of this standard.
On the other hand,
Same standard, 2 different implementations of the standard.
Tech, life, family, faith: Give me a visit
Even if VB.NET really is nothing more than VC++ in VB sheep's clothing.
"It's the height of ridiculousness to say for those 9 lines you get hundreds of millions."
One thing I still haven't been able to figure it is how Mono compares to developing .NET applications on Windows with the Microsoft toolset. Does Mono capture the simplicity of the .NET Framework in building Windows (GUI-based) applications?
Sweet spot? I call it uninteresting void. It seems to me that most programming is either:
1) operating system kernel or core library, embedded or high-performance programming. This niche only finished moving from assembly to C a few years ago. C++ is usually too slow & big & unwieldy for this niche, let alone C# or Java, although we may be ready for it in 5 years or so.
2) application programming. Here development speed is more important than execution speed. Python and kin provide 'good enough' execution speed when coupled with proper libries (QT, etc) with the fastest development speed.
What kind of code falls between the 2? Sure there is some, but is it interesting?
Bryan
one time i thought i had mono for an entire year; but it turned out i was just really bored.
An important part of any modern language is its class libraries. C# beats C++ only in the size of it's standard library. (Managed C++ doesn't count). If only the ANSI/ISO dudes would include a standard GUI library (even a very simple one) and stop spending so much time on generics and algorithms...
I once thought I was developing Mono for an entire year. Turns out I was just really bored.
Lets look at somne important facts first so we can have an eduated and informed discussion.
.NET, ASP.NET and ADO.NET compatibility layers might run into trouble in the long run because those libraries are patent encumbered.
Mono with the
Mono with GTK#, Gnome, Mozilla and other libraries doesn't have that problem because the only thing that it uses from Microsoft is the ECMA standard C# language implementation.
Why Mono and not Java? Mono is 100% open source.
Why Mono and not Python? Mono uses a virtual machine environment that is faster than an interpreted language. Some people prefer the Java and C++ similarities that C# offers. Mono is cuasi language independent. You can use Python in Mono (See Iron Python).
"Miguel de Icaza is wasting his time..." Miguel works on Mono because he likes it, he is not employed by you (except if you are Novell) so he spends his time as he sees fit. He owes you nothing.
Cheers,
Adolfo
It takes MUCH longer to code a program in Java than C# (business type programs with lots of screens, error checking and database access). Each language has it's place and C# approaches VB for RAD where Java is more like programming in C++ for speed of application development.
I want to use Object Oriented COBOL.
If you have questions about Mono, read the project launch statement or visit the list of Frequently Asked Questions.
There's an RSS feed for the newest news, updates, etc. on Mono, too.
Most slashdotters need instructions on the normal way to develop Mono.
I'm sure the book is nicely written and all, but I'm still mystified by why anyone would care about C# or Mono. It all reminds me of when Intel announced the Itanium and scared half of the competing CPU manufacturers to kill off their own products. As a business strategy, it hardly matters that the Itanium has failed completely in the marketplace, since the competition largely committed suicide years ago, so Intel wins by default. Imaging how cool the Alpha, MIPS, etc., might have been by now if they'd continued active development...
So, back to Mono -- why on earth should anyone care that there's something that's almost Java, only without anywhere near as much industry support, and many years less maturity? Sure, MS is scary and all, but so was Intel... now, if C# were substantially better than Java, it would at least be technically interesting, but so far the best argument I've heard for using C# instead of Java is that MS is promoting it. I can see why that would be important in an MS-only shop, but why on earth would anyone interested in cross-platform or open software care about, much less promote, Mono? Is it some twisted attempt to take control of C# from MS?
Enable 3D printed prosthetics!
I developed mono back in the 7th grade.
C/C++ = Weakly statically typed
Java/C# = Strongly statically typed
Python/Ruby = Strongly dynamically typed
"Loose" typing is another way of saying "weak" typing. Meaning the system doesn't enforce type safety. In almost all scripting languages, type safety is strongly enforced.
A deep unwavering belief is a sure sign you're missing something...
I thought I had MONO once. Turned out I was just bored...
You can run ASP.NET on Linux using Mono, but you cant run it on Windows. You would think there would be a big push to get in working under Apache on Windows since this woulod be the perfect bridge to moving your site to Linux.
"God fights on the side with the best artillery." - Napoleon, Marshal of France - speaking truth to power
Can you use C# without .NET or some replacement for it? Is it possible to use it with POSIX alone? Or perhaps with OpenGL?
recently I tried Mono and although I'm not convinced it is a viable long term option, since Microsoft will eventually go after Mono with lawyers, patents and copyright, they have made a lot of progress. Play with microsoft is like playing with matches while standing in a puddle of jet fuel. the smallest mistake will cause a huge explosion.
I've been writing in Java for 6 years professionally, and been playing with it since I picked up the beta with one of the original programming books in '96ish time frame. Lately I've been playing with C#, and while I don't particularly care for Microsofts business practices, they put out some pretty good development tools. C# is a damn fine language that seems to have learned from the mistakes others have made while taking away the good stuff. Java has way too many things that bug me. Little things here or there. C# pretty much got rid of them. Off the top of my head, overloading operators is a big one for me. I tend to write a lot of mathematical manipulations, and being able to overload the operators to naturally manipulate custom data structures is a huge benefit from my standpoint. I mean if you want to write a method to do it in Java and then have to make explicit method calls feel free... You're stupid, but feel free. I'd rather just work with it naturally. The Java GUI library is crap, and with rare exceptions (sweet sweet firefox) doesn't produce attractive apps. C++ is still my favorite development language, but I don't want to write tons of boilerplate code, deal with messy structure, or have to deal with custom memory managers everytime I write an app. For those who are putting down Mono as some kind of stupid side project, stop stroking your self. I'm a little tired of sysadmins out there who know a little scripting coming off like they are developers. It's a pretty ambitious undertaking for anyone to work on in their spare time. And just because a Microsoft team developed C# doesn't mean it's going to just be a Microsoft development language. The C# spec has been accepted by ISO and anyone can write a C# compiler at this point.
Why use C#? Because you like the language. If you have a choice, why would you spend your time working with a language you don't like?
-- Slashdot: When Public Access TV Says "No"
"but i always felt the lack of a sweet spot between the hard and fast low-level programming languages and the loosely typed scripting languages"
Every try pascal or Object Pascal (Delphi)?
Which class libraries? :-)
ECMA-335, which the grand-parent referenced, standardizes some of the class libraries. In particular, this file contains All.xml, which contains documentation for all namespaces, types, and type members (fields, methods, properties, etc.) for all standardized types.
What's actually covered? Enough to get the ball rolling -- I/O, XML, Reflection, Collections, Platform Invoke, etc. Basically, the .NET equivalent of the standard C library, and then some. (Well, much more than the standard C library, which lacks XML, Reflection, Collections.... But you get the drift.)
What isn't covered? Much more -- System.Windows.Forms, ASP.NET, ADO.NET, System.DirectoryServices, System.EnterpriseServices, etc. Much of this makes sense, as it doesn't already exist in a standardized form. Furthermore, much of it is specific to Microsoft Windows -- System.Windows.Forms is highly windows-specific, and will be "dropped" by Microsoft in favor of Avalon eventually, anyway. Other items have open-source equivalents -- LDAP can work for System.DirectoryServices.
To put it in perspective, ~295 classes are standardized, out of the ~7000 in .NET. (Number completely made up, but Mono has over 7000 .cs files in CVS, and Mono hasn't fully covered .NET either. Of course, many of those classes aren't public, and thus couldn't be used by external developers, but the number should be in the neighborhood...)
Whether this is "bad" or not is outside the scope of this response. :-)
You sound like a grumpy engineer who decides what foods to eat based on their nutrient content and keeps asking everyone "Is That Really Necessary?"
It isn't important if C++ or any other language really did solve the same problems. Why should people use C++ if they don't like and and no one is paying them to use it?
Are you also deadset against every other language, too?
Considering the fact that almost everything in Linux and the opn source arena is a knock-off of something else, accusations of "copying" ring loud and false.
-- Slashdot: When Public Access TV Says "No"
SharpDevelop looks cool: cool gui, integrated NUnit, cool TaskList.. Importing VSNET2003 solutions worked OK, except few problems with embedded resources... I have high hopes for SharpDevelop. VSNET is still better but has shitty upgrade cycle - so we'll see what the future brings. :-)
Of course, I'm also the sort of person that thinks that imagining what Bill Gates' daughters will teach him about technology is fun
That has got to be one of the most irritating navel-gazing pieces I've seen on Slashdot, ever.
___
The ends are ape-chosen, only the means are man's. -- Aldous Huxley
Lately, my interest in the Mono project has been growing. The C# language appears to offer just that sweet spot between power and productivity I've been looking for
Yeah, of course now that there's an open source implementation, C# is a good language...
Beware: In C++, your friends can see your privates!
But Java has better support on a bigger variety of systems. And it does not rely on the good will of Microsoft to allow it to run on Linux.
And when using JRockit JVM on INtel harware - it is fast. Faster then equivalent C# code in my applications (prototyped certain numerical algorithms)
And it has a better development environment: Eclipse, IntelliJ etc.
Why C#. Why make it sound that this is some revelation of a language? There is nothing new there.
<^>_<(ô ô)>_<^>
So let me get this straight: If I wanted to use Mono, I'd have to: relearn how to do everything I already know how to do in C++... rewrite all of my personal libraries... learn a completely new set of bugs in a new API....
Dude. If you have portable a)threading b)database connectivity c)GUI d)App servers working in you precious little C++ personal libraries setup you are either bullshitting us or smoking dope or do not know what you are talking about.
I have spent many years developing enterprise applications in C++. Even after they (finally. after many years of hell) got more or less portable standard implementations right, stabilized ABI etc etc. it still does not have what it takes to design middle tier stuff. That's where the money are.
you are free to wallow in your desktop/standalone apps (games?) /single platform world, but at least admit there are TONS of benefits of using Java (or .Net) platform for enterprise development (remember - that's where the money are).
<^>_<(ô ô)>_<^>
Reminds me of what I had read once on the creator of C++'s homepage: "Java isn't platform independent; it is a platform.". It certainly is from a developer's point of view. I'll probably get serious about Java some day, but that's exactly what's been stopping me -- I'm already extremely knowledgable and proficient on one platform, so switching is just taking a step backwards as far as productivity. My boss (a non-techy) envisions Java projects likely coming our way in the future, and I've told him I'll become proficient in it like I am in C++, but point out that it won't buy us anything, such as additional capabilities. I'll just be learning how to do all that I can already do right now, just in a slightly different language with a completely different set of libraries. Same goes for .Net.
Attention zealots and haters: 00100 00100
Mono with GTK#, Gnome, Mozilla and other libraries doesn't have that problem because the only thing that it uses from Microsoft is the ECMA standard C# language implementation.
And the beaut think about that is the *potentially encumbered* libraries are in a different part of the build tree, ready to be pulled if a MS (FUD) patent does get served.
peterrenshaw ~ Another Scrappy Startup
Did you just say what I thought you said? Doesn't that make about as much sense as "he's been dishonest all his life, so you can hardly call him a crook."
Attention zealots and haters: 00100 00100
What about when pointer semantics is less clear?
:)
How does Ruby know whether or not it has to free() the string returned from Curl.curl_version?
These things may look nice at first, but trying to automagically use low-level languages as if they were high is doomed to a painful failure
You may be aware of this, but your post is misleading in that it makes the reader think the programmer is freed from dealing with the pesky details of using a low-level language.
There are just tons and tons of libraries in Java that don't exist or are not cheap in C++.
...cast... collection ...arrays of keys...pooling...hey how come my objects aren't getting garbage collected?) sure makes you miss simple destructors. If only C++ had the libraries AND DOCS that I needed. Oh, and because C++ is so much harder to do right for us (speaking only for the royal myself) I need someone else to write the framework that I could have written myself in Java.
Stay away from Java frameworks though. They're all bad. Not uniformly bad, but very few offer more functionality than roll your own + use the OS, stupid.
Java is easier for us dumb programmers though. Except I've been thinking of switching back to C++, just because it takes so long to type anthing in java (try a loop...iterator...enumerator
C# is a little bit better than Java. At least it's less typing. And supposedly IKVM or J# will let me use all the Java libraries.
Maybe I should just go back to PHP.
but point out that it won't buy us anything, such as additional capabilities.
What do you do? What threading/GUI/networking/DB/utilities (such as regex) libraries do you use?
What development environment / automated testing /build environment?
In each of this areas Java will bring rather larger productivity gains. It is not just code. It is things like automated testing frameworks, ANT, 3rd party libraries working much more reliably.
I am not a big fan of Java, but our team migrated to it and advanatages are numerous and fairly obvious. It is quite possible, though, you do not care about any of it.
<^>_<(ô ô)>_<^>
A Developer's Back of the Envelope, perhaps?
I'm reminded of a series of booklets Radio Shack used to sell, back before it sucked, called "Engineer's Mini-Notebook". Written in a draftsman's block-print hand, they contained schematics and explanations of fun electronics projects to try -- all of the parts, of course, available from Radio Shack. I still have two or three of these.
These days you can't buy anything much more wireheadish than gold-plated audiowank cable.
N4st0r, trixx0r h0bb1tz0rz! Th3y st0l3 0ur pr3c10uzz!
What's funny is that Slashdotters criticize Microsoft constantly for not innovating and for ripping others off. Meanwhile, we're discussing C# and a .NET clone
>C# is a Java clone, while .NET is a JFC clone. Of course, Java and the JFC was inpsired by Objective C, NeXTstep and Smalltalk, but at least they weren't a blatant attempt to make an incompatible version of something just for monpololy preservation.
If you have portable a)threading b)database connectivity c)GUI d)App servers working in you precious little C++ personal libraries setup you are either bullshitting us or smoking dope or do not know what you are talking about.
Well ...
Most of these are admittedly C based, or available for C, but then real programmers don't bother with falsh in the pan stuff like .NET. Remember, .NET and C# is only relevant until MicorSoft find it's time to get you to upgrade (and deprecating your existing language or platform like VB or Fox is as good an incentive as they come).
ISO/IEC 23270:2003 Information technology -- C# Language Specification
--
Try Nuggets , the mobile search engine. We answer your questions via SMS, across the UK.
"i always felt the lack of a sweet spot between the hard and fast low-level programming languages and the loosely typed scripting languages."
You might want to check out the Dylan programming language which can be efficiently compiled to code that performs at C-like speeds. When programming in Dylan, you don't have to add any type specifiers unless you want to. If you do choose to add type specifiers, the compiler will use them for both optimization and verification purposes. In practice, you often only add type specifiers for the parameters of methods. The compiler is smart enough to type-inference the rest of the types within the method, so there's often no performance gain to be had by specifying a lot of typing info.
Which I would consider a totally idiotic statement since C# basically is a clone of java with a few language features added and a class library, not yet as extensive as Java. So tell me, where do you think the speed improvement comes from, which language feature, which library feature gives you the speed advantage?
Uh, no. The post lambasted Mono as an unnecessary ego-driven piece of work that solves problems that were solved by earlier tools.
If one applies that logic to Linux, it ought not to exist.
-- Slashdot: When Public Access TV Says "No"
Allow me to laugh in you face. Ha ha ha.
Now it felt better.
CORBA, you say? Pthreads? Real programmers?
Cool. Whatever you say, real programmer.
P.S. I did code in C++ while people were still using FORTRAN. Still do. DO not miss when I do not.
<^>_<(ô ô)>_<^>
I have to say it. C# does rock and I'm so happy about Mono doing so well.
.NET framework that are clearly hacked together just to make it work. Others were clearly designed by developers with very little understanding of object oriented development principles.
There are mistakes in how the C# language has been designed that really bug me at times, but I've been developping in C# for about 2 years now and I've never been so productive in my life.
It has a lot of the advantages of Java, but with a better UI (and by better, I mean better looking AND better performance. The Java ones seem to be one or the other: Fast and Ugly or Slow and Pretty, and maybe even some slow and ugly ones).
I really hope Mono can keep up with the Longhorn development because I really expect the library design to be better. There are a lot of aspects of the
But complaints aside, overall it's excellent and as I said, I've never been so productive! As an independent contractor, that means a lot to me.
I use Delphi for most of my stuff, but the weak point has to be thin support for collections. There is a list object (works like Java in that you store stuff as object references and have to cast the reference you get back), but it requires linking in the VCL -- what if you are doing a console app or your own Windows classes?
Why should people use C++ if they don't like and and no one is paying them to use it?
Well, I must ask, if you don't like C++, why would you use Java or C#? Yes, every language can be used to solve the same problems as every other language, but what innovative improvements over C++ did Java or C# make that should convince someone who does like C++ to use them? (Honestly, I'm asking because I'm debating whether or not to try out C#/Mono.)
A good informal definition of strong typing (note I did not say "static") is that all type errors are caught. A language with a strong static type system catches all type errors at compilation time; a language with a strong dynamic type system catches them at runtime.
In C and C++, many type errors are caught at compilation time, but many programs with type errors are accepted by correct implementations, and no mechanism catches them at runtime. Thus, they are weak static languages.
Java is strongly typed, and has both static and dynamic typing. The compiler catches many type errors, and the runtime system catches every other type error.
Are you adequate?
The deal is that the Java static type system is not powerful enough to figure out when an identifier that's declared as type A is bound to an object of a subclass of A. This is where casts enter into the picture; in this case, dynamic typing ensures that casting does not break strong typing.
Are you adequate?
We do scientific 3D modeling with OpenGL in C++ on Windows (we have some other stuff that runs on Solaris, that I'm not involved with).
* Threading - As a company we've standardized on pthreads. In the past I've used Win32 API calls for threading.
* GUI - MFC and the Win32 API. It looks like the company is currently considering switching to Qt.
* Networking - Winsock. After calling the non-standard WSAStartup(), you can eschew the other WSA* calls and program it BSD socket style.
* DB - MS provides the nice high-level but robust ADO.
* Utilities - Haven't had a need yet to do regexp'ing in C++. But, for example, for XML, Apache's Xerces C++ implementation of the SAX2 parser seems extremely fast and I've had no reliability issues with it. MS provides one as well.
You see, as with Java, typically the platform provides the facilities you need (if the entity, incidently often commercial, behind the platform wants developers to write for it!).
What development environment / automated testing /build environment?
Visual C++ 6.0 is very nice. The first place I worked at had makefiles to run nightly builds with VC++'s command line tools (which, incidently is what the IDE drives). And as with everywhere I've worked so far, developer unit testing is rather informal. QA has automated testing tools.
In each of this areas Java will bring rather larger productivity gains. It is not just code. It is things like automated testing frameworks, ANT, 3rd party libraries working much more reliably.
Here's where you may be showing your age/inexperience. Do you think we all used to just sit around doing nothing, waiting for Sun to invent Java, so that we could finally be productive and accomplish something? VB'ers have been cranking out business apps hyper-productively for years.
Attention zealots and haters: 00100 00100
Thanks for the info. Since I tend to use STL vectors over arrays (and thus get bounds checking), I use boost.org's smart pointers for most of my heap-based memory management (which isn't much, comparatively), and if I'm integrating w/ C++ code not written to use exceptions, you lose C#'s gain in that area anyway, it appears that C# offers me very little over C++ with decent libraries. Thanks again.
You are confusing typing strength with type-safety.
For example, you can have a crash-proof implementation of BF. Does that make BF type-safe? Yes; the type system is so pathetic that it's trivial to enforce type safety. Does it make BF strongly typed? No, because the type system doesn't do a good job of accurately describing the values you compute on. Tcl is also type-safe, but, again, the type system is weak (strings and lists are all you get).
Perl is often cited as a weakly typed language because strings and numbers are easily interchangeable. But this doesn't make Perl type-unsafe. Type-safety is enforced; it's just that there is a type called "scalar" that can handle both strings and numbers by design. Perl is weakly typed because many other languages make the distinction between strings and numbers and therefore more accurately describe values.
Type-safety means you cannot escape the type system. Strong typing means that your types are very precise descriptions of your values (relative to other languages).
Some examples:
Language | Safe | Typing StrengthTcl . .
C . . .
Old Java | Yes. | Medium. No parametric polymorphism.
New Java | Yes. | Strongish.
C++ . .
Haskell
Epigram
BTW, Python shouldn't really be considered strongly typed. The typing is weaker than Java's. Method invocations and field accesses are performed through string lookup.
The strongly typed version ensures that you're invoking the method you think you're invoking instead of invoking a method that simply has the same name. Python will not notice an error if GetElevatorButton() returns a BellyButton instead because method invocations are done by matching strings. Of course, the stronger typing doesn't really work well in a dynamically typed language. (Then again, dynamic typing is just a fad that will fade when people realize that what they really wanted was type inference).
How about talking about the book specifically, rather than mono in general for a bit. I've been playing with mono a bit, and have a book called "Mono kick-start" that I don't find to be much use. Is this book better? How?
I've written enough code for my toy project that now I want to put a gui on it, rather than just "self-testing by Console.Write". Problem is, I now want to do some custom drawing and I don't know GTK at all. Will this book help me?
Where, if anywhere, can I find a good API/class library reference for using GTK in mono on win32?
My Karma: ran over your Dogma
StrawberryFrog
How often you needed to redistirbute all libraries due to incomaptible ABI changes in your C++ compiler?How often you needed to redistirbute all libraries due to incomaptible ABI changes in your C++ compiler?
Never. Mainly because the guts of most systems I've worked on have been written in C rather than C++. The only time that changes in the C++ libraries have bitten me (API rather than ABI) is when I upgraded gcc on Tru64 from 2.95.2 to 3.something. A few 'using namespace std;' liberally sprinkled in my source fixed things. Not as painful as switching from Java 1.0.2 to Java 1.1 ...
Style, syntax, design, structure, etc., are at least as important as innovatory features in determining if a developer feels comfortable with a language. If someone can express his ideas more readily in one language than another, he's likely to choose it, all things being equal.
In truth, all languages solve the same set of problems, just in different ways. (I'm deliberately not including developer candy like bounds checking. These things can be implemented in any language.)
-- Slashdot: When Public Access TV Says "No"
I hate JNI .. .NET's design is a little better - But I stick to good old GPL'd Portable.net for my .NET needs :)
Quidquid latine dictum sit, altum videtur
The major contribution of Linux was that it brought the stability and functionality of UNIX to the PC desktop for those who couldn't afford the expensive UNIX workstations. In PC-Land, it was a tremendous improvement over DOS and Windows, even if it was a copy of UNIX.
But neither .NET nor Java nor Mono offer anything substantially better than C++. Why bother bringing .NET to Linux (Mono), when gcc already does a better job? It would be akin to me cloning Linux and expecting everyone to use my "special" version of Linux just because I released it under a different license.
The society for a thought-free internet welcomes you.
Acutally no, there is no speed improvement in this regard, The JavaVM currently still is a tad faster, it does better runtime optimizations as the CLR. Where .Net can really shine is things where it can hook directly into the underlying windows dlls.
Which is rather easy because, .Net is a code once, run on some Windows versions thing.
Wheras java has to abstract in many areas.
.Net added autoboxing (already in java, 1.5 is stable since today), foreach also in java since 1.5 and the in my opinion really good meta data stuff.
As for the namespaces I dont see to many advantage. Well you also have the attributes, which basically is a problem if you dont know if they are attributes because you cannot see it directly. That might be your argument, but face it buddy, ever modern ide, generates the setters and getters automatically in java, you dont code them anymore.
As for the other stuff.
The coding speed is improved mainly by the autoboxing foreach and the attributes, but those are handled already.
Operator Overloading, well a matter of taste, I am not a big fan, coming from the C++ side I know about the problems this stuff can cause, if not used wisely and thoughtful.
Whether or not .NET or java or Mono offers anything better than C++ is akin to asking if C++ offers anything better than C, or if C offers anything better than assembly. Or, if a peach pie offers anything better than an apple pie.
People choose apple over peach because they prefer apple. Some people choose peach. Some people choose C++ because they like it. Some people can't stand C++ and will never use it. Some people will choose Mono because they like it. Some people won't.
Linux is an improvement over DOS and DOS-based Windows, and less of an improvement over Windows 2000 and XP. But many people acknowledge that Linux is technically superior to Windows and still continue to use Windows because they like using Windows more than using Linux The same logic applies to languages. If two languages can get the job done, why not use the one you enjoy? Why use the language that fights you every step of they way?
And, if you want to clone Linux and release it, no one is stopping you. There's no reason why you should not do what you want. No one is keeping score, you know.
-- Slashdot: When Public Access TV Says "No"
I wouldn't consider the Wikipedia to be a definitive source, especially for such an often-confused term. For all I know, you could have written that entry. Things I "learned" from that entry:
Look at entry on typed and untyped languages. It says that Perl is weakly typed. But you can't escape the Perl type system and cause a crash which means (by the other entry's definition) that it is strongly typed. So, apparently, some Wikipedia contributor doesn't agree that the two terms are equivalent.
Well, if it's only a matter of preferences, then there's really no point in discussing it.
But C++ did offer considerably more than C, and C more than assembly. C wasn't object oriented, and assembly wasn't easily readable.
So I would have expected the whole Java-.NET-Mono thing to offer something considerably better than C++, but they didn't. In fact, the did just the opposite - they took features away whilst making the language slower.
It isn't a matter of preferences, but performance. .NET, and Mono are offering 1970's era performance and development times on 21st century hardware. Consider the categories in which they don't excel:
- Development time - Visual Basic and TCL are faster.
- Security - Java is more secure.
- Runtime speed - pretty hard to beat C/C++, and can't touch assembly.
- Portability -
.NET doesn't run on UNIX; Mono could be killed by Microsoft with patent encumberances.
- Functionality - C++ already has a plethora of useful libraries that we don't need to learn again.
- Utility - C/C++ can be used to write anything from OS kernels and drivers to middleware apps.
Mono andMozilla gives me tabbed browsing - something MS has yet to discover.
Linux gives me a stable OS - at the time of its release, Windows couldn't run for more than 90 days without crashing.
GCC is probably the best compiler I've seen to date - it would take Microsoft years before VC++ could generate faster code.
And then there's Mono: for those who hate Microsoft so much that they run Linux, yet love MS software so much that they must clone .NET.
The society for a thought-free internet welcomes you.