Information related to computer programming

To be a programmer is to develop a carefully managed relationship with error

“To be a programmer is to develop a carefully managed relationship with error. There’s no getting around it. You either make your accommodations with failure, or the work will become intolerable.”

~ Ellen Ullman (via this tweet)

This quote makes me think of all those years of exception-handling with Java. I never knew there was a better way to handle errors, so I developed a strategy of letting my exceptions bubble up to the controller level (as in model/view/controller), where I would deal with them. These days I know I can use Option/Some/None in Scala, as well as Try/Success/Failure.

Programming is like this amazing puzzle game alvin November 7, 2019 - 3:25pm

“Programming is like this amazing puzzle game, where the puzzles are created by your own stupidity.” It feels like that sometimes. (Image from Rich Rogers on Twitter. Quote attributed to BradOFarrell.)

Treat your code like poetry and take it to the edge of the bare minimum alvin November 6, 2019 - 2:12pm

“Treat your code like poetry and take it to the edge of the bare minimum.”

“I have learned magnitudes more from code I have maintained over code I have written from scratch.”
~ Viktor Klang, in this tweet

I have no idea who or what ILYO is, but I like the “poetry” part, and dislike the “bare minimum” part. As the second quote implies, code should be written so you can read it a year or two from now.

Programing: failure, success; repeat alvin September 15, 2019 - 11:05am

Programming is an interesting profession. You fail dozens or hundreds of times a day, then take a moment to celebrate a little victory. Then you move on to your next failure/success.

Flutter BLoC Pattern for Dummies Like Me alvin September 3, 2019 - 3:47pm

“Design patterns are a surefire way to make your projects scalable, maintainable and optimised. At Google I/O 2018, Google introduced the BLoC pattern. It took a bit of time for me to understand the concept totally and to be able to actually use it in one of my projects. To help my fellow developers out, I detailed below my process of integrating BLoCs in the applications that I develop. I hope sharing this can help other developers understand the pattern easily.”

Yesterday's regex - Was I drunk, or a genius? alvin September 3, 2019 - 7:52am

Yesterday’s regex - Was I drunk, or a genius? From Geek & Poke’s cartoons.

A Flutter/Dart AlertDialog example alvin August 28, 2019 - 5:43pm

As a brief note to self, here’s an example of how to create a popup dialog (AlertDialog) using Dart and Flutter:

Programming languages are how programmers express and communicate ideas alvin August 13, 2019 - 3:16pm

“In reality, programming languages are how programmers express and communicate ideas — and the audience for those ideas is other programmers, not computers. The reason: the computer can take care of itself, but programmers are always working with other programmers, and poorly communicated ideas can cause expensive flops.”

~ Guido van Rossum, in this 2016 article

How to compile with TypeScript and run with Node.js alvin July 8, 2019 - 4:41pm

As a brief note to self, you compile a TypeScript source code file with the tsc command:

tsc Foo.ts

Depending on what you’re doing, you can also run the resulting JavaScript file from the command line with this node command:

tsc Foo.ts && node Foo.js

That command can be read as, “Compile the TypeScript file and then if that compiles successfully, run the resulting JavaScript file.” Note the ts and js extensions on those files.

Such a disappointing feeling when a book is a letdown alvin July 8, 2019 - 4:16pm

I just spent 45 minutes reading a new book about a programming language I was excited to learn, then slammed it shut and said, “Poorly organized, too many words, not enough code.”

That’s always such a disappointing feeling when you have that initial excitement about a programming language (or technology), and then a book is such a letdown. (I really hope people don’t view my books that way.)