Tuesday 30 June 2015

JavaScript: deduping an array?

G'day:
I'm being a JavaScript dev at the moment, which is... interesting. My JS ain't bad, but I need to spend a lot of time with my nose in Google  / StackOverflow / MDN.

Here's something that I feel should be easier than I've made it:

Monday 29 June 2015

Useless ColdFusion community members

This:
"I liked all of them, so I decided not to comment."

No.

If you're any sort of CFML developer, you will go and raise feature requests, point out bugs, and generally get in with the swing of furthering your language.

CFML: apathy at work in the ColdFusion community

G'day:
The other day I knocked together an article "What I'd like to see in ColdFusion 2016 (redux, as is happens)", which lists a bunch of stuff I'd like to see in ColdFusion 2016. It was a bit of a speculative list, and just a way of getting people thinking about what they'd like to see in CFML, and perhaps go and actually participate in the future possibilities of their language.

I've cross-referenced each of the ideas I mention to a ticket (a new one, or an existing one if I could find one). Hoping people might go and have a vote or put their oar in or encourage more people to come up with their own ideas.

What I got instead of was 120 comments mostly revolving around how daft Acker Apple happens to be. I'm all for having this pointed out - especially as he seemed to revel in it - but there's more to ColdFusion 2016's possibilities than that, is there not?

Sunday 28 June 2015

PHP 7: three different ways of dealing with much the same error/exception

G'day:
My foray into how PHP "handles" erroring code continues. And continues down the same vein of "how PHP has made things difficult when they really ought to be straight forward".

Saturday 27 June 2015

CFML: Slack

G'day:

Ages ago I encouraged people to join us on the ##coldfusion IRC channel ("I… aaaah… see"). Thanks to the likes of Ryan, Dan and Sean, I was introduced to the new #cfml slack channel last night, which seems to be mostly like IRC, but given a C21st treatment to the UI & UX. So I think I'll probably migrate over there.

If you're a CFML dev of any stripe, get yerself over there. There's separate sub-channels for ColdFusion and Lucee (and FW/1, and a few dozen others now (I'm updating this in 2023 as the URL below has been updated)), and - trust me - it's the most expedient way of a) getting help with CFML issues; b) networking with other CFML community members. If yer a CFML dev you should be wanting to do both of those things.

[obsolete guidance deleted]

Update

Use this link: http://cfml-slack.net/.

[obsolete guidance deleted]

See you there.

Righto.

--
Adam

CFML: I did not realise one cannot nest threads in CFML

G'day:
This is peer-group pressure at work. On IRC, Sean mentioned that in CFML (ColdFusion, Railo, Lucee... I have to admit I didn't think to look at OpenBD), one cannot nest thread calls. I was really surprised by this for a coupla reason:
  1. I was sure I would have - at some point - tried to do this. Even by accident.
  2. I couldn't see a good reason why.
Not that I doubted Sean, but he sugggested I did some investigation and write it up. I'm en route to Galway right now (ie: as I type I'm flying over Ireland), and I've had enough time to finish my previous article ("PHP: getting PHP 5 and PHP 7 running side by side on the same machine (a better way)"), and write the code for this article. So here goes.

Friday 26 June 2015

Nice touch on Stack Overflow at the moment

G'day:
I just noticed this in their header:



And btw... good work today, United States.

--
Adam

PHP: getting PHP 5 and PHP 7 running side by side on the same machine (a better way)

G'day:
When starting to test PHP 7  I decided I did not want to sacrifice PHP 5, so wanted both running together. I horsed around getting PHP 7 running via the Apache module, and PHP 5 running via CGI. This is because Apache cannae run two different PHP modules at the same time. I documented my travails here: "Getting PHP 5.x & 7-dev running on Windows/Apache". As it turns out, there's a much easier option. Just run Apache twice...

Thursday 25 June 2015

PHP 7: new to alpha 2... Throwables now supported

G'day:
Exception handling has kinda been improved some more in PHP 7 alpha 2. Yesterday I looked at EngineExceptions ("http://blog.adamcameron.me/2015/06/php-7-php-starts-to-play-catch-up-with.html"), and part of that was a lamentation that PHP 7 had not implemented the idea of a Throwable which one could catch. Well: now they have.

PHP 7: alpha 2 breaks EngineExceptions (on purpose, as it turns out)

G'day:
I thought I was going mad... the code I wrote for yesterday's article ("PHP 7: PHP starts to play catch-up with error- / exception-handling") wasn't working today. Worried I was leading eveyrone up the garden path I revisited it, and finally worked out what the story is. This morning I "upgraded" PHP to PHP 7/alpha 2. And it broke the code.

PHP 7: null coalescing operator

G'day:
There's not much to say on this one, but I'll go through motions anyhow. First things first, I'm dead pleased they've gone for ?? rather than ?:, as I don't have to listen to people say "elvis operator" as I do in the CFML world. "Small things", I know.

Wednesday 24 June 2015

PHP 7: IIFEs supported

G'day:
I was unaware of this feature of PHP 7 until I accidentally discovered it whilst writing my previous article ("PHP 7: Three-way comparison operator (<=>)"). PHP 7 supports (Immediately-invoked function expressions).

PHP 7: Three-way comparison operator (<=>)

G'day:
Here's another new feature of PHP 7, there's not much to it, but it seems to work, and is almost sensibly implemented.

The three-way comparison operation (you can piss off if you think I'm going to call it a "spaceship operator") - <=> - is used when comparing two values. It returns <=-1, 0 or >=1 depending on whether the first operand is "less than", "equal to" or "greater than" the second operand.

For strings we already have strcmp(), but there's no expedient way of doing this sort of comparison with other data types.

Tuesday 23 June 2015

Epicaricacy

G'day:
This is a lazy-arse article - not least of all because I just point you back to one of my other articles from a few days ago - but in case you missed all this due to not following the comments on said article, the comments on "What I'd like to see in ColdFusion 12 (redux, as is happens)" are... well... something to behold as it all unfolds.

As Dan Skaggs said on IRC:

It's like a train wreck...I can't tear my self away from the page waiting for the "New Reply" message to pop up somewhere

Heh.

It starts slowly, but stick with it.

Anyway, yeah I'm a big meany for drawing attention to it. But hey... the headline warned you.

--
Adam

PHP 7: PHP starts to play catch-up with error- / exception-handling

G'day:
I'm not doing so well on the PHP 7 testing so far. CFML stuff keeps getting in the way.

I did start having a lot at one of the better improvements to PHP 7 the other day: improvements to exception handling. Exception handling in PHP has always been a bit "odd" (OK, I mean "shit") in my opinion. But it's slightly de-shit-ified itself in PHP 7.

Saturday 20 June 2015

What I'd like to see in ColdFusion 2016 (redux, as is happens)

G'day:
After the news of ColdFuson 2016's pre release getting underway soon presented itself ("ColdFusion 2016 is coming..."), I decided I'd work out what I'd like to see in CF2016, and knock together an article here.

In researching this this morning, I realise I've already done this! Here's the original: "ColdFusion 2016". Not to be deterred or put off by repeating myself, I'm gonna go ahead and do a new article as well, and have a look at what I thought before and whether it's changed.

Wednesday 17 June 2015

GitHub reorganisation

G'day:
This is just a note to advise I've moved all my files about in GitHub, so none of the links to the source code examples on the blog will be working any more.

Lemme know if there's one you need fixed, and I'll sort it out, and as I update old articles I'll also fix the links if I think about it.

But other than that I'm gonna consider it all a case of "Schrödinger's links" (or perhaps "lynx", in this context ;-)

--
Adam

ColdFusion 2016 is coming...

G'day:
Just repeating news I heard from elsewhere. The ColdFusion 2016 pre-release is going to be opened up shortly. This is interesting stuff! There's a blog article soliciting participation: "Pre-release for the next version of ColdFusion". Currently whilst they mention a link, it's not actually there. I have pointed this out, so am sure it'll be fixed shortly.

Update:

Here's a direct link, as posted on Twitter by Rakshith: https://www.surveymonkey.com/r/LPS7YYP

Do sign-up. Adobe can use all the community voices they can muster to help them with the direction of CFML.

I'll be putting my name down, but I didn't last long in the pre-release last time due to disillusionment with their focus, which was all about <cfclient> in the earlier stages. This was a mistake on my part as they did then go on to do some interesting stuff later on.

I do hope Adobe don't have another <cfclient>-esque "feature" up their sleeves this time. Time will tell.

I also hope they are more open and less "NDA hush hush" about it this time. The industry has moved on from that sort of approach. They'd be much better served by getting the thing out in the open and getting as many bums on seats looking at it as possible.

Anyway... get over there and put yer name down.

Righto.

--
Adam

Lucee: Kai raises some very good points re .lucee and LAS's approach to it

G'day:
[takes a deep breath]. OK, I'm going to try to not be all feisty in at least this article.

Kai Koenig has put a lot of effort into seeking clarification about the .lucee thing, how it should be approach from both LAS's and the community's perspective, and seeking some clarification from LAS as to how they see the development of .lucee as a going concern. The general thrust is one about transparency on the part of LAS, and to encourage them to adopt a more inclusive approach to how they conduct the .lucee side of their work.

It's worth reading if you're interested in .lucee (to any degree), and there's already some feedback from Geoff.

Here it is: "The (Missing) Lucee Language spec".

Kai maintains an over-all neutral- to positive-tone, which is an asset. And something I personally struggle to do on these topics. Good work Kai.

He's asked for some input / follow-up from the community in a couple of areas, so it'd be really good if community members could do so.

Me? No, I'm going to leave this thread alone. I think everyone knows my opinion on the points he raises. FWIW, there's nothing I disagree with in what Kai says, and he really has put it forward thoroughly and clearly.

Go have a read.

Cheers.

--
Adam

Monday 15 June 2015

CFML expectation management: when are empty elements respected?

G'day:
Couldn't fit this into 140 chars, so it's not gonna be a Twitter message, but instead a short article here. It turns out I don't quite get "lists" in CFML. Or... I'm just being daft. You decide. And tell me.

CFML: spending pointless time looking and exceptions and errors and throwables

G'day:
This kinda got out of control. I was meaning to be writing an article about PHP7's improvements to PHP's error handling, but whilst writing some comparative CFML code I got bogged-down looking at difference in behaviour between different types of throwables, and how ColdFusion and Lucee handle them differently. I ended up with a fair bit of code, and not much of it would be needed for the PHP article, so I've decided to write it up separately.

Be warned, I've seen ditch water less dull than this lot.

Saturday 13 June 2015

Lucee (/CFML?): approach Lucee language decisions "properly"

G'day:
I'm having a PHP day today... testing PHP 7 alpha. This has lead me to be reviewing some of the RFCs (well: just one) for PHP 7 to clarify some behaviour I'm seeing.

For language features, PHP has docs like this: "PHP RFC: Exceptions in the engine".

I'm thinking about this situation particularly in the context of Lucee: Adobe's a waste of time when it comes to community participation in language decisions (eg: <cfclient>, which was roundly and without exception derided by the community when it was floated as an idea,  but still: there it is).

PHP: getting PHP7 alpha running on Windows 8.1

G'day:
I'm mostly writing this in case anyone else has the issues I had with this. Getting PHP 7 alpha (released yesterday: "PHP 7.0.0 Alpha 1 Released") was not as straight forward as getting the dev releases of PHP 7 working. Especially for someone like me who's not really that au fait with PHP.

Friday 12 June 2015

CFML/Lucee/Railo: Geoff Bowers does a good job of presenting Lucee's position on things

G'day:
Kai and Mark (with guest Geoff Bowers) have released a fascinating 2DDU today (depending on which timezone you're in). 'ere 'tis: "Episode 38 - Lucee, the fork and open-source licenses".

If you're interested in the whole Railo v Lucee thing ("Railo speaks at long last", "A message from the majority shareholder of The Railo Company", and all manner of other conversations about the place), or have concerns - I fall into the latter group - Geoff does a very good job of presenting Lucee's situation. It's certainly restored a lot of my confidence in the situation (from Lucee's perspective), which given how cynical I am, represents a pretty good effort on his part.

Nice one.

Anyway, go listen to it.

--
Adam


Wednesday 10 June 2015

CFML: does it have a USP any more?

G'day:
I initially wrote this on the Lucee Google Group, but it probably better belongs here. There has been discussion about the number of CFML devs (and by extension, Railo/Lucee devs), and what can be done to reach out to more people, and basically what tactics could be employed to turn more developers onto Lucee. Be those converts from the existing CFML base, or enticing new developers.

The whole thread is worth a read, btw. Even if you don't give a rat's arse about Lucee.

This is another one of those "CFML is dead/in decline/in maintenance mode/irrelevant" observations by the way. Feel free to disagree. Obviously it's why I write these things ;-)

PHP: more dumping in PHP... via Twig this time

G'day:
A week or so ago I was messing around with the dBug class that Kwaku Otchere (according to the author info in the class) came up with a coupla years ago: "PHP: I find the PHP equivalent of <cfdump> on GitHub shortly after I package it myself". That was an interetsing exercise (a mostly pointless one in the end, but hey). But for it to be useful for us at work, we need to be able to dump stuff from a Twig file as well as from a PHP file. Now I know one can extend Twig and add... things to it... but other than knowing where the docs are, I didn't know anything further.

Saturday 6 June 2015

Not a Lucee bug, but a ColdFusion one. And I learn more about Java

G'day:
OK so remember that glitch I had in my earlier blog article: "CFML: learning something new about directoryList()":


I finally managed to work out WTF is going on. And despite appearances it actually seems like a bug in ColdFusion, not a bug in Lucee. But I'm unsure.

But there was certainly a bug in my recollection of how Java works, which did not help.

CFML: learning something new about directoryList()

G'day:
I need to shuffle some files around in my GitHub repos, as they're getting a bit of a mess. I decided to knock together a script to separate files out by file type, so I can rearrange my "scratch" repo which pretty much contains all my shite in it, into separate repos for CFML, PHP, etc.

I should be doing this with PHP to give myself some practice, but the thought of it made my will to live start ebbing away, so I decided to stick to CFML.

Thursday 4 June 2015

Railo: one month later and...?

G'day:
Just a quick and vapid observation that all this - "Railo speaks at long last" / "A message from the majority shareholder of The Railo Company" - happened a month ago today. The following day I posted a number of questions for Railo, by way of requesting clarification: "Questions for Railo".

This is just a quick note that I have yet to hear back from them, although I am still trying. I've also been keeping an eye on the Railo Google Group, and there's nothing there either.

Anyway, I just figured that I should mention I am still trying to rattle cages. I am bloody interested to hear if there will be any phoenix-like activity from the Railo project.

Needless to say if/when I do hear anything, or find any further info, I'll share it.

Righto.

--
Adam

Wednesday 3 June 2015

PHP: I find the PHP equivalent of <cfdump> on GitHub shortly after I package it myself

G'day:
Sometimes I don't know why I bother. Oh well: at least I know more about Composer now. That's useful.

Forever, there's been a PHP implementation of <cfdump>, over at http://dbug.ospinto.com/. As good as that is, I didn't want to "install" it via downloading the file and sticking it into our codebase, I decided the better approach would be to work out how to package it up and install it via composer. That's why I was horsing around with Composer for the last coupla days ("PHP: trying (but not succeeding) to create my own Github-based Composer Package" and "PHP: Fixed! My colleague sorts that Composer issue out for me").

PHP: Fixed! My colleague sorts that Composer issue out for me

G'day:
This relates back to yesterday's article: "PHP: trying (but not succeeding) to create my own Github-based Composer Package". I circulated the URL to the other bods on the team, and our latest team addition Cisco had a google about (or just used his intuition, I dunno), and came up with an answer.

Tuesday 2 June 2015

PHP: trying (but not succeeding) to create my own Github-based Composer Package

G'day:
So here's one of those articles in which I document trying to do something, but failing miserably. Enjoy.

Update:

This has been sorted out. See the follow-up article: "PHP: Fixed! My colleague sorts that Composer issue out for me".