Category Archives: Computing

Articles about computers and the IT industry.

Practical C Programming

Introduction

It sounded like just the kind of book that I was looking for. I wanted a refresher on C since I’d not used it for a while, and some pointers on ‘advanced techniques.’ The blurb on the back looked about right and the fact that O’Reilly published it clinched the sale.

“Practical C Programming” not only plans to teach you C, but also about style, debugging and the software life-cycle.

Content

The book is split into three sections: Basics, Simple Programming and Advanced Programming.

‘Basics’ introduces the language, leaving out much of the fluff and complex bits, but including much on style and ‘process’ — designing, building and maintaining your program. This part of the tutorial is well structured, only introducing new features of the language as and when they are necessary. It does not teach you how to program, rather how to write C. Since you must be able to program before you start the book, I consider the pace to be much too slow. If you already know how to program, why should you have to wait until chapter six before introducing the if statement?

‘Simple Programming’ finishes off what the last section started. It adds most of the more complex bits such as scope, bitwise operators, pointers, floating-point numbers and the C Preprocessor. Of course, the boundary between basic and simple is not well defined, but I would consider the for statement to be basic. This section also includes information on optimising programs which you might have thought would fall under the ‘Advanced Programming’ section.

The final section is much more terse and reference-like than the first two sections. It includes topics such as the difference between ANSI and Kernigan and Ritchie C, more on pointers, portability and some of the more dodgy parts of C such as the 😕 operator and goto statement. It also includes a section on modular programming (again, I would consider this to be in the wrong section) and ‘Programming Adages.’ For the experienced programmer, it is probably this last chapter that is the most useful. Reminders such as avoid side-effects and never put an assignment inside a conditional seem to go against the grain of conventional C wisdom, but are, indeed, correct and very valuable.

Conclusion

‘Practical C Programming’ is not a bad book by any means. Scattered through its 400-odd pages are dozens of useful tips and heuristics, many of which I’ve not seen in print before. It also manages to clarify some oddities, and the example programs are mostly well thought-out and clear.

The C tutorial is not in enough detail to help a true novice and is too chatty and basic for some people, like myself, who just want the facts. The annoying part is that there is a lot of information in there that I didn’t already know, but I almost didn’t have the patience to read it.

It’s also unusual to find a chapter on software engineering in a C book. Oualline has a nice discussion of design, source control and configuration management but it does leave you wondering why it is there. Sure, it’s an important topic, but there are huge books dedicated to this subject. He can not (and does not) even begin to scratch the surface.

What the book lacks is a clear focus. Is the book for a novice programmer? Is it for someone that doesn’t know C? Someone that does know C? Is it a reference? A software engineering guide? The real answer is that it tries to do it all, but only partially succeeds. A nice try but not a must buy.

The facts

Author: Steve Oualline

Cost: Approximately ?24.50 or US$32.95

ISBN: 1-56592-306-5

Buy this book from Amazon.com of from Amazon.co.uk.

Oracle PL/SQL Programming

Introduction

The first point to note is that this book is published by O’Reilly. The second point would be that Steven Feuerstein is generally regarded to be one of the worlds leading PL/SQL experts.

Those two point, on their own, were enough to clinch the purchase just over eighteen months ago.

Content

The book is, to say the least, comprehensive. When I first started to use PL/SQL I would never have guessed that there was enough there to write a thousand page book, but there is.

It’s split into seven sections and twenty-six chapters, making it a good reference as well as useful to learn from. Section one, ‘Programming in PL/SQL’ talks about the history, block structure and style. I’m not entirely convinced that ‘programming style’ belongs in a book such as this, but it’s well written, useful and less intrusive than the similar treatment in “Practical C.”

Section two moves onto the ‘meat’ of the language and takes up over two-hundred pages in its own right — longer than the whole of some other texts! Feuerstein covers all this in detail and with great skill, mentioning not only how the language works but also, where appropriate, where it doesn’t work. This kind of honesty seems rare, especially in Oracle Press books!

‘Built-in Functions’ does exactly what you’d expect, and includes a thorough discussion on handling dates, a common area of confusion (I was pleased to find that it’s not just me…).

Parts four and five are, perhaps, the most clumsy sections. The first talks of ‘Modular Code,’ which I don’t see as being so advanced that it requires its own section. And part five discusses the ‘New PL/SQL8 Features’ which, again, don’t necessarily deserve a section on their own. I suppose it made writing the second edition easier…

The last section before the appendices is called ‘Making PL/SQL Programs Work.’ For those not familiar with server-side PL/SQL, let me point out that this isn’t as silly as it sounds. PL/SQL, until recently, had no debugging facilities to speak of. You can’t set break-points or single-step and even outputting trace statements to the screen is not trivial.

However, although the stuff that Feuerstein writes is interesting and might be useful to some, it’s not all it might be. For example, in the section on tracing PL/SQL programs (chapter 26) he talks about Oracle tracing which, if you’ve ever seen, you’ll realise how useless it is much of the time. (If you’ve not seen it before, be warned that you’ll get thousands of lines of very low-level junk for even a simple program.)

Why did he not talk about a tracing library, say, that logs trace messages into the database with a pipe? I ended up writing one myself, based on the information in the book but I’d preferred not to have!

I thought you said you liked it?

If you said that the last section was very negative I wouldn’t be able to disagree with you. However, this is a book that I’ve been using for over a year, not something I got as a review copy and skimmed. I’m still using the book on a daily basis so it must have some merit. I would never have found many of the problems if the book hadn’t been an important and useful reference for all this time.

O’Reilly know how to publish a good technical book. They focus on telling you what you need to know and how it does, should or, indeed, does not work. Feuerstein’s Oracle PL/SQL Programming is one of the better O’Reilly books, so you should be able to guess how highly I rate it.

I first got my copy over a year ago and I’ve spent most of that time on Oracle projects. I have kept this book by my side at all times and only on a few occasions has it not been able to answer my questions. It’s now so well used and grubby that I may be forced to buy a new copy.

The facts

Author: Steven Feuerstein with Bill Pribyl

Cost: $46.95

ISBN: 1-56592-335-9

Buy this book from Amazon.com or from Amazon.co.uk.

Programming Languages Home

You tend to find two things relating to programming languages on the Internet. The first is a long list of all the languages, often with links to a representative web site. The second category are the “representative” web sites, detailed descriptions of a particular language.

I hope to make this part of ZX81.org.uk to be the middle-ground. I won’t cover every language ever designed and nor will I cover them in vast amounts of detail. Instead I’ll look at each languages main features, advantages and flaws.

What makes me qualified to write these critiques? Well, I’ve used all of the languages covered so far on at least one non-trivial project and at university I did a lot of programming language design and compiler development courses.

The two languages I’ve covered so far are the major Unix stalwarts Perl and C.

Oracle Applications Comedy Errors

Fair’s fair, any application the size and complexity of Oracle Applications will have some bugs. But applications seems to do far better than most.

This section refers to the server size of Applications Comedy Errors. There’s another page for the client side.

  • To install a new application module, it seems that you have to add the original version you have plus all patches. Not just for your new module, but for all of them. (People that implement Application’s are not expected to make mistakes.)
  • The recommended sizes for your database extents are useful. However, if you follow the advice, some parts of the system won’t actually install.
  • Oracle helpfully supply a program that goes through the thousands of files that it installs and checks that they’re the right ones. We’ve found at least a dozen files that it claims shouldn’t be there but in fact should be.
  • After applying a patch, the shell script that starts the Concurrent Managers just vanished.
  • One of the bugs that we found was because Oracle had ‘forgotten’ to port a number of forms from one environment to the one we were using. The word ‘forgotten,’ despite being inverted commas, is the actual word used by Oracle support.

Oracle Server Comedy Errors

Oracle, the company, was founded back in the late seventies as a company that produced an SQL database. Its entire reputation has been built on this product and it is, therefore, no surprise that it is very good.

That’s not to say that there have been no problems…

  • To perform dodgy ‘system’ operations on a database, you need access to a user called ‘internal.’ In theory, you need to be in the UNIX ‘dba’ group to be able to connect. That is unless you belong to rather a lot of groups, in which case it doesn’t seem to work. (We’ve not actually called this through, so there may be a simple explanation.) (7.1)
  • When creating a new database, you have to run a file called ‘catalog.sql’ to finish the job. At the end of this file is the following message: ‘THIS IS THE END OF THIS FILE – IF I AM NOT HERE THEN RCS HAS TRUNCATED FILE‘ (7.3)
  • I’m not entirely sure that this counts, but an installation program that requires more resources than that product that it’s installing demands at least an honorable mention. (8i)