More thoughts on what “open source” means…
Software Development
There are 92 posts filed in Software Development (this is page 8 of 10).
Read: Why open?
Here’s a part of open source that I have not thought about before:
Open source is a bottom-up, worker-led movement. The means and outputs of production are available to everybody. I think that’s beautiful – and, in a world where every aspect of our lives has been packaged and monopolized for profit, a powerful force for good.
Read: Microsoft open sources Calculator source code
This is pretty neat, will take a look at this sometime!
Read: 2019 – Independent Blogging Trends
via Chris Aldrich – I think people focus too much on having the perfect tool or the right tool, just start with some tool – just get started!
Read: Java’s Forgotten Forbear
An interesting history of an early Pascal development environment. Turbo Pascal was also an early success for PC software development.
How to download a file from Github using Node.js
(via Dave Winer) – I used Fortran as my first professional programming, interesting to see that there are still so many users…
I am helping Ron Chester with setting up a river of news on Bob Dylan, but some of the sites of interest do not have RSS feeds. This looks like a straight-forward example that could be used for those sites, I will try it out!
Working with callbacks in Javascript
I am playing with the sample code for Dave Winer’s feedRead Github repo, and wanted to refactor one of the examples. I have seen multiple examples of a callback function source code included in a call to another function, but I wanted to have it be a separate function. Here is the example code:
[cc lang=”javascript”]
feedRead.parseUrl (urlTestFeed, timeOutSecs, function (err, theFeed) {
if (err) {
console.log (err.message);
}
else {
console.log (“It took ” + utils.secondsSince (whenstart) + ” seconds to read and parse the feed.”);
console.log (“theFeed.head == ” + utils.jsonStringify (theFeed.head));
console.log (“theFeed.items [0] == ” + utils.jsonStringify (theFeed.items [0]));
for (var i = 0; i < theFeed.items.length; i++) {
console.log (“Item #” + utils.padWithZeros (i, 2) + “: ” + theFeed.items [i].title + “.”);
}
}
});
[/cc]
After some experimenting, I figured out that all I needed in the feedRead.parseUrl call was the function name (with no parameters, even though it had parameters), and then the function could be factored out:
[cc lang=”javascript”]
feedRead.parseUrl (urlTestFeed, timeOutSecs, myparser);
function myparser (err, theFeed) {
if (err) {
console.log (err.message);
}
else {
console.log (“It took ” + utils.secondsSince (whenstart) + ” seconds to read and parse the feed.”);
console.log (“theFeed.head == ” + utils.jsonStringify (theFeed.head));
console.log (“theFeed.items [0] == ” + utils.jsonStringify (theFeed.items [0]));
for (var i = 0; i < theFeed.items.length; i++) {
console.log (“Item #” + utils.padWithZeros (i, 2) + “: ” + theFeed.items [i].title + “.”);
}
}
}
[/cc]
Note that the function does not have a semicolon at the end, but the call to feedRead.parseUrl does…
References:
https://codeburst.io/javascript-what-the-heck-is-a-callback-aba4da2deced
https://javascriptissexy.com/understand-javascript-callback-functions-and-use-them/
How embedded software projects run into trouble
Jack Ganssle has written articles for his top ten list of how embedded software projects run into trouble. Most of this could apply to any software project! Here are the links:
- Unrealistic schedules
- Quality gets lip service
- Poor resource planning
- Writing optimistic code
- Weak managers or team leads
- Crummy analog/digital interfacing
- Bad science
- The undisciplined use of C and C++
- Jumping into coding too quickly
- Not enough resources allocated to a project