Because your threads are blocking my performance.

Spools of multi-colored thread
Spools of multi-colored thread
Image by Vesna Harni from Pixabay

Non-Blocking I/O has been around for a while. Different languages implement it differently, but all provide a way to reduce the thread count while seeming to allow full concurrency. JavaScript has been doing it from the start; with only one thread, you better not be the coder that pushes a blocking call into production.

While reactive Java is gaining some traction, most Java coders I know still live in a multi-threaded frame of mind. Why? Threads are a relatively easy concept to grasp. Reactive Java requires us to rethink a lot of how we learned to code. …


A functional implementation of the Bakhshali method of approximating square roots

Image for post
Image for post
Bakhshali Manuscript. National Geographic, Public domain, via Wikimedia Commons

In a previous article, Rethinking Structured Programming, I talked about using Streams and Reactive functional programming in Java to act as the control structures in structured programming. I described one problem that I thought couldn’t currently be solved with the features of Streams or Fluxes: if the output of a function was the input of that same function iteratively. This describes a special type of recursion — tail-recursion — that can be changed into a loop. But in all of my examples, the output of one stage was always the input of the next stage. …


How not to get into trouble

Computer monitors with a fancy tech background
Computer monitors with a fancy tech background
Image by Gerd Altmann from Pixabay

It finally happened, my free trial at Google Cloud ran out so all my services are down. I’m in no rush to get them back up, they’re all just demonstrations that I use when I write articles. But I’d like to have someplace to host them so the front-ends that I have on Netlify have some data. Currently, my wine and cheese pairing app has no data so you get this sad screen:


Why the software world is in such a mess

Some kind of crazy penguin network
Some kind of crazy penguin network
Photo by Jesse Chan on Unsplash

Remember that time you were about to hit the Save button, and everything froze. Your mouse cursor wouldn’t move. Three hours of work, lost, with no explanation. Odds are it was a man that wrote the code that caused your computer to hang. Our computing life is rife with applications that crash, behave oddly, squirrel away necessary features in a maze of menus, and dish out error messages that require a degree in cryptology to decipher.

Who can we blame for this terrible situation? Men, of course. They make up the majority of software developers. If we complain, they say we should have saved more often, or we’re lucky we have the application at all. The most common solution offered is to turn your computer off and then on again. …


And so are you

vintage calculator
vintage calculator
Image by Andrew Martin from Pixabay

I hope you bought bitcoin several decades ago and you are independently wealthy because the technology stack you use is obsolete and you’ll soon find yourself with the COBOL and IBM360 people side-lining as Uber Drivers. Your style of programming went out of fashion weeks ago, and your services will no longer be required once the CTO comes back from his extended golf tour and discovers that you haven’t kept up to date.

If you are kept on, you should certainly expect to be confined to the first-floor lunchroom. Your card key will no longer get you access to the higher floor lunchrooms with the beer on tap and free Skittles in the hamster feeders. …


Stock market analysis with Jupyter running on Kubernetes

Image for post
Image for post

Previously, I wrote about How to Get Jupyter in the Cloud. I found another way of using a cloud service with Jupyter. Puzl provides a powerful Kubernetes based approach to develop, deploy, and scale up software, which performs heavy calculations on CPU or GPU. It’s a pay as you use service with no free-tier, but it does only charge for when your pods are running. …


The evolution of programming

The Thinker by Rodin
The Thinker by Rodin
Image by Johnnie Shannon from Pixabay

In my recent article, All Loops are a Code Smell, I asserted that the normal forms of looping, for, while, etc, are a low-level coding construct to be avoided. While the overall response to this article was good, there were some very noisy objections by people that obviously weren’t buying it. So I thought I would spend some more time going over my reasoning.

Let me start with the idea of Structured Programming. The early thoughts on Structured Programming were started in the late 1950s. Edsger W. Dijkstra wrote an open letter in 1968 “Go To Statement Considered Harmful” in which he implored programmers to abandon goto statements in favor of more controlled application routing such as if and while statements and separate subroutines. Donald Knuth wrote a rebuttal in 1974 “Structured Programming with go to Statements.” But it was mainly about optimizing every CPU cycle and maintaining ‘Provability’, and high-level programmers should be delaying optimization until shown to be needed. …


Setting up WordPress locally before deploying it

Picture of a blog post screen
Picture of a blog post screen
Image by Werner Moser from Pixabay

There are a lot of options for WordPress hosting out there. Many are single-click options where you enter a few values, and your site is up and running. But do you know what’s going on behind the scenes? I’ve never liked doing things the easy way — I like knowing what’s going on, even if it means avoiding the single-click solutions.

I’d also like to have a copy of WordPress running locally so I can try different plugins and themes but still get back to some sane starting point very quickly. But I don’t want to start installing a lot of software on my laptop. For those of you familiar with my writing, I’m sure you can tell what I’m getting at. …


The death of for, while, and their ilk.

Image for post
Image for post
Image by Christopher Kuszajewski from Pixabay

Loops are a fundamental part of programming. We need to do something for each item in a list. We need to read input until input is exhausted. We need to put n number of boxes on the screen. But every time I see a loop being added to code in a PR, my eyebrows go up. Now I have to examine the code closely to ensure the loop will always terminate. Sometimes it’s very easy to tell, but I’d just as soon not have to make that determination. I want to see all loops disappear into some well-tested library. …


Thirteen things every novice developer should be doing

Image for post
Image for post
Photo by Brooke Cagle on Unsplash

Since re-joining Twitter and following a lot of new developers, I see something that I’d like to comment on without commenting on everyone’s posts. I see a lot of novice developers solving sophisticated programming problems with code, and some getting frustrated to the point of wanting to give up.

So I want to point out that since I’ve been a developer, the number of times I’ve had to code a balanced tree by hand is pretty much zero. Perhaps I did back in the early days of my career when I was programming in C, and the standard library was just a thin wrapper over the operating system calls. …

About

Randal Kamradt Sr

Software dev for thirty years still keeping on top of the latest tech trends. I write about the learning process. https://rkamradt.github.io/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store