Turing's Man Blog
- Last Updated on Wednesday, 03 April 2013 21:38
- Published on Wednesday, 03 April 2013 21:27
- Written by Pawel Wawrzyniak
- Hits: 17070
I'm a huge fan of Pascal programming language. I appreciate its clear syntax and grammar rules. Not to mention it was the first advanced programming language I have learned. Of course, there are many other programming languages, some of them considered modern, other fashionable, but like with any other trends in all industries, the trends are set and gone. Yes, I believe there are trendsetters in IT, too, the same way like in clothing industry. For me, Pascal including its object-oriented dialect of Object Pascal, will always have a special place in my heart and mind. No matter what is stylish or not today, when it comes to programming, who said that and why – Pascal is just above the trendsetters level. Probably this is a kind of first love, which lasts forever. Consequently, being fascinated with Pascal programming language, I was glad to review the latest Packt Publishing book: "Getting Started with Lazarus IDE" by Roderick Person. Here it comes, but let's start from the very beginning.
I'm grateful to Niklaus Wirth, the Father of Pascal programming language and his followers, both commercial (like Borland with their great Turbo/Borland compliers for MS DOS and Delphi RAD tools for MS Windows) and volunteers, like Florian P. Klaempfl, who – thankfully – created cross-platform Free Pascal Compiler (FPC) and allowed the open source community to develop Lazarus – a cross-platform Delphi replacement based on FPC. Honestly, I believe Lazarus/FPC is an open source achievement which can be easily placed between other spectacular successes, like GNU/Linux, *BSD, Open/LibreOffice, MySQL, GIMP or GNU Compiler Collection... To name only a few, which come to my mind at first. I'm sure the best moments are still in front of Lazarus/FPC projects, as with the official release of Lazarus 1.0 version on 18th August of 2012 a new era began for Pascal developers and now we can expect much wider adoption of Lazarus/FPC for development of both amateur and enterprise applications.
Niklaus Wirth giving a lecture
Definitely, the biggest advantage of Lazarus/FPC is its cross-platform capabilities, with the "write once, compile anywhere" philosophy. This simplifies development process of cross-platform applications, reduces overall costs and presents a solid advantage everywhere we need the efficiency of native code execution on contrary to all kind of intermediate code execution on – today trendy – virtual machines. Also, a huge reward of Lazarus/FPC is that we can migrate our code from proprietary Delphi, if we want to go with open source development tools. For me these are main reasons to learn Lazarus/FPC or – at least – get familiar with the tool. Probably, the best idea is to support ourselves with a good book on such occasion. So, is "Getting Started with Lazarus IDE" by Roderick Person, a recent proposal from Packt Publishing, worth our attention?
First impression – visual experience
The book is very well-designed, aesthetic and readable – from the cover, up to the last page. Consists all of the parts a good book – considered to be a usable piece of thing – should have, including dedication (I appreciate the authors who dedicate their work to someone important for them) and legal annotations. Everything, which to some extent is a fixed part of well-designed book, is compact and not over-spoken. For me, a good editorial work is very important and sometimes underestimated, however it results in more pleasurable and effective reading. This is a solid plus for Packt Publishing – they did their editorial job very well. Of course, the most essential value for a potential reader is the way how given subject is presented, hence the author's work is even more crucial for overall success of the book. Let's see how it was achieved by Roderick Person.
"Getting Started with Lazarus IDE" by Roderick Person - cover and a title page. Looks good - and reads even better!
Second impression – a book composition, content overview and reading flow
The target readers for "Getting Started with Lazarus IDE" are very precisely defined by the author. This book is aimed to present Lazarus IDE to two main groups of people: these who previously worked with Delphi and these who have at least basic experience with other programming languages and consider their involvement with Lazarus/FPC for development purposes. In case of former or current Delphi developers, the first target group, this book will be brief but very complete introduction to the most important subjects. For the second group of target readers, "Getting Started with Lazarus IDE" can be a quick and effective overview. This assumption is visible from the first to the last page and influenced not only the composition and scope of presented content, but also decided on the way how the book is written. It is short, but complete – not too much introductory information, only the most important things.
I can frankly say this book is like a well composed Pascal program with all required blocks of code – from definition to implementation. Clear, purpose-oriented and pleasurable to read. Nothing strange, as Roderick Person is a professional programmer, being involved for the last 14 years into development of one of the top-ranked health systems in the USA. Hence, the book is very well organized and thought-out. I assume the subject was deeply analyzed, target readers were defined, then a solution was designed and finally implemented – I mean, the book was written.
There are the following chapters:
- Chapter 1, Installing and Configuring the Lazarus Development Environment, explains the installation and configuration of the Lazarus environment on various platforms, such as Windows, Linux, and FreeBSD – what I like the most is the fact that author also covers Mac OS X, FreeBSD (with the usage of ports collection) and compilation form sources (which can be useful on any other operating system, like – for example – mentioned in the book: Haiku, a long-awaited successor of once well-promising, multimedia oriented operating system – BeOS).
- Chapter 2, Getting to Know the Lazarus IDE – a Quick Tour, is an overview of the basics of the Lazarus IDE, such as the code editor, object inspector, and the LCL palette – this is a very important part, because Lazarus IDE is very similar to Delphi, yet different and such reconnaissance is definitely required for all readers – those familiar with Delphi and those who want to start with Lazarus IDE having experience from other RAD tools. All important parts of the IDE are described here, including additional information on possible configuration options (i.e. selecting target platform for compilation, optimization flags or available Pascal dialects compatibility settings for compiler's parser). Also, LCL (Lazarus Components Library) is shortly presented here – this is the heart of Lazarus IDE and cross-platform equivalent of Delphi's VCL (Visual Components Library), so Chapter 2 is unquestionably the best place for such overview.
- Chapter 3, Creating a Hello World Program, provides an overview of the basics of creating a GUI and console application with Lazarus using the traditional Hello World program and expanding on it – this chapter is nicely written, too. In a very compact manner we can learn about basic console and GUI-based (LCL) applications development. Of course, this book is not aimed to describe all Free Pascal nuances or object-oriented programming paradigm, thus the description is very minimal, just to give the readers general ideas and some elementary fluency in programming. Consequently, second example, GUI-based Hello World is extended in this Chapter to have some more internal logic – to complicate the things a little bit. This is required to show basic debugging capabilities of Lazarus IDE – whoever whenever was programming a little big more complex applications in Delphi or Lazarus IDE knows, that debugging process is an internal part of development. Finally, in the end of Chapter 3 we learn about packaging options for Lazarus applications – of course, this can be the subject for several other specialized books, so the author only presented options for MS Windows and GNU/Linux platforms. However, the direction for further explorations is precisely given.
- Chapter 4, Converting Delphi, covers converting an existing Delphi project to a Lazarus project using the Delphi conversion wizard, as well as manually converting the project – in fact this is chapter in which a little bit more advanced, but necessary subjects are introduced. Once we're familiar with the IDE and language basics, we can see the similarities between Lazarus and Delphi. At this stage a natural question has to rise in reader's mind: "am I able to convert my code from proprietary Delphi to free Lazarus/Free Pascal"? Of course, it is possible – however with some limitations which we have to consider and address. Chapter 4 covers all these issues in a very distinct way. Once again, conversion subject could be the foundation of dedicated, specialized book, I agree, but the author has found a great balance between too general and too detailed information. I can hardly imagine a good book of this kind, dedicated to Lazarus IDE, but without a chapter on Delphi projects conversion process. Therefore, once we are introduced to the differences between Lazarus/Free Pascal Compiler (cross-platform, including LCL and FCL) and Delphi (MS Windows specific – including VCL), possible issues with the GUI and fonts (native or GUI toolkit based) and some additional minor or major things, like differences in events and messages implementation, we can learn on conversion process and its possible refinements. Two conversion processes are presented here – automatic, which is done with the usage of dedicated Convert Delphi Project Wizard and aimed for more complex applications, as well as manual, which sometimes is enough to quickly port a smaller program. For me – great stuff. Definitely can be used not only as a "getting started" material, but also as a kind of reference guide on conversion for most developers.
- Chapter 5, Creating a Lazarus Component, covers the creation of a custom component that can be added to the component palette to be used in a GUI application – Lazarus is mainly based on LCL (a cross-platform equivalent of Delphi's VCL). Hence, the majority of developers would probably like to know at least basics of components development for Lazarus IDE. The same way like in case of VCL components in Delphi – I suppose, most of us not only want to use components available from the palette, but on many occasions have to write their own, customized and purpose-oriented components which then can be reused or shared with other developers.
- Chapter 6, The Lazarus Documentation Editor, presents LazDE, the tool for documenting a Lazarus source code unit – there is a very common stereotype that developers don't like to document their code. Well, probably to some extent it's true, as such work can be considered boring. However, according to my experience, the situation looks quite different where there is a good tool in place. Or at least, the developer knows how to easily prepare basic documentation. I'm glad there is a chapter dedicated to documentation process in this book. Of course, one can write a book dedicated to code documentation exclusively, but once again, a big plus for the book and its author for keeping the balance. We can learn all the important information on this process here, furthermore, we can gain solid foundations for future development in this subject. Thanks to Chapter 6 the book makes a positive impression of being complete.
- Chapter 7, Rebuilding Lazarus with a GTK2 Interface, covers rebuilding the Lazarus interface, using one of many supported widget sets of Lazarus – this chapter is very short and may be seen as less interesting in comparison to other chapters. Although, it was definitely a good idea to at least show an option to change default widget set and rebuild Lazarus IDE. This is also a solid advantage of Lazarus IDE, so it was a necessary subject in "Getting Started with Lazarus IDE".
During my reading I realized that the author is incredibly skilled not only in Lazarus/FPC, but also in focused, solid writing and he perfectly manages the flow of information through the book. We always have enough introduction and facts presented on given subject to fluently move forward or start our own explorations, if required. As I was approaching a quite complex – and at the same time practical – subjects, my curiosity what will be presented on next page (and how?) was heated thanks to this unique author's ability. I've found all the examples presented in the book being clear, useful and very illustrative. At the same time, these were not overcomplicated – this is very important, because we should remember we're on the "getting started" level here.
So, lots of pluses come from my second impression of this book. Maybe with only one, small minus – after being introduced to all the information presented in chapters 1 to 6 in a very compact but complete fashion, I expected some more information in Chapter 7. Yet, I guess it was the author's deliberated decision to leave the subject presented in this chapter just touched and not to overload the reader with the information on widgets. As I said – this small minus is very doubtful and I'm not so sure about it. I would rather underline the fact that the book is very well composed and I've found all the chapters to be strictly related altogether into one, complete body.
Third impression – conclusion
When I have finished my reading I went through all the chapters and information presented in the book once again. In my mind I repeated all things I learned to check how much I was able to remember. I was positively impressed by the book composition, which is well-balanced and complete. I must admit the knowledge was just implemented to my mind in a soft manner. Great feeling! It is really amazing how the author managed to achieve such level of fluency in transferring his knowledge via written words, which are easy to understand, memorize and use. This is an unique ability today which makes the strongest advantage of the book.
For sure, for defined target readers the book will be a great guideline. I can strongly recommend reading "Getting Started with Lazarus IDE" to all former or current Delphi developers, who are now interested in Lazarus IDE. Also, I believe that people with other RAD experience will value this book, too. However, they will definitely find the book less interesting from developer's perspective – rather it will be a good, quick overview of the capabilities of Lazaurs IDE. So, I agree that Roderick Person has successfully addressed his target readers' needs. I also liked the style of the book and the fact that it was not bloated or overloaded, but short and focused on the purpose. I would take this book with me to business trip or would like to have somewhere near during my very first days with Lazarus/FPC development. Especially, when converted from Delphi world.
To summarize, "Getting Started with Lazarus IDE" by Roderick Person is great for Delphi newcomers to the Lazarus/FPC environment and cross-platform development enthusiasts. However, this book is not a good choice for people who would like to learn programming with the usage of Lazarus/FPC. This is a book written by programmer for programmers, beginners should look for other options, which are also available on the market.