Posts

prettier rant (forewarned, er..not pretty)

I’m developing a strong dislike (I didn’t say hate) for changes that get made to codebases by someone else’s’ prettier rules. When code is already formatted then I don’t think it should be reformatted by my prettier. If I open a PR and have a bunch of prettier changes to the code then something is probably wrong. If it’s my own codebase or new code fine, but if its someone else's’ then I don’t think I have the right to reformat it to my prettier rules. I also don’t want to review a PR where most of the code changes are prettier changes and I’m left scratching my head figuring out what really changed. I think we should turn off prettier if it results in significant changes to a code base and we should never be checking in prettier changes only. Either that or we all agree to use same prettier and same rules …and is this prettier change: sinon.stub(RLCPermissionsHTTPService,'getHost').returns(localTestsUrl); better than this? sinon.stub(RLCPermissionsHTTPService, 'getHost...

AHA programming - Kent Dodds

I watched Kent Dodds presentation in React Summit 2020 and also read his aha blog post. AHA stands for Avoid Hasty Abstractions and Kent likes it described as: prefer duplication over the wrong abstraction. Ok, on the surface that sounds controversial, prefer duplication? Goes against principle of DRY. But we already follow guidelines that cause duplication e.g. WET Write Everything Twice ...but not a third time (we follow that at Opentable). Often times you think you know a component will be reused but in fact you may be wrong and it may take a couple of implementations to really understand if it's common pattern or not.  And that's Kents point: don't rush into abstractions. Code duplication is ok while it's being figured out. Over time/uses the commonalities will become clear and then you can create an abstraction that will work better. He's not saying don't do abstractions, he is saying take your time to learn the domain. In the video presentation Kent highl...

flexboxfroggie.com game

Image
Been meaning to play flexboxfroggy.com; what a great idea: make learning a game! love it. I like that they use wording like "levels" to encourage you to keep going. The graphics are fun, like a kids game, even have pac-man like circles which continue the gaming theme. Bold fun colors. Helpful content and hints. Great for kids of all ages. Flexbox has been a game changer for css layouts and we all use extensively. It's very powerful but also lots of options. The go to guide is from css tricks , but it ain't as fun as freddy my notes justify-content: main axis (i.e. horizonal axis unless reversed) align-items: cross axis (i.e. vertical axis  unless reversed), how items as a whole are aligned within the container when you set direction reversed for row/column then start and end are also reversed and so is justify-content and align-items order: change order of items with positive or negative number (default order is 0 for all) align-self: targets a specific item (can over...

"Tackling Typescript" - Alex R online book

I'm a big fan of Alex Rauschmayer and his blog 2Ality  because Alex is a teacher, he shares great information in his posts and free books. Often at a deeper level than many other sources. And he's a trusted resource. We've been using Typescript for all our frontend code since 2018 and the frontend team all appreciate Typescripts benefits. But it's good to take a step back and refresh so I'm reading Alexs' book "Tackling Typescript". Typescript has become more and more popular and more and more positions require it. It's a language every javascript dev should know. Here are my notes on Alexs' book. Alex points out that Typescript identifies errors statically but also that Typescript is also documentation of the code which is also a big plus. Once you're used to Typescript (ts) you really notice the difference when comparing to plan js code...you get much more information in the ts code. Another plus is Typescript is an early adopter of new E...

You are the Secure Code Warrior

Image
Opentable has provided it's engineers access to a tool called Secure Code Warrior to practice and learn secure coding best practices. There are various modules for different tech stacks. I'm taking the Reactjs module. Secure Code Warrior is a pretty cool interface. It presents scenarios as games. Attackers from all over the world are attacking your systems and you have to save the day. Gamification. I like it. You are tasked with fixing code that has one or more security holes. Below is a snapshot of the interface. Pretty cool. All that's missing is the Defcon countdown audio. Some of the Training questions and examples are unclear to understand what's needed. I'd appreciate a (better) introduction first for each security vulnerability before jumping straight into coding tests. Myself and others ended up repeating the same section because the UX of the tool is confusing. When a section is done don't hit "Continue", that means keep doing same...

Kent Dodds - Advanced hooks

Kent Dodds is a pretty famous (at least in React land) trainer, conference presenter and blogger. Has courses on egghead.io and more Has a his own training workshop series on react: https://kentcdodds.com/workshops/ I saw he had an online training coming up and really wanted to participate and learn from him.  I've worked with hooks such as useEffect and useCallback so I decided to step up to the Advanced Hooks course,  more: https://kentcdodds.com/workshops/advanced-react-hooks I'm leaning advanced hooks myself so my intent is not to teach you how to use these hooks.  My intent is to share my experience and the materials to inspire and guide you to learn more yourself. Do prepare in advance of the course:  - setup zoom - his KCD workshop prep - pre-requisite material - the coursework itself Kent moves quickly in his online courses His intent is not that you learn everything and get all exercises working in the training session. So you have to revisit later Kent also...

Domain Driven Design - Eric Evans book notes

  Domain Driven Design book - Eric Evans (2003) I love this book. So well written. Espouses good principals and practices which still apply today. Good examples to follow and learn from. (kindered spirit) Introduction domain - the subject area, area of interest e.g.  the domain of a restaurant system involves real people booking reservations at restaurants to create valuable software you need to understand the domain its for, models can help focus on what's important out of that large domain The domain model is not a particular diagram; it is the idea that the diagram is intended to convey. It is not just the knowledge in a domain expert’s head; it is a rigorously organized and selective abstraction of that knowledge.  The domain model is the idea that the diagram is intended to convey; loosely representing reality to a particular purpose.  Developers have to steep themselves in the domain to build up knowledge of the business. Three basic uses for domain model: 1. ...