All-in-all, I am a big proponent of the errors-as-values approach to error handling in Go. I definitely agree with the general wisdom of handling errors when and where they occur, and not delegating them using exceptions. So this post is not about how many people find needed to handle errors through code an annoyance. To …
How to explicitly declare that a struct implements an interface in Go
One of the things I love about Go and find to be a strong supporter of serendipitous interface standardization is Go’s implicitly declared interfaces. However, there are times you really, really want to explicitly declare an interface, such as when you have a larger interface and you want your IDE and/or the compiler to tell …
Continue reading “How to explicitly declare that a struct implements an interface in Go”
In defense of “Syntactic Sugar”
One of my biggest career pet peeves as a software developer is when I see other developers derisively write “Well, that is just syntactic sugar“ in response to a proposal for improving a programming language. So today I want to write in defense of this often maligned underdog, and explain why syntactic sugar not only …
What is Software Engineering?
“Software engineering is what happens to programming when you add time, and other programmers.” — @_rsc Tweeted by @davecheney
How to specify a zeroed UUID in MySQL
Photo by Chris Barbalis on Unsplash Working on a recent project that dealt with data synchronization across disparate systems, I realized I could not use the oh-so-easy INT for primary keys. Instead I chose to use the emerging best practice of employing UUIDs for distributed databases. However, the library functions in Go are not friendly …
PHP delegation vs. GoLang type embedding
PHP implements composition (vs. inheritance) of object class properties and methods to other classes using delegation. Go on the other hand implements composition with type embedding. Read this post to learn about the differences and to appreciate the benefits of Go’s approach compared to that of PHP.
Proposal: Contracts in Go (Not Generics)
Photo by Cytonn Photography on Unsplash #Update When I wrote this I did not remember that the draft design for Go2 generics chose to use the name “Contracts” for a new language feature to provide a Go-idiomatic response to generics. Still, I stand by my use of the name contracts for this proposal as I …
GoLang Strict Typing and Interface Slices
Photo by Louise Lyshøj on Unsplash This is a GoLang Experience Report. …but you cannot define the rows parameter as type []RowInserter because []interface{} won’t match it, even though RowInserter is itself an interface. Background I am relatively new to programming Go, but I have been developing software professionally in a variety of programming languages …
Continue reading “GoLang Strict Typing and Interface Slices”
My interests have evolved over time. Thus so should my blogging.
My previous blogs can be found at HardcoreWP.com and MikeSchinkel.com. I plan to merge them all into one at some point. But not today.
Practical Object-Oriented Programming for WordPress Developers: A Tutorial Series
Goals of this Tutorial Welcome to this ongoing series whose goal is to teach Object Oriented Programming to WordPress developers. This series will teach you in a unique manner compared to traditional tutorials on OOP and based on my several decades of instructional experience. Using this approach it I believe it will be easier for …
Continue reading “Practical Object-Oriented Programming for WordPress Developers: A Tutorial Series”