Tag Archives: coding

More reasons why ChatGPT is not going to replace coders

I have been arguing recently about the limits of the current AI and why it is not going to take over the job of coding yet. I am not alone in this regard. Clive Thompson, who knows a lot about the topic, recently wrote this: Why ChatGPT Won’t Replace Coders Just Yet. Among other reasons, the “‘bullshit’ problem turns up in code, too”. I recommend you read Clive’s take on the subject. And after you read that, check out his book, “Coders”. You can order it, here, from his publisher. I think it’s a classic and one of the best things written on software.

Advertisement

The history of people asking: is technology X going to replace programmers?

Recently Nature (of all publications) asked the clickbait-y question:
Are ChatGPT and AlphaCode going to replace programmers?  It then quickly states: “OpenAI and DeepMind systems can now produce meaningful lines of code, but software engineers shouldn’t switch careers quite yet.” Then why even ask the question? It goes on to say: Deepmind, a part of Google, “published its results in Science, showing that AlphaCode beat about half of humans at code competitions”.

Regardless of what you think about that article in Nature, here’s the thing to always keep in mind: technology X has been coming along to replace programmers forever.  We had machine code that was replaced with assembler language. We had Assembler language replaced with higher level languages like Fortran. We had a wealth of more sophisticated programming languages come on to the scene. In addition, programming tools like IDEs have come along to save the day and make programming easier for programmers. Yet we still have not lost the need for programmers to write programs.

Programming is still about taking what people want the computer to do and codifying it in a language that the computer understands. In other words: programming. As long as that code is required for computers to do what humans want, there will always be programmers.

Here’s another thing to consider: code is a more efficient way to communicate to a computer. I can write in English “count all the entries in this column from row 2 to 100 if the entry equals the word ‘arts'” or I can write in (Excel) code “=countif(A2:A100,”arts”)”. That efficiency will likely mean that coding will be around for quite some time yet. And people doing that coding will be programming, even if they don’t consider themselves programmers.

So no, Alphacode is not going to replace programmers and programming. It might replace some of the task of what some of them currently do. But programmers and programming will be around for some time to come.

(I like the image above because it captures how the software design and development process is a complex thing, and not just a matter of writing a bunch of code. A lot of thought goes into developing something like a smart phone application, and that thought results in code that results in a good app.)

What I learned writing web scrapers last week


I started writing web scrapers last week. If you don’t know, web scraper code can read web pages on the Internet and pull information from them.

I have to thank the Ontario Minister of Health for prompting me to do this. The Minister used to share COVID-19 information on twitter, but then chose recently to no longer do that. You can come to your own conclusions as to why she stopped. As for me, I was irritated by the move. Enough so that I decided to get the information and publish it myself.

Fortunately I had two things to start with. One, this great book: Automate the Boring Stuff with Python. There is a chapter in there on how to scrape web pages using Python and something called Beautiful Soup. Two, I had the minister’s own web site: https://covid-19.ontario.ca/. It had the data I wanted right there! I wrote a little program called covid.py to scrape the data from the page and put it all on one line of output which I share on twitter every day.

Emboldened by my success, I decided to write more code like this. The challenge is finding a web page where the data is clearly marked by some standard HTML. For example, the COVID data I wanted is associated with paragraph HTML tag and it has a class label of  covid-data-block__title and covid-data-block__data. Easy.

My next bit of code was obit.py: this program scrapes the SaltWire web site (Cape Breton Post) for obituaries listed there, and writes it out into HTML. Hey, it’s weird, but again the web pages are easy to scrape. And  it’s an easy way to read my hometown’s obits to see if any of my family or friends have died. Like the Covid data, the obit’s were associated with some html, this time it was a div statement of class sw-obit-list__item. Bingo, I had my ID to get the data.

My last bit of code was somewhat different. The web page I was scraping was on the web but instead of HTML it was a CSV file. In this case I wrote a program called icu.sh to get the latest ICU information on the province of Ontario. (I am concerned Covid is going to come roaring back and the ICUs will fill up again.) ICU.sh runs a curl command and in conjunction with the tail command gets the latest ICU data from an online CSV file. ICU.sh then calls a python program to parse that CSV data and get the ICU information I want.

I learned several lessons from writing this code. First, when it comes to scraping HTML, it’s necessary that the page is well formed and consistent. In the past I tried scraping complex web pages that were not and I failed. With the COVID data and the obituary data,  those pages were that way and I succeeded. Second, not all scraping is going to be from HTML pages: sometimes there will be CSV or other files. Be prepared to deal with the format you are given. Third, once you have the data, decide how you want to publish / present it. For the COVID and ICU data, I present them in a simple manner on twitter. Just the facts, but facts I want to share. For the obit data, that is just fun and for myself. For that, I spit it into a temporary HTML file and open it in a browser to review.

If you want to see the code I wrote, you can go to my repo in Github. Feel free to fork the code and make something of your own. If you want to see some data you might want to play with, Toronto has an open data site, here. Good luck!

 

What programming language should you learn? (2022 edition)

The best programming languages to learn in 2022, according to TechRepublic are these:

It’s interesting to see how things have changed. Back in 2015 when I wrote about this, Java was 1st and Python was in 4th. Javascript was 8th! I am not surprised by this.

Java and the C languages will always be good to know. But if you want to be marketable, learn some Python and Javascript.

If you are writing a bash script to call a curl command and you want to pass variable values to it, read this…

CodingImage
If you are writing a bash script to call a curl command and you want to pass variable values to it, you may find a hard time determining how to go about it. I did!! I consulting with lots of pages, and nothing seemed to tell me what I want.

Here’s what I eventually did.

Take this example. I am using curl to call the sendgrid API, as you can see below. (I don’t have all the variables, but they were all strings like THESUBJECT and THECONTENT.).

The trick is in the use of single and double quotes. For the variables, they are in double quotes. But notice the use of single and double quotes in the curl command:


TOYOU="noone@gmail.com"
THESUBJECT="once again!"
THECONTENT="Looks good!"
curl --request POST --url https://api.sendgrid.com/v3/mail/send \
--header 'Authorization: Bearer '$AUTH_TOKEN \
-H 'Content-Type: application/json' \
--data '{"personalizations": [{"to": [{"email": '\"$TOYOU\"'}]}],"from": {"email": '\"$FROMME\"'}, "subject": '\""$THESUBJECT"\"', "content": [{"type": "text/plain", "value": '\""$THECONTENT"\"' }]}'

Let’s look at the variables in that curl command.

$AUTH_TOKEN has no quotes around it. In fact, it is up against a single quote on its left. That single quote ends the string Authorization: Bearer and let’s the script fill in the value of $AUTH_TOKEN.

Now look at $TOYOU AND $FROMME. Both of those variables have no blanks in them. So there is a single quote-slash-double quote on the left and a slash-double quote-single quote to the right.

that is different than $THESUBJECT and $THECONTENT. Those strings have blanks in them. For them, there is a single quote-slash-double quote-double quote to the left of them and a double quote-slash-double quote-single quote to the right.

It’s crazy but true. Good luck with it!

(Photo by Shahadat Rahman on Unsplash )

What I find interesting in tech, May/June 2021

Here’s what I found interesting lately in tech, from cloud to coding and lots more.

Cloud: I’ve been doing lots of work on Azure recently. Some things I found useful were this listing of Virtual machine sizes Also disk types. This piece on how to expand your virtual hard disks on a Linux VM was good. If you want to run Websphere on Azure, read this: Run WebSphere Application Server on Azure Virtual Machines.  If you want to learn more about deploying applications in Red Hat, read this. Finally here’s some good stuff from IBM on
Cloud Architectures.

Coding: If you want to print coloured text in Python — and who wouldn’t? — this is good. If you want to turn your HTML into an RSS feed, read this.  This will help you set up VS Code to do PHP Development. For people wanting to learn more about machine learning, IBM can help you. If you love Prolog or Javascript — or both! — check out: Tau-Prolog

Raspberry Pi/IOT: This is a great guide on how to troubleshoot problems with a Pi. This is a cool project using an OLED to make a clicker counter. If you need to load an OS or anything else on a Flash card, check out balenaEtcher. Here’s some advice on getting started with Bluetooth Low Energy. If you want to connect a raw serial terminal to a bluetooth connection, read that. If you want to do a cool Raspberry Pi Pico project with a MIDI, see this.

Fun and cool: Not a real Captcha, but a real fun one! DOOM Captcha – Captchas don’t have to be boring. Also fun: Crappy robots, ranked!. As an old user of 3270s, this downloadable version of 3270 fonts is awesome. Speaking of cool, here’s kinda the source code for Eliza! Check it out.

Other: Here’s some help on how to control smart home devices using speakers and displays. Here’s a good reminder that robots have a way to go yet: Peanut the Waiter Robot Is Proof That Your Job Is Safe. Developers! Here’s What’s Hot/What’s Not in terms of skills. Finally, have you considered how to
write software that lasts 50 years?

(Image via Raspberry Pi)

What I find interesting in tech, April 2021. Now with Quantum Computing inside!

Here’s 9000 links* on things I have found interesting in tech in the last while. There’s stuff on IT Architecture, cloud, storage, AIX/Unix, Open Shift, Pico, code, nocode, lowcode, glitch. Also fun stuff, contrarian stuff, nostalgic stuff. So much stuff. Good stuff! Stuff I have been saving away here and there.

On IT Architecture: I love a good reference architecture. Here’s one from an IBM colleague. If you need some cloud adoption patterns when doing IT architecture, read this. Here’s a tool to help architects design IBM Cloud architectures. Like it. Here’s some more tools to do IBM Cloud Architecture. Architectural Decision documentation is a key to being a good IT architect. Here’s some guidance on how to capture ADs. This is also good on
ADs I liked this:some good thoughts on software architecture.

Here’s some thoughts from a leading IT architect in IBM, Shahir Daya. He has a number of good published pieces including this and this.

One of my favorite artifacts as an architect is a good system context diagram. Read about it here. Finally, here’s a piece on UML that I liked.

Cloud: If you want to get started in cloud, read this on starting small. If you are worried about how much cloud can cost, then this is good. Here’s how to connect you site to others using VPN (good for GCP and AWS). A great piece on how the BBC has gone all in on serverless.. For fans of blue green deployments, read this. A good primer on liveness and readiness probes. Want to build you own serverless site? Go here

Storage: I’ve had to do some work recently regarding cloud storage. Here’s a
good tool to help you with storage pricing (for all cloud platforms). Here’s a link to help you with what IBM Cloud storage will cost. If you want to learn more about IBM Object storage go there. If you want to learn about the different type of storage, click here and here.

AIX/Unix: Not for everyone, but here is a good Linux command handbook. And here is a guide to move an AIX LPAR from one server to another. I recommend everyone who use any form of Unix, including MacOS, read
this. That’s a good guide to awk, sed and jq.

Open Shift:  If you want to learn more about Open Shift, this is a good intro. This is a good tutorial on deploying a simple app to Open Shift. If you want to try Open Shift, go here.

Raspberry Pi Pico:  If you have the new Pico, you can learn to set it up here.
Here’s some more intros to it. Also here. Good stuff. Also good is this if you want to add ethernet to a Raspberry Pi pico.

On Networking: If you want to know more about networking you want to read this, this and this. Also this. Trust me.

Code: Some good coding articles. How to process RSS using python. How to be a more efficient python programmer. Or why you should use LISP. To do NLP with Prolog the way IBM Watson did, check this out. If you want to make a web app using python and Flask, go here. If you need some python code to walk through all files within the folder and subfolders and get list of all files that are duplicates then you want this. Here’s how to set up your new MacBook for coding. Here’s a good piece on when SQL Isn’t the Right Answer

Glitch: I know people who are big fans of Glitch.com. If you want to see it’s coolness in action, check. out this and this

No Code Low Code: If you want to read some good no-code/low-code stuff to talk to other APIs, then check out this, this, and this.

Bookmarking tool: If you want to make your own bookmarking tool, read
this, this and this. I got into this because despite my best efforts to use the API of Pocket, I couldn’t get it to work. Read this and see if you get further.

Other things to learn: If you want to learn some C, check out this. AI? Read this Open Shift? Scan this. What about JQuery? Read this or that Bootstrap. this or this piece. Serverless? this looks fun. PouchDB? this and this. Express for Node? this. To use ansible to set up WordPress on Lamp with Ubuntu, go over this. To mount an NFTS mount on a Mac, see this. Here’s how to do a Headless Raspberry Pi Setup with Raspbian Stretch

Also Fun: a Dog API. Yep. Here is CSS to make your website look like Windows 98. A very cool RegEx Cheatsheet mug.. And sure, you can run your VMs in Minecraft if you go and read this. If you want to read something funny about the types of people on an IT project, you definitely want this.

Contrarian stuff: Here are some contrarian tech essays I wanted to argue against, but life is too short. Code is law. Nope. Tech debt doesn’t exist.Bzzzt. Wrong. Don’t teach your kids to code. Whatever dude. Use ML to turn 5K into 200K. Ok. Sure.

Meanwhile: Back to earth, if you want to use bluetooth tech with your IOT projects, check out this, this, this, and this. If you have an old Intel on a stick computer and want to upgrade it (I do), you want this. If you want to run a start up script on a raspberry pi using crontab, read this If you want to use Google Gauge Charts on your web site, then read this and this.

Nostalgia: OS/2 Warp back in the 90s was cool. Read all about it
here.Think ML is new? Read about Machine Learning in 1951
here. This is a good piece on Xerox Parc. Here is some weird history on FAT32. And wow, here is the source code for CP/67/CMS. And I enjoyed this on Margaret Hamilton.

Finally: Here are IBM’s design principles to combat domestic abuse. Here is how and why to start building useful real world-software with no experience. Lastly, the interesting history of the wrt54g router

(* Sorry there was less than 9000 links. Also no quantum computing inside this time. Soon!)

Quote

Do you know someone who wants to learn how to code? (Maybe it is you!)

Then this is a good page for them to go to: How I Learned How To Code Using Free Resources | Home | Bri Limitless. 

There’s plenty of good links to information, and they are all free. I can vouch for a number of them, such as Codecademy and Coursera.

One problem people run into is: why should I learn to code? One obvious answer is to learn a set of skills to help them gain employment. Two other reasons I have:

  1. build a website to promote yourself or any future business you might have.
  2. automate things you do on your computer

For #1, being able to build a website is a great way to promote yourself and show yourself to the world. As for #2, that’s the main reason I still keep coding. There’s lots of information I want to process, personally and professionally, and coding is the best way to do that.

Regardless of your reason, if you want to learn to code, check out Bri Limitless’s web page.

My mixed bag of IT links for December

Like previous collections of IT links, this collection reflects things I am interested in or found useful recently:

  1. If you want to get started using APIs, I recommend this: Most Popular APIs Used at Hackathons | ProgrammableWeb
  2. If you want to build that web site, consider Using Twitter Bootstrap with Node.js, Express and Jade – Andrea Grandi, and this Building a Website from Scratch with ExpressJS and Bootstrap | Codementor. Also Mastering MEAN: Introducing the MEAN stack and Bluemix Mobile, Part 1: Creating a Store Catalog application – Bluemix Blog
  3. Or develop a mobile app like this: Create Swift mobile apps with IBM Watson services – developerWorks Courses
  4. I am a fan of Bluemix and Eclipse. This article ties them nicely together: IBM Bluemix – Eclipse Package Download – Neon release.
  5. I am also a fan of IoT these days. For fellow IoT fans, these links are good: Intro to Hardware Hacking on the Arduino — Julia H Grace and $10 DIY Wifi Smart Button | SimpleIOThings.
  6. Speaking of IoT, if you have been doing some work with Arduinos, you might be interested in the ESP8266. Some good info on it here ESP8266 Thing Hookup Guide – learn.sparkfun.com and a good thing to do with it, here: SimpleIOThings | Simple Do-It-Yourself Internet-of-Things Projects
  7. More good links related to software and application development work here Migrate an app from Heroku to Bluemix and here A Concise Introduction To Prolog, plus Building without an Ounce of Code – Part 2 – Apps Without Code Blog and this Turning a form element into JSON and submiting it via jQuery – Developer Drive
  8. Some interesting links pertaining to Minecraft: Can Minecraft teach kids how to code? – Safari Blog and Minecraft and Bluemix, Part 1: Running Minecraft servers within Docker.
  9. There’s lots of talk about AI these days, the  Economist explains why artificial intelligence is enjoying a renaissance
  10. If you are interesting in working in IT, you might like this: How to Get a Job In Deep Learning or this: An Unconventional Guide for Getting a Software Engineering Job — Julia H Grace
  11. Or maybe you want start a start-up. If so, check this out: A Free Course from Y Combinator Taught at Stanford | Open Culture
  12. Finally, here are just a number of interesting but mostly unrelated links:
    1. IBM Blockchain 101: Quick-start guide for developers
    2. Building three-tier architectures with security groups | AWS Blog
    3. Performance Tuning Apache and MySQL for Drupal
    4. How to secure an Ubuntu 16.04 LTS server 
    5. Clean Your System and Free Disk Space | BleachBit
    6. Use an iPad as a Raspberry Pi display — Kano OS – YouTube
    7. (Software iSCSI) Configuring SAN boot on Red Hat Enterprise Linux 5 or 6 series

 

A good article: Why I Am Not a Maker. With one comment by me.

If you hang around with or are involved in some way with IT people, you will come across individuals extolling the virtues of being a “Maker”. Making things (typically software or IT systems) is seen as a virtue, in some case one of the highest virtues, and the implication is that makers are virtuous people.

A well written critique of that is here: Why I Am Not a Maker – The Atlantic. If you consider yourself  a maker or aspire to be considered one, you should read it. A key point is this:

When tech culture only celebrates creation, it risks ignoring those who teach, criticize, and take care of others.

This is true: tech culture sometimes places little or no value on other activities, such as the ones that the article mentions.

My main criticism of the article is that it has a blind spot for the middle ground. I know plenty of creative people whom I consider makers that also take care of others, teach, manage, administer…you name it. Often time the things they make are superior to those of people who devote themselves to being makers.

Being a maker is a virtuous thing, for the most part. But so is teaching, providing care, managing, cleaning, coaching and many other positive activities. Find the thing you are good at and contribute positively in your own way.  If you can make some things along the way, all the better.

What you should know if you are planning to learn to code

If you are going to learn to code and you are planning to stick with it, then you owe it to yourself to read this: Why Learning to Code is So Damn Hard.

It’s well written, and it has some great graphs, including this one:

I think any area of learning where you get good initial training would look similar to this. I recommend you find some mentors to help get your through the desert of despair.

P.S. Yes, I realized they borrowed heavily from Gartner’s Hype Curve. 🙂

A return to Twitter (not the service, but the community)

After the frustration with the Twitter service for changes like this, I thought I would give up Twitter. However, Twitter is the sum of a number of parts: there is the service that Twitter provides, from the backend servers to the APIs to the user interfaces and client software you use;  and then there are the people that contribute to Twitter. Among those contributors are people I really enjoy socializing with whom I cannot connect with any other way. To give up all of Twitter means tossing out the baby, the bathwater and even the tub itself. That’s dumb. (I do dumb things often, but typically correct most of them in time. :))

To get around that, I decided to use my limited software skills and the APIs that Twitter provides to write my own Twitter client, in a way. It is a hack, but it is a good hack (for me). I am able to control what I see this way. Not only do I not have promoted tweets, etc., in my feed, but I am able to get rid of things like RTs from everyone, rather than having to turn of RTs one at a time. I’m also able to save all the tweets in a spreadsheet or some other format, so I can look at them when I am less busy, or decide on other filters I want to apply, etc. Later on I can write more filters so if a trending topic gets to be too much, I can just delete it or save it to a different file for later.

Now my Twitter experience is gone from poor to great (for me).  I have thrown out the dirty bath water, but kept the tub and the baby. This makes more sense, obviously.

Last but not least, I appreciate all the people who expressed concern over my leaving Twitter. It was very kind of you, and why I want to stick around, if I can.

 

Should everyone learn to code? And should they learn it from Code.org?

I am encouraged by organizations like code.org and the work they are doing to help kids (and adults) learn how to write code using an approach that is condusive to fast learning. You can see their work here: Learn | Code.org. A somewhat differing point of view is here: Thread: Why you should learn to code.  I say “somewhat” because while Winer agrees with the notion of more people coding, he disagrees with how this is being promoted by code.org.

I think there are lots of reasons to learn to code: it’s a creative activity, it helps you understand technology better, it can help you get ahead in life, and it can be fun. I don’t think everyone has to learn to code, just like everyone doesn’t have to learn to sing or draw or other creative tasks. People may be anxious about their kids being computer illerate, but that fear has been around since the early days of personal computers and it was always an overblown fear. Learn to code for the goodness it brings, not because you fear something if you don’t learn.