When using an IDisposable object in C# you have some pretty clear expectations on when that object is disposed. While the same thing is technically true with defer in Go, I've seen a lot of people misunderstand when exactly the deferred method is called.
Stuff I wished I've found in some blog (and sometimes did).
Rant over a sloppy scammer
Occasionally I come across some really good scam attempts. But most of the time I'm surprised at how bad scams are presented. Let's look at a recent scam I received.
Testing a periodic worker
I came across somebody that was asking about how to test their code. They had a function that would do certain work at short intervals and then some other work after a longer period of time. They provided a simplified version of the code and it looked something like this. They had coverage for the short period work (I guess functions foo and/or bar in the simplified example had some side effect they could test for.
Using soft limits to prevent abuse with good user experience
When you develop a service you will probably run into a situation where you want to put in some arbitrary large limit on something to prevent bad behaving clients from using too much of your resources. This can be a max length of the URI, max length of each request header, max size of a request and so on. What we tend to do is often to return some kind of error when this happens and expect the client to fix their request if it is legitimate. But what if it is a legitimate request - just something you didn't expect to be valid? Or what if there is a bug in the client, but the user have no way of fixing the client but rely heavily on your service? Do you really want to completely break your users in these cases?
OKR mistakes and how to avoid them
Using OKRs is popular at a lot of companies and has become a golden standard for a lot of companies. But just like how companies start their agile transformation because they heard it was good but without understanding what it is really about. I've seen the same thing happen where OKRs are misunderstood.
Go for C# developers: LINQ
When I worked in C# I loved LINQ. I also probably used it more than I should have. I have recently looked into some options to bring LINQ to a Go project so let me share some observations.
TL;DR: I don't think we'll see much use of LINQ in idiomatic Go. Nor should we desire it.
Go for C# developers: Unicode strings
There are a few gotchas with strings in Go if they contain unicode characters.
Go for C# developers: Using keywords as identifiers
It doesn't happen very often but sometimes there is a variable name that makes sense that happens to be a reserved word in the language. In C# when this happens you prefix it with "@" so you get @new as a variable name. Not quite as clean with the prefix, but clear what is going on. Go takes a different approach.
What is the purpose of a test name?
The social standup
Reading about a new idea for remote standups in the Thoughtworks Tech Radar reminded me of a few similar experiences I've had.