• hawksworx
  • blog
  • speaking
  • about
  • search

Notes - page 1046

  • Newest
  • Previous
  • Next
  • Oldest

The archive of what I posted on Twitter, which I now self host due to a lack of trust in Twitter and some other reasons.

I'll soon begin refelcting all my Mastodon posts here too. I'm happier self-hosting or maintaining an archive of my content on URLs that I can own.

There are tools to help you do this too. Such as this one from the makers of Eleventy.

A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 20th 2021
#TweetsRefactoredByMyLegalTeam

In my personal experience, which may differ to yours, "product" and "products" are examples of visually similar and easy to confuse variable names.

Finding a collective noun or compound word instead of "products" seems to save me some mistakes. https://twitter.com/philhawksworth/status/1428656544963497984
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 20th 2021 replying to this from @piccalilli_
@piccalilli_ @bencodezen Got it.
Puppies and kittens only (in exactly even quantities) from here on in.

:)
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 20th 2021 replying to this from @jaffathecake
@jaffathecake @heydonworks @bencodezen Agreed.
But please don't stop my fun of adopting the following (self-explanatory) variable names:

¯\_(ツ)_/¯
(╯°□°)╯︵ ┻━┻
┬─┬ノ( º _ ºノ)
ノ•ᴥ•ʔノ ︵ ┻━┻
(┛◉Д◉) ┛彡┻━┻
(ノಠ益ಠ)ノ彡
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 20th 2021 replying to this from @jaffathecake
@jaffathecake @heydonworks @bencodezen Does it make the need for thoughtfully naming your variables go away? If so, I'm ready for some fun.
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 20th 2021
Regardless of the other characteristics of the programming language, if it had a troupe data type, I'd embrace it like a long lost sibling. https://twitter.com/tjcrowder/status/1428665429929644032
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 20th 2021 replying to this from @rem
@rem @bencodezen SHIP IT
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 20th 2021 replying to this from @piccalilli_
@piccalilli_ @bencodezen Note to self:
If you use pseudocode to illustrate a point, make it far more pseudo than you were planning. Or better still, make the point without it.

And perhaps I'll park my tweet about embracing CSS in JS in order to polyfill for "colour" for another day.
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 20th 2021 replying to this from @heydonworks
@heydonworks @jaffathecake @bencodezen Fair... the nub of the advice here was just to try to avoid simply pluralizing a noun.

Within that, sure, there are likely some good conventions/preferences to also imply things more deeply about the data type.
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 20th 2021 replying to this from @jaffathecake
@jaffathecake @bencodezen Yeah... I thought that after posting too.. but I think that the general point about not simply plauralizing nouns remains.
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 20th 2021 replying to this from @Hicksyfern
@Hicksyfern @_phzn @bencodezen That's true.

My code comments are entirely English vernacular here and not intended to have deeper CS meaning. But I think the principle stands regardless if it were a set, list, array, collection, bunch, clutch, gaggle, herd, or troupe. :)
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 20th 2021 replying to this from @dutchcelt
@dutchcelt @bencodezen Yeah. It has always felt obvious to me to just pluralize nouns for collections of that noun. And that reads wonderfully. But spotting a missing or a superfluous "s" is so easy to botch, even (especially?!) after staring at the code for a while!
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 20th 2021 replying to this from @rem
@rem @contentful I've always used the latter. And that's what I hear used by the folks I know who work there.
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 20th 2021
The amount of time I spend debugging a common mistake dropped considerably after @bencodezen advised me to rethink my naming conventions for collections of things.

Bye-bye "products".
Hello "productList".
Embedded image from social media
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 18th 2021 replying to this from @petervangrieken
@petervangrieken Amazing!
Huge congratulations!
You both look wonderful. 😍
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 17th 2021 replying to this from @JarrettLusso
@JarrettLusso @jaffathecake @Netlify Aha! I'll get to reading. Thanks for the link.

Meanwhile, the upcoming Edge Handlers release should be a huge boon for this sort of thing. Just to put it on your radar.

https://www.netlify.com/products/edge/edge-handlers/
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 17th 2021 replying to this from @dalmaer
@dalmaer Oooh pop the kettle on.
I'm going to make reading this a nice me moment.
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 17th 2021 replying to this from @JarrettLusso
@JarrettLusso @jaffathecake @Netlify Yeah I'd be interested in hearing more about the issues being experienced here.

Perhaps best on https://answers.netlify.com since that usually makes discussion easier than on Twitter, and also captures the issue for the attention of the team and community.
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 17th 2021 replying to this from @opinionatedpie
@opinionatedpie Have you replaced it with another drink / habit / ritual?
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 16th 2021 replying to this from @codebeast
@codebeast @AWSAmplify Awesome hire for @AWSAmplify! And congrats on your exciting next adventure, Chris! ✨
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 15th 2021
The only time you should work like your life depends on it, is if your life depends on it. https://twitter.com/hadip/status/1426587408267501568
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 14th 2021 replying to this from @iChris
@iChris @jlengstorf 😍 (It’s because we share a monarch)
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 13th 2021 replying to this from @seancdavis29
@seancdavis29 @zachleat 100% this!
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 13th 2021 replying to this from @seldo
@seldo Poor Guff!
Sending lots of fuss and affectionate scratches to that little legend.
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 12th 2021 replying to this from @jlengstorf
@jlengstorf Do you live in Portland?
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • August 11th 2021 replying to this from @paul_melero
@paul_melero Nailed it.
  • Permalink
  • |
  • Twitter
  • Newest
  • Previous
  • Next
  • Oldest

The source code of this site is available on GitHub and is hosted and updated by Netlify automatically after each code commit

Other than where specified, the content on this site is published under a Creative Commons Attribution 3.0 licence.

Subscribe to a feed of blog posts on this site.