How To Code Well

How To Code Well

By Peter FisherTechnology
Download on the App Store

How To Code Well episodes

  • 168 - What is a design system?

    Changelog

    • I've created a playground in the mono-repo for ReactJS experiments
    • I have started working on a very lightweight design system
    • I am giving a talk to PHP Minds next Thursday. The talk is called Code with Confidence with PHPCS 
    • PHP UK has announced their CFP and released early bird tickets. I have tickets.
    • This weekend I am off to see England versus Scotland in the Common wealth boxing
    • News/Articles

      How to call rest APIs using React

      https://www.smashingmagazine.com/2020/06/rest-api-react-fetch-axios/

      How to use the React Router to create an image link

      https://bobbyhadz.com/blog/react-image-link

      React higher order components

      A higher-order component (HOC) is an advanced technique in React for reusing component logic. HOCs are not part of the React API, per se. They are a pattern that emerges from React’s compositional nature.

      Concretely, a higher-order component is a function that takes a component and returns a new component.

      https://reactjs.org/docs/higher-order-components.html

      What is a Design system

      • A collection of reusable components
      • A place for collaboration amongst designers and developers
      • A set of standards that must be adhered too
      • A set of guidelines and principles that are relevant to the business
      • Not just a component library

        A component library is a library of reusable components that other designers and developers can use.

        A design system also sets out a series of rules and standards for the components and surrounding design. These include but are not limited to 

        • Typography
        • Spacing
        • Branding
        • User experience
        • Language
        • Voice and tone
        • Colours
        • Patten
        • Often, a design system will explain what is allowed and what is not allowed.

          Examples of design systems

          • IBM https://carbondesignsystem.com/
          • Shopify https://polaris.shopify.com/
          • Material design https://material.io/design
          • UK Gov https://design-system.service.gov.uk/
          • You can get in touch with me here: https://howtocodewell.fm/contact

            My web development courses

            ➡️ Learn How to build a JavaScript Tip Calculator 

            ➡️ Learn JavaScript arrays

            ➡️ Learn PHP arrays

            ➡️ Learn Python

            ✉️ Get my weekly newsletter

            ⏰ My current live coding schedule (Times are BST)

            Tuesdays 18:00 - Live coding on YouTube

            Sundays 15:00 - Live coding on Twitch

            23 min
          • 167 - Reacts killer feature

            Changelog

            • Lots of bitty bugs which have prevented me for progressing on the Kubernetes side of the howtocodewell.net staging deployments
            • Lots of PHP packages on howtocodewell.net have been upgraded
            • I was able to play around with the API platform.

            • News/Articles

              API platform tutorial with Symfony

              https://digitalfortress.tech/tutorial/rest-api-with-symfony-and-api-platform/

              How to store Symfony sessions in a database

              https://symfony.com/doc/current/session/database.html

              What’s new with Composer 2.4

              https://php.watch/articles/composer-24

              Question from Alex regrading the How To Code Well Discord bot

              https://github.com/howToCodeWell/discord-bot

              New to the web platform in June by Rachel Andrew

              https://web.dev/web-platform-06-2022/


              Reacts killer feature

              Components can be shared between React and React Native.

              • Reduces the code size
              • Reduces specialised skill sets
              • Helps create boundaries for mobile and web applications
              • Unifies the code base
              • Reduces pressure on the HR for finding other skill sets
              • Makes T shaped teams that can switch contexts
              • 20 min
              • 166 - 5 ways to Speed up Cypress automation tests

                Changelog

                • Lots of JavaScript package upgrades have been made to the frontend of howtocodewell.net including TailwindCSS, PostCSS, Webpack and Node itself.
                • I’ve decided to use PostCSS over Less and I’m seeing much faster results when generating the CSS
                • The plan for next week is to look at composer package upgrades as well as progressing with the staging deployment
                • In my contracting space I have been doing a lot of PHP 5.6, 7.4 and Angular work
                • News/Articles

                  Being on call sucks by Bobbie Chen

                  https://bobbiechen.com/blog/2022/7/20/being-on-call-sucks

                  Testing links in Cypress by Filip Hric

                  https://filiphric.com/testing-links-with-cypress

                  Enabling typescript in Symfony Webpack encore

                  https://symfony.com/doc/current/frontend/encore/typescript.html

                  How to secure applications on Kubernetes (SSL TLS certificates) by AVM Consulting Blog

                  https://medium.com/avmconsulting-blog/how-to-secure-applications-on-kubernetes-ssl-tls-certificates-8f7f5751d788

                  How to speed up Cypress automation tests by FeldsparTech

                  https://www.feldspartech.com/post/how-to-speed-up-cypress-automation-tests


                  How to speed up Cypress tests

                  In general

                  1. Discover how slow your tests are to start begin with
                  2. Don’t speed up your tests if you don’t need too
                  3. Work on the tests that take the longest. List all tests that take over x seconds/minutes and work on those
                  4. A small improvement can give you big gains in the long run
                  5. Only test what you need too and when you need too
                  6. Cypress

                    1. Group similar tests together into a single test
                    2. Separate tests that don’t need state, change of state or require a fixed state
                    3. Pay attention on the before and beforeEach hooks
                    4. Disable the video and screenshot creation on automatic builds
                    5. Enable video and screenshot creation on manual/nightly builds
                    6. 25 min
                    7. 165 - Flaky Tests

                      Changelog

                      • I’ve sorted the Kubernetes ingress controller for the staging deployment of howtocodewell.net
                      • I’ve got a few problems with connecting services outside of the Kubernetes cluster but I am working my way through those.
                      • I’ve been updating the pipelines to allow for certain manual jobs in GitLab.
                      • News/articles

                        Python ASGI The future of Python Web Development

                        A new asynchronous standard for Python web applications.

                        WSGI = Web Server Gateway Interface

                        ASGI = Asynchronous Server Gateway Interface

                        https://www.infoworld.com/article/3658336/asgi-explained-the-future-of-python-web-development.html

                        Podcast 2.0

                        I have my eye on the podcast 2.0 movement and may start to add some backlog tickets to investigate what is involved from a technical standpoint to updating the RSS feeds.

                        https://medium.com/@everywheretrip/an-introduction-to-podcasting-2-0-3c4f61ea17f4

                        • The Podcast Index
                        • Podcasting Namespace
                        • PodPing
                        • Value-For-Value
                        • Send Symfony logs to Slack

                          This could be a neat little future video tutorial. I could also do something similar with a Discord bot.

                          https://manyou.blog/send-symfony-logs-to-slack-with-symfony-notifier-as-a-monolog-handler


                          What’s a flaky test

                          A flaky test is a test that sometimes passes and sometimes fails. This usual happens randomly and is incredibly annoying.

                          What causes flaky tests

                          • Under powered resources
                          • Tests running in random order
                          • Tests not cleaning themselves up afterwards
                          • External programs or requests interfering with the tests
                          • How to fix flaky tests

                            • Run tests more regularly
                            • Separate flaky tests and run them in isolation until fixed
                            • Only test what is needed based on what has changed
                            • Don’t ignore or skip tests if you can help it
                            • Check the environment
                            • Check inputs for non-deterministic values
                            • Check timeouts
                            • Check system resources
                            • Check for race conditions
                            • Check if there is any fixed order to the tests
                            • Keep your tests maintained.
                            • 24 min
                            • 164 - My thoughts on Kubernetes after 3 months

                              Changelog

                              • My Kubernetes CronJob experiments are now working
                              • On Tuesdays live YoutTube stream we fixed issues with the PHP implementation of Object Storage
                              • On Sundays Twitch live stream we started the process of upgrading NPM packages
                              • Some news/articles to share

                                StarLabs has teased a 4k linux laptop called the StarFighter

                                https://www.omgubuntu.co.uk/2022/07/starfighter-15-6-4k-linux-laptop-from-star-labs

                                Why isn’t the internet more fun and weird

                                https://jarredsumner.com/codeblog/

                                Recommended podcasts regarding DevOps

                                Devops Paradox podcast

                                Self hosted

                                Linux Action show

                                Coder radio

                                My thoughts on Kubernetes after 3 months of learning it

                                1. Smaller is better
                                2. Kubernetes lends itself well to micro services and not monolithic applications
                                3. You don’t always need Kubernetes
                                4. The Kubernetes learning curve is huge
                                5. Monitoring and transparency is is super important with Kubernetes
                                6. Not all managed Kubernetes services are the same

                                7. 26 min
                                8. 163 - Why 10x developers are not paid any more

                                  Change log

                                  • I'm currently running experiments with Kubernetes CornJobs
                                  • I've done lots of under the hood security tweaks with howtocodewell.net
                                  • I've started using Jira to manage spikes and delivery tickets for the deployment stage of howtocodewell.net
                                  • I've added tickets for some upgrade work, Symfony 6, NPM 16 LTS, PHP 8.1
                                  • On Tuesday we progressed the PHP registertion course by adding the framework-less router.
                                  • Next week we will add some PSR interfaces for the HTTP messages to the PHP registration course
                                  • Why 10x developers are not paid any more


                                    • Programming productivity cannot be measured like the productivity of a sales person.
                                    • A sales person can make 10 more sales than their colleges and therefore make 10 times the amount of money.
                                    • An electrician could work faster and better than another contractor. This would allow them to complete more jobs and charge more than there competitors.
                                    • Better programmers write less code.
                                    • Some talented programmers get board and leave their posts. 
                                    • Talented programmers are difficult to keep.
                                    • Experience is more important than the lines of code your write.
                                    • Programmers don’t get rates best on how productive they are.  EG Bug (A) has the same monetary value as bug (B)
                                    • The best way to get a raise is to start a new position.

                                    • Contact me and let me know your thoughts or get something read out on air.

                                      My web development courses

                                      ➡️ Learn How to build a JavaScript Tip Calculator 

                                      ➡️ Learn JavaScript arrays

                                      ➡️ Learn PHP arrays

                                      ➡️ Learn Python

                                      ✉️ Get my weekly newsletter

                                      ⏰ My current live coding schedule (Times are BST)

                                      Sundays 15:00 - Live coding on Twitch

                                      32 min
                                    • 162 - Why I'm learning TypeScript

                                      Changlog 

                                      The deployment phase of https://howtocodewell.net staging site is going very well. I now have Kubernetes cluster is running via Terraform

                                      Why am I leaning TypeScript? 

                                      I know many languages, some more than others.  PHP is my goto and Python is the next biggest language I know.  Of course I know JavaScript and other languages such as Java and Perl but I rarely use those.  

                                      In my opinion Typescript is what JavaScript should-of been to begin with.  

                                      - I’ve noticed more demand for Typescript jobs than JavaScript jobs. 

                                      - I’ve noticed no demand of Flow 

                                      - Typescript works well with Node so its kinda backend friendly.  I wouldn’t consider using JavaScript on the backend without Type safety 

                                      - Typescript works well with React Native so mobile apps can be built for both Android and IOS 

                                      - Theres a bigger demand to convert Javascript apps to Typescript apps  

                                      Will there every be any Typescript tutorials 

                                      Yes, but not for a while.

                                      16 min
                                    • 161 - Did Google create a sentient being?

                                      Changelog 

                                      • On Tuesdays live show I fixed all the databases tests for the PHP Registration course 
                                      • I'm still playing with Gitlab pipelines
                                      • Has Google created a sentient being? 

                                        • BBC news report
                                        • Medium article with Lamda interview

                                        • 20 min
                                        • 160 - PHP Version Stats

                                          Change log

                                           - I’ve started learning typescript as I want to convert all the HTCW JavaScript code into TS

                                           - I’ve started playing with a Kubernetes playground for HTCW staging 

                                          - On Tuesday we started planning how to build the controllers for the PHP registration course  HPDevOne  Is now available to buy and some people already have them.  

                                          WWDC WWDC is this week.  

                                          I’m still digesting my thoughts on the announcements.  I may talk about my opinions next week.  

                                          m1windowsproject 

                                          An ambitious project by Amarioguy who is attempting to run Windows on Apples M1 chip 

                                          PHP Version installs 

                                          Stitcher.io  

                                          Packagist stats 

                                          Package installations by PHP minor version, monthly 

                                          39% on 7.4 28th of Novembers 2022 - Security support 

                                          23% on 8.1

                                          21% on 8.0 

                                          14 min
                                        • 159 - Deployment Stage

                                          Listen to the show: http://howtocodewell.net/159 

                                          Check which features are available in PHP versions http://caniusephp.com 

                                          The new HP Dev One laptop https://hpdevone.com/ 

                                          Get the newsletter: https://email.howtocodewell.net/signup

                                          My web development courses

                                          ➡️ Learn How to build a JavaScript Tip Calculator 

                                          ➡️ Learn JavaScript arrays

                                          ➡️ Learn PHP arrays

                                          ➡️ Learn Python

                                          ✉️ Get my weekly newsletter

                                          ⏰ My current live coding schedule (Times are BST)

                                          Thursdays 20:00 = Live Podcast YouTube

                                          Sundays 14:30 - Live coding on Twitch

                                          15 min

                                        About How To Code Well

                                        From the publisher's feed

                                        Web development discussions and interviews from Peter Fisher. Covering JavaScript, Linux, Docker, PHP, Python, MYSQL, HTML and more