Daily Challenge Day 12

So what value is python programming language, or any programming language for that matter?

A first introduction to programming was at school around grade 7, we filled in some cards, I think using the Basic programming language, sent them away and a few weeks later we all got calendars back, with pictures created using ASCII text. Next introduction was around grade 10, we filled in cards again, this time using strange symbols, I think it was the APL programming language. The cards were sent away and a few weeks later we got the results to our matrix 3×3 problems.

At university we got partial access to the computers running VMS operating system, it was all made mysterious, being told this area was for this and another area for that. We wrote our Fortran programs on data sheets and sent them to a data entry room, and a few days later we had access to our programs on the system where we could then test and edit the program. Following learning structured programming in Fortran 77, we moved onto Basic for last couple of weeks. Whilst Fortran 77 is not a structured programming language we were only allowed to use goto statements in predefined constructs such as while loops and repeat loops, and these had to have appropriate comments.

The first computer we got at home was a Microbee computer in a book, with a single 3.5″ disk drive, which we eventually upgraded to two drives. We had wordstar, spellstar, mailmerge, and Turbo Pascal. Turbo Pascal was preferable than microbee basic, and I didn’t need to do all that commenting that was required when studying Fortran. We moved up from there to a Microbyte computer running MS DOS. Got Turbo Pascal and Turbo C. When it came to crunching numbers I preferred C as it was more compact. Though handling pointers is a headache, and can complicate working with strings and arrays. On the other hand if can get a grasp of pointers messin with strings can be done with relatively compact statements. C was going to be the goto language for AutoCAD, so another incentive for learning C. However, I never had any real need to program Acad using C. First because I learnt the format of DXF files and could parse them with programs written in Turbo Pascal or Turbo C, and secondly the first stage of programming interaction with Acad is with AutoLISP. Since I could only afford Acad LT, AutoLISP had limited value and programming Acad script files (.scr) took over, which I can generate using any available programming language.

Initially I only wrote LISP routines when I had access to full Acad when working on contract, but then I bought IntelliCAD. Whilst LISP in IntelliCAD is not fully compatible with Acad, I have used it to develop and applications at home in conjunction with Acad LT, and then take into office working on contract and quickly modify to be compatible with Acad.

In addition to high level programming languages I also learnt various application and macro languages, such as dBase, FoxBase, Paradox for DOS, Lotus 123, as easy as, Quattro Pro and Wordperfect. The benefit of the application languages is that the application itself automates and aids a task, and the macro language provides further automation by automating the application. If have access to an task specific application, then automating that application is faster than writing a program from scratch in a general purpose high level language like C.

When moving to windows, I didn’t like Paradox for Windows, I didn’t want my code hidden and lost behind forms. Turbo Pascal for windows wasn’t all that useful to use, but as with the original Pascal user manual, it had good background to object oriented programming (OOP’s). Didn’t get going with Turbo Pascal for Windows, but eventually made more progress with Delphi. But since C, was seemingly the language  to use I also got C++ Builder, but failed to make much progress with it: I seemed to be only able to compile the examples, the simplest hello world program seemed to generate errors in the main library files. Had other things to do, so didn’t get to track down the problem.

Additionally programming, as with calculations, is a means to an end , not an end in itself. The problem with Delphi and C++ was creating suitable printouts which were not connected to databases. Additionally the problem of get the Borland database engine (BDE) installed on other machines, and connecting databases to the program. So easy to write programs on my own machine, but not for release to others.

Anycase since primary task was to produce calculation reports, the use of Quattro Pro for Windows (QPW) took over as main tool for programming. It was easy to produce dialogue boxes to collect data, and formatting reports was also simple. Formatting reports in spreadsheets doesn’t require running a program and checking the output, and modifying until the presentation is acceptable. The macro language extends the capabilities of the spreadsheet to read and write plain text files, and work with the file system. So for example my QPW spreadsheets could write data files for our plain frame analysis program, and also read the results files back into the spreadsheet, where I could use macros to find inflection points along members. QPW spreadsheets could also grab a list of DXF files and then create a SCR file to convert all the DXF files into DWG files.

On the other hand, it would have been better to have user defined functions rather than macros. Macros only updated spreadsheet calculations if data was changed via dialogue boxes, and then only if I activated the execution of macros: when testing data collection I often disabled to action to execute on close of dialogue. It was possible to extend the functionality of QPW using Delphi, but that seemed like a complex programming task, and then using the functions didn’t seem all that convenient.

Then looking around a bookstore I found a book on VBA programming in Microsoft Office, and learnt I could extend the capability of Excel with functions. More importantly I only need to learn one programming language for Excel, Access and Word, compared to three languages for QPW, Paradox and Wordperfect. Microsoft did what I expected Borland to do, but didn’t. So I bought Microsoft Office and the MS Office Systems Developer Kit.

So whilst C may produce smaller compact and faster programs, and status and prestige may exist for those that can program in the language, and there is a lack of respect for those who program in Basic, at the end of the day Basic is the ready available programming language that gets the job done. Most of us just want to get the job done.

Today python seems to have status for scientific computing, as does MathCAD, MatLAB along with derivatives such as Octave, SciLab and FreeMat. But do they have practical value?

My program for generating height span charts was original written in Delphi. The wind loading functions it used were developed in both QPW and Delphi. The Delphi functions were converted to VBA to work behind the scenes in Excel. The Delphi program generated a height versus span table. The wind loading code changed, and I needed to update the functions in Excel/VBA first, to keep calculation workbooks up to date. I was going to drive Excel via Delphi, but the type library wouldn’t import properly creating conflicts with Delphi language keywords. So I had to write without the assistance of type checking. There were also problems determining whether calls to Excel objects required array brackets or function brackets: this being a problem as different symbols are used in Pascal : [] arrays, () function parameters. I therefore needed to test code in Excel before writing in Delphi. I abandoned updating the program in Delphi and rewrote it in VBA and extended its capability to plotting xy-charts.

File management programs I wrote in Turbo C, I also converted to using Excel/VBA. Additional file management programs I then wrote in VBScript for use with Windows Scripting Host (WSH), using cscript. The objective there was that I didn’t need or want a file list in an Excel worksheet, I just wanted the script to run either at the command prompt or from the send to menu.

I got visual studio 2003 followed by 2005, originally with the hopes and expectations that I could make use of my VBA code without change and write applications independent of Excel. No such luck, VB had become vb.net, and bumped into incompatibilities: especially with array indexes. So never made much progress with vb.net and stuck with vba, and expend as much time in the vba editor (vbe) in Excel as I spend working in the worksheets.

As a consequence of time spent in VBE, I went looking for some interpreted version of Basic or some alternative language. One of the problems with Octave,Scilab and Freemat is that the calculator mode isn’t really suitable for printing to a report: too messy and too much vertical space for my liking. {For that matter wordpress has too much vertical space for my liking.}

I don’t like the application languages in Octave, Scilab and Freemat, and whilst the application libraries are large the capabilities of the languages seem limited. Of the three I prefer the Freemat environment, but haven’t really got into using it.

Python seems like it is a better language than that of the matrix based applications, but still seems a strange language with its required indents. So not really sure what benefit would come from converting frame analysis program to python. As with the matrix applications, the approach taken with python is liable to be completely different than the other programming languages.

So at the current point in time, still thinking that vba, vbscript and vb.net provide the more practical programming languages and environments.

Another exercise attempting is to convert my MS Excel spreadsheets to LibreOffice, but LibreOffice Basic, is more limited dialect to Basic than vba, and its development environment is also more primitive. Additionally the centralised macro library isn’t as convenient as first appeared: in fact it seems completely useless and major inconvenience, making basic modules hidden and inaccessible to workbooks. So I’m not sure of the point. Anycase in an attempt to rearrange and debug my vba to move into LibreOffice I also translated and tested with FreeBasic.

In short python may not be a practical use of my time, despite the large number of libraries available for it: as the issue is not really about learning languages but learning the libraries and objects models  used. Learning different programming languages is relatively easy. But the efficiency comes from the special application libraries which are available.

But libraries are not always efficient to use or beneficial. One reason for Fortran popularity was the availability of the IMSL libraries:  but why buy such library if you can write what you need in a few minutes. For example I assisted convert a program from Fortran on a main frame to Pascal on a PC, I wrote the matrix procedures for the Pascal program. But before writing the matrix procedures I deciphered the Fortran code relative to the original matrix expressions and then rewrote them in a simpler more readable format. That is the matrix algebra had been distorted to fit the library functions: which was wasteful of computer time and memory. So whilst the library enabled the program to be written quickly, it locked the program to the resources of a mainframe.

Libraries and especially objects often contain alot of surplus requirements, it often such can be more inconvenient than benefit. Consider how application software becomes bloated with additional features, and that whilst this is all very nice, it often requires modifying several times more parameters than was originally required: so that a task which was originally improved by the software is now hindered. If have to make changes to a parameter, then could forget, or get it wrong: if don’t have to touch it, because it is locked, and no one else change it either, then efficiency and productivity improves and errors are reduced. This seems to be lost when software developers release their upgrades, which are not upgrades at all but different products: different tools. With people preferring the original tools.


Revisions:

  1. [27/04/2017]: Original (intended)
  2. [28/04/2017]: Original (actual) – didn’t hit publish fast enough to post before midnight.