Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!metro!nuts!cc.nu.oz.au!eepjm From: eepjm@cc.nu.oz.au Newsgroups: comp.lang.modula2 Subject: Re: PASCAL -> MODULA-2 Message-ID: <5278.27639d89@cc.nu.oz.au> Date: 10 Dec 90 04:36:57 GMT References: <2170.275C00DC@puddle.fidonet.org> <1990Dec5.133742.23007@funet.fi> Organization: University of Newcastle Lines: 51 In article <1990Dec5.133742.23007@funet.fi>, jau@news.funet.fi.tut.fi (Jukka Antero Ukkonen) writes: > > From article <2170.275C00DC@puddle.fidonet.org>, by Frank.Warren@f42.n161.z1.fidonet.org (Frank Warren): >> There is enough difference between Pascal and Modula-2 that, while this >> may sound a little stuffy, I think conversions should be hand done. > > I did not quite get what is that enough difference. > The only real differences are a more strict type model in the Modula-2 > and a somewhat different IO-routine set. You forgot the most crucial difference: the ability to break up a program into modules. Would you want to convert a 30-page Pascal program into a single Modula-2 module? I agree with Frank, on the basis of personal experience. I used to program a lot in Pascal, and I tried to follow the accepted principles of clean program design, but I found that my programs always became unmanageable after the size grew beyond about 20 pages. (This was with a number of different Pascal compilers, some of which claimed to support modularisation ... but there I kept running into trouble with inappropriate divisions into modules, caused by poor language support for the module concept.) For the past couple of years I've used Modula-2 for almost all my coding, and I find that during top-down coding the decisions about when to create a new module and what to put in each module have become easy (basically, it's that procedures belong together when they work on the same kind of object). But if I had an *existing* program, for example in Pascal, I would find it much less easy to do the break-up unless I started coding from scratch. And in fact I've taken some of my old big Pascal programs, rewritten them from the beginning in Modula-2, and have observed that the new versions are much more readable than the originals - and sometimes much more efficient, because in a clearly readable program it's easier to see better ways of doing things. By the way, I don't want to come across as one of those people who think that Modula-2 is the best thing since sliced bananas. When a better language arrives, I'll convert to it (I've gone through a lot of languages in the last 20 years). My main point is that there is a fairly major difference, in terms of the programming style which is encouraged, between Pascal and Modula-2. IMAO, automatic translation has its place when going from a higher- to a lower-level language, e.g. Pascal to C; because such translations are done mainly in cases where there is not a suitable compiler for the first language, and readability of the translated code is not a real issue. But in going from a lower- to a higher-level language, the goal is presumably to have target code which can be maintained, revised, etc., so it's important to have a high-quality translation. At the moment, it looks as if only human coders can provide the requisite high quality. Peter Moylan eepjm@cc.nu.oz.au Disclaimer: the views in this posting are not necessarily opinions.