@david_whitney@mastodon.social
@david_whitney@mastodon.social avatar

david_whitney

@david_whitney@mastodon.social

Software Consultant. Bestselling Author. Loves rum, alt culture, games & metal. C#, Typescript, OSS, Kotlin... MVP Dev Technologies

This profile is from a federated server and may be incomplete. Browse more on the original instance.

david_whitney, to random
@david_whitney@mastodon.social avatar

I wonder if the root of all problems in software is our general inability to comprehend size and scale.

Everything from bad estimates, to premature optimisation, premature generalisation, poor abstraction and factoring, misunderstanding total cost of ownership, right sizing designs, the failure of microservices - it's failure to comprehend size.

david_whitney, to random
@david_whitney@mastodon.social avatar

Learn more than one programming language. It's the best thing you'll ever do.

Learn it enough to the point you prefer some of its idioms to your natural tongue.

It'll expand your worldview on software development.

david_whitney, to random
@david_whitney@mastodon.social avatar

AAA Pattern Good!

Writing //Arrange //Act //Assert in EVERY. SINGLE. TEST?

F-Tier.

david_whitney, to random
@david_whitney@mastodon.social avatar

I sound like a fanboy (I am, if has one fan, that fan is me), but having it in @JetBrainsRider right as I'm doing some particularly tricky C# is a godsend.

The new RDI stuff reminds me of some of @wallabyjs debugging features too.

Continuous testing 4eva.

david_whitney, to random
@david_whitney@mastodon.social avatar

The forever battle between "who the fuck wrote this" and "fuck, someone wrote this" is real.

david_whitney, to random
@david_whitney@mastodon.social avatar

Somebody criticising your code is not the same as them criticising you as a person.

Mistaking the two causes strife in many ways.

But it's a balance, code doesn't have feelings, but remember it's somebody's work.

Multiple things can be true at the same time.

david_whitney, to random
@david_whitney@mastodon.social avatar

A thought occured to me in the after-talk chats yesterday that I believe to be universally true, but often goes unacknowledged:

You do not have to solve the totality of a problem to make a meaningful difference to peoples lives. Doing something is mostly better than nothing.

david_whitney, to random
@david_whitney@mastodon.social avatar

It finally happened. In the game of getting London Taxis, the same cab accepted both my Uber request and Bolt request at the same time.

Don't hate the player and all that.

david_whitney,
@david_whitney@mastodon.social avatar

@sldrant it's just the hellscape of London taxis, drivers trying to find the best rate / surge, customers trying to find the lowest / fastest response time.

Everyone just orders on everything and cancels the ones furtherst or slower. Funny to see it play out like that.

I think he technically made a bonus £1 off me, ha.

Edent, to random
@Edent@mastodon.social avatar

Are there any games where you play the antagonist of an established game?

For example, is there version of Donkey Kong where you throw barrels at Mario?

david_whitney,
@david_whitney@mastodon.social avatar

@Edent metal gear solid 3

david_whitney, to random
@david_whitney@mastodon.social avatar

I feel like I'm losing my mind reading the news re: the "WhatsApp" enquiry.

Could they please have a single solitary competent vaguely technical person over the age of sixteen sit in that room.

david_whitney, to random
@david_whitney@mastodon.social avatar

Everyone in the UK simultaneously thinks the same joke

https://www.bbc.co.uk/news/health-67545375

david_whitney,
@david_whitney@mastodon.social avatar
david_whitney, to random
@david_whitney@mastodon.social avatar

If @Spotify would stop pushing Joe fucking Rogan into my home feed, that'd be great.

I'm here for algo playlists, not I'm-14-and-this-is-deep.

david_whitney, to random
@david_whitney@mastodon.social avatar

Never underestimate how important it is to develop your communication and storytelling skills as a programmer.

The single greatest transferable career skill that also makes your code better.

david_whitney, to random
@david_whitney@mastodon.social avatar

The continued presence of religion in society is humanities biggest failure.

All this death for all these years over literally nothing.

david_whitney, to random
@david_whitney@mastodon.social avatar

Someone had to write this class because of prescriptive architectural "guidance".

david_whitney, to random
@david_whitney@mastodon.social avatar

And I say again, for the seven hundredth time, with my full throat, fuck XML-DOC comments that just say the same thing as the damn code.

david_whitney, to random
@david_whitney@mastodon.social avatar

This is a fascinating design smell.

Let's dig a little - here we have an "EntitlementsProvider" that applies rules from that set of dependencies, in an order of precedence.

It's ugly, but fine, I get it, even if I'd never call it a "Provider" (what does that even mean anyway)..

david_whitney,
@david_whitney@mastodon.social avatar

Again, ha! They're not really, they're different DTOs representing a dictionary.

image/png

david_whitney,
@david_whitney@mastodon.social avatar

So what we have is an explosion of interfaces (that could all be the same) and response objects (which each return an object which contains a subset of the same data) because....

Somebody failed to create a request object for the way these dependencies are called. Got it.

david_whitney,
@david_whitney@mastodon.social avatar

This is a wonderful example of a leaky abstraction causing snowballing complexity in a tiny corner of a codebase.

There's nothing wrong with having different data sources for entitlements, and nothing wrong with layering / applying them on top of each other...

david_whitney,
@david_whitney@mastodon.social avatar

But to succumb to interface bloat and not use interfaces for the thing they're really meant for (provide a single API to query disparate sources) we've actually used the language features to harm ourselves, rather than help.

david_whitney,
@david_whitney@mastodon.social avatar

Luckily, folding all those things under the same interface and creating a context object that each implementation can evaluate is a simple salve for this problem.

david_whitney,
@david_whitney@mastodon.social avatar

How did this jump off the page at me?

Any code with test setup that looks like this has a broken design somehow.

In this case "why are you testing all these sources rather than the mechanism of loading entitlements".

Refactoring Adventures with David 🤣

david_whitney,
@david_whitney@mastodon.social avatar

TL;DR - If you're gonna load data from different places, do you either:

A) Make a single interface, implement it multiple times

OR

B) Make many interfaces, and objects, that contain the same data, and treat them all distinctly

I'll let you guess which one makes me angry ;)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • kavyap
  • DreamBathrooms
  • thenastyranch
  • ngwrru68w68
  • modclub
  • magazineikmin
  • Youngstown
  • osvaldo12
  • rosin
  • slotface
  • khanakhh
  • mdbf
  • GTA5RPClips
  • provamag3
  • tacticalgear
  • InstantRegret
  • cubers
  • tester
  • ethstaker
  • everett
  • Durango
  • cisconetworking
  • normalnudes
  • anitta
  • Leos
  • megavids
  • lostlight
  • All magazines