Skip to main content
Ben Nadel at CFinNC 2009 (Raleigh, North Carolina) with: Daria Norris
Ben Nadel at CFinNC 2009 (Raleigh, North Carolina) with: Daria Norris@cfGothChic )

Recent Activity

Recent Heroes of the BenNadel.com Community

Recent Comments

Ben Nadel replied to a post Considering A Stale-While-Revalidate Pattern To Caching In ColdFusion

@All, After this post, I started to think about shared access of variables in native ColdFusion data types; and, I started to wonder if my mental model for iteration over shared data structures is out of date. As such, I wanted to do some experimentation in ACF + Lucee CFML: https://www.bennadel.com... read more

Ben Nadel replied to a post Considering A Stale-While-Revalidate Pattern To Caching In ColdFusion

@Charlie, So, from a "page level" caching perspective, it was actually the HTTP Content-Control header that got me thinking about this in the first place. There is a stale-while-validate header value that will allow the browser (as I understand it) to do this naturally. ie, to use the locally-cached... read more

Ian Turton replied to a post It's OK To Be Super Explicit In Your Data Access Method Names

@Ben, Yes! ...and the reason you're not getting it from the docs (IMO) is they've gone straight to a slightly obfuscatory, non-obvious example. Whereas way back when I found VALUES() I came to it from a 'there must be a way for me to stop repeating all these params cos it's dangerous/tedious', so co... read more

Ben Nadel replied to a post It's OK To Be Super Explicit In Your Data Access Method Names

@Ian, Ooooooh! I see what you're saying now - the VALUES() function is for the value I was going to insert, not the value that was already in the row. That's the part that wasn't clicking for me. For whatever reason, my brain just was not getting that from the documentation.... read more

Ian Turton replied to a post It's OK To Be Super Explicit In Your Data Access Method Names

@Ben, I reckon the disconnect here is you think I'm trying to 'improve' your final query, the one that gets the id in the event that the upserts ends up being an update. I'm not - it's about the first upsert I'm trying to fix the issue that, using your original upsert example, you have to ensure you... read more

Ben Nadel replied to a post It's OK To Be Super Explicit In Your Data Access Method Names

@Ian, Sorry, I promise that I'm not being purposefully obtuse here. But, I appear to be able to refer to the existing row values even without that function. Meaning, in my example in the post, I have: ON DUPLICATE KEY UPDATE id = LAST_INSERT_ID( id ) ... where the id is from the existing row. So, ... read more

Ian Turton replied to a post It's OK To Be Super Explicit In Your Data Access Method Names

@Ben, you can use the VALUES(col_name) function to refer to column values from the INSERT portion That's it right there. I don't know why they've gone immediately to an example of a non-obvious use for this (e.g. the single insert version of your statement I posted), but I suspect that immediate div... read more

Ben Nadel replied to a post It's OK To Be Super Explicit In Your Data Access Method Names

@Ian, Yes, this is MySQL. It's funny, so I've actually read through the MySQL documentation on the ON DUPLICATE KEY UPDATE, and I've seen the VALUES() stuff, and I swear I've just never really understood what it was doing. Even just now, as I was about to write this comment, I went and I looked at t... read more

Ian Turton replied to a post It's OK To Be Super Explicit In Your Data Access Method Names

Assuming this is MySQL, I prefer to use the VALUES function on the update part. Apart from being more readable, it removes the possibility that I make a change to the insert part and forget to change the update (or vice versa) so e.g. ON DUPLICATE KEY UPDATE valueOne = VALUES(valueOne), valu... read more

Ben Nadel replied to a post It's OK To Be Super Explicit In Your Data Access Method Names

@Dave, Don't even get me started about icons 😜 I spent like 3-hours the other day trying to make an icon in Sketch. At work, all our icons have a 1.5px stroke, which makes it super hard to design since all the paths needs to start on a .5px location. I feel like that, alone, is a decision somebody ... read more

Dave Quested replied to a post It's OK To Be Super Explicit In Your Data Access Method Names

Totally! I have many "What was I thinking calling it that!" moments a few years later. And then there's trying to find a Font Awesome icon to match the piece of functionality ;) On aside, loving the "Working Code" podcast. I listen to it whilst running in the hills here in New Zealand. Keep it up!... read more

Ben Nadel replied to a post It's OK To Be Super Explicit In Your Data Access Method Names

@Dave, Agreed, Upsert is a great word - I learned that from the MongoDB API. Naming things is hard. And, the funny thing is, sometimes it's deceptively hard! Like, you'll name something and feel good about it; and then, only over time do you realize that you failed to capture what it actually was an... read more

Ben Nadel replied to a post Replacing jQuery (110kb) With Umbrella JS (8kb)

@Hexydec, Very interesting - it's neat how you broke out all of the individual methods. Kind of like how Lodash refactored all of its architecture to allow for individual import calls. Classy approach 👍... read more

Hexydec replied to a post Replacing jQuery (110kb) With Umbrella JS (8kb)

@Ian, jQuery's html() method actually attaches any scripts in the markup you pass it for you, getting around the innerHTML issue. This is also the case for dabby.js, a lightweight ES6 jQuery clone, which at full build weighs in at 18(6)kb. See https://github.com/hexydec/dabby/... read more

Ben Nadel replied to a post Using The LaunchDarkly Feature Flag Java SDK With Lucee CFML 5.3.8.201

@Alex, One minor point, you might run into a small security issue. the JavaLoader.cfc needs access to the ColdFusion internal libs in order to run. This is a checkbox in the ColdFusion Admin: https://www.bennadel.com/blog/3699-javaloader-needs-access-to-internal-coldfusion-java-components-in-coldfus... read more

Alex replied to a post Using The LaunchDarkly Feature Flag Java SDK With Lucee CFML 5.3.8.201

This is great way of loading Java external libraries in isolation on an existing Lucee server. Do you know if this is possible in Adobe Coldfusion or is it only for Lucee ? We are creating a spring boot (none web) API which we want to use on our CF 2018 server but, obviously there will be clashes (e... read more

Ben Nadel replied to a post Looking At Different Click-To-Edit Implementations In Angular 9.1.12

@RaTech, In Approach 3, the "edit form" component is not intended for general re-use - it is wholly owned by the parent interface. It's only factored-out for a better separation of concerns. So, if you needed to change the button styles or text, you would just edit the component. And, because the co... read more