Log in

goodpods headphones icon

To access all our features

Open the Goodpods app
Close icon
HTML All The Things - Web Development, Web Design, Small Business - Advanced Topics w/ Little Experience

Advanced Topics w/ Little Experience

03/20/19 • 79 min

HTML All The Things - Web Development, Web Design, Small Business

In this episode we take a look at taking on complex tasks in a field where you're not very experienced, something all programmers must do at one point or another in their career.

Segment 1 - The Newcomer Effect
  • This segment is going to focus on our experience configuring a vuejs service worker - I went in with no previous hand-on experience, a complete newcomer to service workers and an amateur at vuejs. Therefore this process is no doubt clunky, but as you’ll hear that’s exactly the point
  • I want to be clear before I dive in here that we’re using the following particular scenario because it was recent, we are not pointing the finger at any of the plugins, apps, or resources that we mention below. The issues we’re discussing are industry-wide, and not on a specific service, platform, or individual.
  • Recently we went to work with service workers on a Vue.js app (No BS News for Reddit)
  • As apart of the coding challenge we had already had a basic service worker setup that allowed the local assets to load when the app was offline
  • This functionality was made using a pwa plugin for vuejs
    • We left this plugin mostly, if not completely, in its default configuration
    • This default configuration registers a service worker and then generates a service worker file which caches those offline assets
    • Mike got the project to this point during the coding challenge and then I took over
  • This is where things all fell apart for me:
    • I had done a couple of days on reading basic service worker configurations and functionality and then finally decided to dive into our project
    • First thing I did was look around the file structure and I find a file named registerServiceWorker.js
    • This file contained an import line regarding register-service-worker (which fueled my initial Google searches) as well as the registration and basic responses that you’d expect such as successfully registered, detecting offline, etc.
    • Searching register-service-worker led me to the page that I linked above, which had some very brief documentation and a code example that looked like our registerServiceWorker.js file (so far so good)
    • From there I ran some tests in Chrome, checking for service worker install, checking offline mode, etc to get my bearings
    • At that point I wanted to start adding some code of my own to the service worker, from my readings I knew that the service worker was definitely a separate file and from the registerServiceWorker.js file I could see that it was referring to a file called service-worker.js
    • Searching the directory for said file revealed that it didn’t exist
    • I then went and checked in the browser again, taking a look at the sources tab to find out what file was running the service worker, it showed that it was definitely service-worker.js - which indicated that the file was being created dynamically as apart of the build process
    • This led us down a rabbit hole of finding how to inject my service worker code into this autogenerated file
    • Overall, we eventually did find a solution for the code injection, however, it was not in the original register-service-worker documentation, nor was it discussed a lot on stack overflow
    • We did find one Stack Overflow thread that did help, which led us to a useful blog and a couple of interesting links - I also found a separate page on npmjs.com somewhere along the lines which contained the missing code we were looking for
    • Basically we needed to add some injection configuration into the vue.config.js file and then from there make our service worker script
  • Now I know that’s long winded, but it points out some very important problems/concerns:
    • The newcomer effect is alive and well, I wrote an article on Medium about what I call the newcomer effect a long time ago, it basically means that any documents/signs/directions that are available for any given experience rarely take into account the needs of those that are complete beginners - increasing the entry “budget” for newbies
    • I’m not sure how documentation writers do it - maybe it’s because they’ve been working on their projects for so long - that they completely miss major steps in their documentation. It’s got to be mentioned that we desperately need better documentation for beginners and furthermore, more linking between potentially helpful guides
    • In this particular case, maybe it’s because many folks won’t write their own service worker, but rather just want the default to cache the local assets and that’s it, but shouldn’t it at least be mentioned that if you want to write your own service worker - please see x
    • Toxicity and useless comments are alive and well - on various forum posts, comments, and of course Stack Overflow posts there are typically an abundance of comments that dismiss questions...
plus icon
bookmark

In this episode we take a look at taking on complex tasks in a field where you're not very experienced, something all programmers must do at one point or another in their career.

Segment 1 - The Newcomer Effect
  • This segment is going to focus on our experience configuring a vuejs service worker - I went in with no previous hand-on experience, a complete newcomer to service workers and an amateur at vuejs. Therefore this process is no doubt clunky, but as you’ll hear that’s exactly the point
  • I want to be clear before I dive in here that we’re using the following particular scenario because it was recent, we are not pointing the finger at any of the plugins, apps, or resources that we mention below. The issues we’re discussing are industry-wide, and not on a specific service, platform, or individual.
  • Recently we went to work with service workers on a Vue.js app (No BS News for Reddit)
  • As apart of the coding challenge we had already had a basic service worker setup that allowed the local assets to load when the app was offline
  • This functionality was made using a pwa plugin for vuejs
    • We left this plugin mostly, if not completely, in its default configuration
    • This default configuration registers a service worker and then generates a service worker file which caches those offline assets
    • Mike got the project to this point during the coding challenge and then I took over
  • This is where things all fell apart for me:
    • I had done a couple of days on reading basic service worker configurations and functionality and then finally decided to dive into our project
    • First thing I did was look around the file structure and I find a file named registerServiceWorker.js
    • This file contained an import line regarding register-service-worker (which fueled my initial Google searches) as well as the registration and basic responses that you’d expect such as successfully registered, detecting offline, etc.
    • Searching register-service-worker led me to the page that I linked above, which had some very brief documentation and a code example that looked like our registerServiceWorker.js file (so far so good)
    • From there I ran some tests in Chrome, checking for service worker install, checking offline mode, etc to get my bearings
    • At that point I wanted to start adding some code of my own to the service worker, from my readings I knew that the service worker was definitely a separate file and from the registerServiceWorker.js file I could see that it was referring to a file called service-worker.js
    • Searching the directory for said file revealed that it didn’t exist
    • I then went and checked in the browser again, taking a look at the sources tab to find out what file was running the service worker, it showed that it was definitely service-worker.js - which indicated that the file was being created dynamically as apart of the build process
    • This led us down a rabbit hole of finding how to inject my service worker code into this autogenerated file
    • Overall, we eventually did find a solution for the code injection, however, it was not in the original register-service-worker documentation, nor was it discussed a lot on stack overflow
    • We did find one Stack Overflow thread that did help, which led us to a useful blog and a couple of interesting links - I also found a separate page on npmjs.com somewhere along the lines which contained the missing code we were looking for
    • Basically we needed to add some injection configuration into the vue.config.js file and then from there make our service worker script
  • Now I know that’s long winded, but it points out some very important problems/concerns:
    • The newcomer effect is alive and well, I wrote an article on Medium about what I call the newcomer effect a long time ago, it basically means that any documents/signs/directions that are available for any given experience rarely take into account the needs of those that are complete beginners - increasing the entry “budget” for newbies
    • I’m not sure how documentation writers do it - maybe it’s because they’ve been working on their projects for so long - that they completely miss major steps in their documentation. It’s got to be mentioned that we desperately need better documentation for beginners and furthermore, more linking between potentially helpful guides
    • In this particular case, maybe it’s because many folks won’t write their own service worker, but rather just want the default to cache the local assets and that’s it, but shouldn’t it at least be mentioned that if you want to write your own service worker - please see x
    • Toxicity and useless comments are alive and well - on various forum posts, comments, and of course Stack Overflow posts there are typically an abundance of comments that dismiss questions...

Previous Episode

undefined - Leadership w/ Scott McCarthy

Leadership w/ Scott McCarthy

In this episode we sit down with leadership expert Scott McCarthy, to discuss leadership skills related to small business and independent entrepreneurs.

Segment 1 - Introduce Yourself Segment 2 - Starting Out
  • Do you think that leadership is more of a school-learned skill (note-taking, reading, etc.) or more of one that you learn by putting it into practice?
  • How closely would you relate self-discipline with leadership skills? Should you work on self-discipline before trying to lead others?
  • When entrepreneurs are first starting out, they’re generally alone, or with a small group of other company founders. This leaves them partially or completely isolated from leading other people, a skill they would need to develop should their company grow and hire employees down the road. What advice would you give to someone looking to up their leadership game, before they hire employees?
  • A common mentality for new entrepreneurs is to just dive in and figure things out when you get there, which could lead your business into disaster. What’s your opinion on this mentality? Should people prepare more before they dive in?
  • How tied up should leaders get in the details? Should staff worry about details and leaders focus more on the big picture? (ie setting a sales goal without having the intricate details of how to reach it)
  • Many people that are thinking of starting a business are looking to stash some money away from their day jobs so that they can slowly lower their hours to work on their business idea. Given that their day job is a different experience from their would-be business, how would these entrepreneurs transfer any leadership skills they’re learning on the daily, to their new business?
Segment 3 - Types of Leader
  • One of the things that I struggle with a lot, is trying to determine what kind of leader I want to be. I want to maximize my team’s output, but that the same time, I don’t want to be a “force to be reckoned with” when entering the office. I often flip between being a ruthless money-only kind of leader, a laid back “tech culture” leader, or something in between. Does this kind of decision naturally work itself out as you gain more management experience, or is it more dictated by the stage of the company? (ie only the richer companies can afford to be laid back)
  • How much, if at all, does the job dictate the type of leader needed?
  • Should leaders have “modes” that they snap into in certain situations? (ie Be really monetarily aggressive during an economic downturn, and lighten up when the business improves)
Web News - Difficult Situations
  • When faced with a difficult situation, having a strong leader is critical to guide the team through the storm.
  • This is easier said than done, however, because there are so many aspects of a business that a leader has to keep in mind
  • Things like: employees, asset management, capital, revenue, expenses, etc.
  • In an example scenario, let’s say that there is a struggling app development business that has 1 boss and 5 employees. The business is struggling to find customers and therefore can’t afford to pay their staff’s wages for any more than a couple of months.The company does have some valuable assets in the form of useful apps that could be put up for sale to raise capital. In this situation...
    • How critical is employee loyalty? Should layoffs be step 1?
    • Should assets be sold off before layoffs are considered?
    • If layoffs are inevitable, how do leaders soften the blow? Or do they just move on?
    • What is the main goal the leader should push for? (ie keeping the people employed, maximizing profit, liquidating to gain capital for themselves, retaining assets, etc.)
Scott's Links

You can find us on...

Facebook | Twitter | Instagram

RSS | Patreon | Spotify

Next Episode

undefined - Refactoring

Refactoring

In this solo episode, Mike discusses the code refactoring process and then deep dives on work/life balance.

Segment 1 - What is Refactoring
  • Refactoring definition
    • Changing your code to improve its organization and structure without directly influencing it’s performance
  • Explanation of terminology
    • Code Smells
      • Something you notice as your coding that you think will later require a restructure/reorganization
    • Extensibility
      • Ability to later down the road use your current code to extend the capabilities of your program without having to rewrite large portions of code
    • Maintainability
      • Make it easier to fix bugs and find issues in your code down the line when you’re not as familiar with it
    • Extraction/componentization
      • Taking functionality from a method and creating its own method so that it becomes reusable to other functions
Segment 2 - Tips
  • Refactor often
  • Create a refactor list
    • When you notice a code smell but need to focus on functionality, jot it down in a refactor to do list so you don’t forget to go back and correct
  • Change obscure variable names to proper named variables (Maintainability)
    • Also use appropriate variable types. In JS we are limited but we still have the choice between let, const, var
  • When you notice you’re using the same of similar functionality in multiple functions, externalize that functionality into its own function (extraction/componentization)
    • That could be a seperate function, or it can be a seperate file with a it’s own class and extensible functionalities
    • In vuejs currently you can used Mixins which allow the use of methods across components (in the future this will be handled with hooks)
  • Remove old code that you previously commented out
  • Clean up unused files, folders, functions and images
  • Change code to be extensible to your needs (Extensibility)
    • During sprints with short deadlines sometimes you’ll write code to just get something working while realizing that certain functionality that needs to be implemented in the future won’t work with the current implementation
    • Example: Internationalization
  • Remove unused libraries
    • We all add libraries as we code to try to meet deadlines faster, but sometimes they don’t work the way we want and we move on to the next one. It’s important to remove them when we realise they don’t fit
  • Use tools like prettier and lint to help maintain code structure on a daily basis
    • Example making sure everything is in spaces instead of tabs
    • Arrow functions instead of expression functions
  • Add comments to sections of code you think need explanation (maintainability)
Web News - Work/Life Balance
  • One of the disadvantages of being a contractor/freelancer is not having that 9-5 work structure that you have to follow
  • Depending on your situation though it might be an advantage, if your wife works from home also, you can sometimes spend the best parts of the day together.
  • Instead of going shopping at peak times you can go earlier and just work when you get back
  • Take advantage of off hours for traffic
  • A structured day is great, but everyone has a different work rhythm and being able to structure your day based on that can greatly increase productivity.
    • If you work better in the mornings and early evenings you can make the middle of the day your time off for instance
  • If your considering freelancing you have to be able to structure your own days, which seems simple but can really be a challenge.

You can find us on...

Facebook | Twitter | Instagram

RSS | Patreon | Spotify

Medium | YouTube | GitHub

Reddit

Episode Comments

Generate a badge

Get a badge for your website that links back to this episode

Select type & size
Open dropdown icon
share badge image

<a href="https://goodpods.com/podcasts/html-all-the-things-web-development-web-design-small-business-1031/advanced-topics-w-little-experience-6579842"> <img src="https://storage.googleapis.com/goodpods-images-bucket/badges/generic-badge-1.svg" alt="listen to advanced topics w/ little experience on goodpods" style="width: 225px" /> </a>

Copy