Quantcast
Channel: Adam Cameron's Dev Blog
Browsing all 1333 articles
Browse latest View live
↧

Code puzzle: find any match from an array of regex patterns

G'day:I'm being slightly cheeky as I'm hijacking someone else's question / puzzle from the CFML Slack channel that we were discussing last night. Don't worry, that'll be the last mention of CFML in...

View Article


Image may be NSFW.
Clik here to view.

Help explain closure to the Adobe ColdFusion Team

G'day:OK, this is a CFML-centric article. But it's also a call to provide code analogies in different languages to a CFML example, to show the ColdFusion Team they dunno what they're on about.Here's...

View Article


I actively consider what I think ought to go into a controller

G'day:This is one of these ones where I state the obvious (probably), and expose myself as a fraud in that it's taken me this long to reach this conclusion. I can only take solace in that I'm clearly...

View Article

Image may be NSFW.
Clik here to view.

A cyclomatic complexity challenge

G'day:This one came up briefly in a Friday afternoon messenger conversation between meself and my colleague in Dublin, Carlos. He's doing some code maintenance, and come across a function in one of our...

View Article

Image may be NSFW.
Clik here to view.

CFML: Lucee 13 v 414 v 6 ColdFusion. We have a "winner"

G'day:Argh. CFML again. I'm doing this because I was a bit of a meanie to Brad on the CFML Slack Channel, and promised I'd try to play nice with one of our current exercises set out by Ryan:Todays...

View Article


PHPUnit: using a mocked-method call log to track its activity

G'day:This is just a quick PHPUnit one, inspired by a trick my team lead suggested to me. I think it's quite handy and works around what seems to be a shortcoming of how PHPUnit mocks stuff. I'm sure...

View Article

@dac_dev Twitter account

G'day:Yes, this thing is still alive.This morning I indicated on Twitter I was discontinuing my usage of the @dac_dev Twitter account. I'll just be using my @adam_cameron one from now on.@NXRK made...

View Article

Image may be NSFW.
Clik here to view.

PHP: A function that returns two different things

G'day:I'm gonna plagiarise one of me own answers to a Stack Overflow question here, as I think it's good generic advice.The question was "PHP 7: Multiple function return types". The subject line sums...

View Article


Image may be NSFW.
Clik here to view.

Yeah, you do want 100% test coverage

G'day:I've read a number of blog articles recently that have been eshewing 100% test coverage. The rationale being that there's little difference between 90% and 100%, and that that last 10% can be...

View Article


Mishmash: code review as a learning exercise, loops vs higher-order-functions...

G'day:There's a few things going on in my head here, and none individually are worthy of an article, but perhaps if I dwell on a bunch of stuff something might shake out. I have no idea as I have not...

View Article

PHP: misuse of nullable arguments

G'day:PHP 7.1 added nullable types to the PHP language. Here's the RFC. In short, one can specify that a return type or an argument type will accept null instead of an object (or primitive) of the...

View Article

PHP: array_map has a dumb implementation

G'day:This cropped up a few weeks back, but I've had no motivation to write anything recently so I've sat on it for a bit. It came back to bite me again the other day and my motivation seems to be...

View Article

That array_map quandary implemented in other languages

G'day:A coupla days ago I bleated about array_map [having] a dumb implementation. I had what I thought was an obvious application for array_map in PHP, but it couldn't really accommodate me due to...

View Article


PHP: perpetual misuse of array type declarations

G'day:This has been irking me enough recently to cause me to dust off this old blog.For a while PHP has had limited argument type checking on function arguments, and this was improved in PHP 7. The...

View Article

In defence of public properties

G'day:Recently I was re-writing one of our cron job scripts. It's the sort of thing that runs at 2am, reads some stuff from the DB, analyses it, and emails some crap to interested parties. We usually...

View Article


PHP: Expectation management with Symfony Validator validation

G'day:I was checking out of of our web services the other day, replicating a bug I was fixing, and found the need to guess at what the body content needed to be for a POST I was doing. Our validation...

View Article

I need to backtrack on some TDD guidance. I think

G'day:Yes, this thing still exists.Possibly foolishly my employer has made me tech lead of one of our software applications, and part of that is to lead from the front when it comes to maintaining code...

View Article


PHPUnit: trying to be clever with data providers and failing

G'day:Yesterday we had a seemingly strange situation with a test one of my colleagues had written. It was behaving as if PHPUnit's exactly matcher was not working. The developer concerned was in the...

View Article

Brian

G'day:So this really sux.For the bulk of the last decade I've been working alongside Brian Sadler. We first worked with each other when he joined hostelbookers.com when I'd been there for a coupla...

View Article

Aaaaah... *Me*

G'dayOK to continue this occasional series of commenting on ppl who have impacted my tenure at work, as they leave. Time to do another one.Adam Cameron.What a prick. Always nagging about doing TDD,...

View Article
Browsing all 1333 articles
Browse latest View live