Feeds:
Posts
Comments

Archive for the ‘Software Development’ Category

Since many years I have been writing down the guidelines I use when developing software. Mainly because it’s easy to forget some of them, but also because at times you need to explicitly ponder their weight in a trade-off between two or more “principles”. One thing is clear after all those years I have spent writing and reading software, whether it was written by me or someone else: writing good software and writing good code is difficult.

Michael Foord has written up his “30 best practices for software development and testing“, and it’s hard to disagree with his list: there is a lot of good advice in it! If you’re just starting to code, you can’t hope to apply all 30 “rules” at once. The only gripe I have is with the title of his post: in my view, it should have been published as “30 best practices of software coding and testing“. There is, after all, a lot more to software development than coding.

Let me prove that statement. For heaps of excellent advice on the subject of software development in general I always pick up Alan M. Davis’s “201 principles of software development“.

My copy was printed in 1995, and it seems there are no reprints – which is a shame, because Alan Davis did a great job of consolidating proven principles in categories ranging from requirements analysis over design to coding and testing and product assurance. Each principle is explained, and Davis adds at least one reference text for almost every principle. In summary, the content of this book is not very original but it remains a valid and comprehensive overview of good software engineering practices. That remains true, even after more than 20 years!

PS. I already wrote earlier posts on the subject of software engineering principles, e.g. in May 2015

Advertisements

Read Full Post »

I encountered this weird situation last week: while testing ColdFusion code from a previous decade, I would see the output of part of the screen twice. Just like that – I had not changed a thing to the logic of the code, just cleaned up a bit of what I consider to be “bad” formatting in code written by others a long, long time ago (2005 or so).

I spent hours of debugging the code, even invited a few colleagues to help me – and then suddenly it struck me: CFML may look like XML, but it isn’t XML. Some CFML tags do their thing a second time when the tag is explicitly closed. One of those tag is <cfmodule>. I never use it myself – I prefer components and functions. But the code under scrutiny included a <cfmodule template='whatever.cfm >, and to “clean things up” I had added a slash at the end, like this: <cfmodule template='whatever.cfm />. Hence the double execution. So don’t do that, will you? Avoid closing <cfmodule>!

You can imagine my state of mind when I realised my error, don’t you? Yeah… I had seen this problem before, but much too long ago to actively avoid it in practice.

Before lecturing me on the subject: I know, I should be writing cfscript… but I don’t have the luxury to rewrite code that is more than 10 years old. So it will stay as it is.

Also: I consider this to be a bug in Adobe ColdFusion (at least in versions 6, 8 and 11). There’s no logical reason for such behaviour. I don’t know if Lucee or BlueDragon act similarly, but I hope they’re smarter than that!

And for the record: for me, code is “badly” formatted when it is hard to read – by me. I know compilers and computers have no trouble handling things like whole programs on a single line, or lacking coherent indents (unless it’s Python, of course), or unclosed XML tags (elements), to name but a few examples. I want code to easily readable by humans, and certainly by me – especially if I’m responsible for its maintenance…

Read Full Post »

Sure. As told on the Zappa webpage:

Zappa makes it super easy to build and deploy server-less, event-driven Python applications (including, but not limited to, WSGI web apps) on AWS Lambda + API Gateway. Think of it as “serverless” web hosting for your Python apps. That means infinite scaling, zero downtime, zero maintenance – and at a fraction of the cost of your current deployments!

That’s less revolutionary than Frank Zappa, of course. But it might come in handy, once I find the time to do some real Python development… Then again, you will probably beat me to it!

Read Full Post »

We’re six years later, and I still haven’t gotten around to any kind of “Tinkering With The Raspberry Pi“. That does not mean that I still have to write down the production numbers from our solar panels by hand, however. The Asus eeePC, running Xubuntu and a bit of software a former colleague of mine and I hacked together, takes care of that. In doing so, it constructs a number of text files: one for each day, listing the current production in Wh every ten minutes, and one for each year, detailing the total production for each day. The backup of these files is made every day by a tool called ‘grive2‘ (but I’ll write about that later).

The setup works fine, almost all the time. But somehow the SMA Sunny Boy gets confused and creates ‘yearly’ files for years other than the current calendar year. Those files are utterly useless and clutter the hard disk as well as the backup, so I decided to get rid of them automatically. To prepare for the first days of a new year, the script should also be able to leave the file for the previous year in place – there may be two valid ‘yearly’ files in January, should I fail to archive the old year on New Year’s eve or on Jan. 1st.

To exercise my *nix shell skills, I decided to do that in ‘bash‘ rather than extend the current Python tools.

As is my habit, I decided to start with a demo script that does what I want on dummy data. For demo purposes the JDoodle website is a great resource, at least for ‘bash’ scripting (I did not try any of the 67 other languages available on the site). This allowed me to work on the code on my Mac-with-big-screen, and take the necessary screenshots for this post.

Here is the code I came up with:

Click on the image to get it in the form of a PDF file,
ready for copy/paste operations.

Nothing spectacular, as shown by the output. Now all I have to do is turn this into a little non-demo script and add it my crontab on the eeePC… Come and see in six years or so ;-)

PS. I’m just dabbling in bash scripting, so if there are better solutions for my problem, don’t hesitate to explain them to me, please.

Read Full Post »

The SD Times website writes up the state of affairs on Free and/or Open Source Software: Open source at 20: The ubiquity of shared code. Even after 20 (or more) years, the situation isn’t always clear, certainly not for new developers. So this article is a good start if you’re new to software development.

In the year 2000 I compiled on the Free Software page in this site. I’m pleased to see that the texts and sites on the page are still relevant. Only two sites disappeared (linuxppc.org and opensourceit.com); the rest is still thriving and relevant! Well, except for the link to Reddit – still a remarkable site, but no longer just for FOSS fans.

A landmark paper about Free and Open Source Software

Read Full Post »

The BoingBoing website pointed me to the Programmer’s Oath. Good initiative, and I do agree with every one of the items.

As usual, of course, my mind started analysing the text, and soon concluded that 8 of the 10 tenets are not specific to programming, but could be applied to any profession! And tenets 2 and 6 don’t need big changes to make them more generally applicable. So what user Widdershin came up with is the base for moral behaviour that all humans could/should fulfill.

Well, being cynical at times just like anyone, I should perhaps exclude politicians…

Read Full Post »

I noticed some interest in my earlier posts about ntlmHTTP, and that surprised me a bit. I wrote about the subject in 2011, and that is a long time ago, in IT terms!

So to clarify things: the ntlmHTTP project is no longer required: Adobe added NTML (aka. “Windows Integrated Authentication”) support to the CFHTTP tag in ColdFusion version 11. I did rework my code from 2011, and indeed: CFHTTP did suffice to call the Microsoft Exchange web services successfully with the credentials of a special technical account.

Although I did not test it I’m pretty sure NTLM is still there in later CF versions ;-)

Read Full Post »

Older Posts »