🧠 I Code Differently Depending on These 5 Project Types

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello friends my name is joel and i write code differently depending on the project type there are a lot of articles out there that talk about best practices patterns and principles and when i say a lot i really do mean an overwhelming soul-crushing amount of articles but few of them talk about when those best practices should be applied even worse are the debates on social media that are also lacking context and it's the context that is missing and so critical in making these decisions so at this point you're probably thinking do i really write code differently and i absolutely do there's a quote somewhere that goes something like this a junior developer knows not of design patterns a senior developer knows when to apply design patterns and a master developer knows when not to apply those design patterns and i don't believe there's a single design pattern that has a rule that says it should be used in a hundred percent of scenarios but sometimes we treat them like they should be but of course with everything use your best judgment so there's a few different ways that i classify the projects that i work on and it's these project types that determine how i write the code this is by no means an exhaustive list there may be some overlap and your list may vary a little bit so the project types that are important to me are proof of concept personal pet projects open source libraries and enterprise applications so let's dig in a little bit to each project type the proof of concepts project priority is development time a poc should be created as fast as possible you may be tempted to write the code in a way that would be more reusable when the project moves out of the poc stage but i would argue that you should not be doing that because you'd be sacrificing the main priority of a poc which is development time so a flex grid is taking too long and you could do a table in three seconds then go ahead and use the table is react taking up too much time when you could do the same in jquery use jquery redux versus creating a global okay you get it now we don't have to worry about testing logging metrics performance all of that just goes out the window we just need to make it work if writing all the code in one file is faster write it all into one file and regardless of whether the project is successful or not you should just discard all the poc code and that's why best practices just don't really matter in a poc personal pet projects this is my favorite type of project because there really are no rules this project's priority is me so i can do whatever i want if i want to go with a functional programming design i can do i want to learn a new technology of course i do this type of project is usually where i explore and try new technologies i do care a little bit about the readability of the code because i do tend to pick up these projects years later and i don't want to be lost when i pick them up but i don't worry too much about design patterns because it is just a personal project so it's just kind of one stage above a poc on the other hand this is a perfect project for you to play with new design patterns this way you can be more comfortable with them when you do implement them in other projects the priority of an open source project should be code readability the audience of this project is people who will use the code as well as people who will read the code and you will be judged by the quality of your source so keep the code nice tight clean and well documented i like to have higher code coverage on these projects it gives people contributing to the project a little confidence that they didn't break anything and it also gives me confidence when merging people's code into the code base it's good to have some design patterns and practices laid out in a contributor's markdown file this will clear up how contributors write code as well as to give you something to point at when something deviates from the standard library code should focus on the developer experience the focus should be on creating documentation as well as useful examples the projects that i love have great documentation i also like to spend a little extra time on input validation just because you don't know how people are going to use your application and what kind of inputs they're going to be sending into your functions so i like to craft verbose error messages to help with debugging so you don't run into those weird cannot read property to string of undefined error messages i also try to optimize the code the best that i can because i don't know where they're going to be using the code and i don't want my code to be the bottleneck in their application i've also been considering typescript because it's nice to have a good ide experience and to have that intellisense when you hit dot to autocomplete is just really nice and finally there's enterprise applications with the main focus being uptime and performance extra time needs to be spent catching bugs before they reach production this means more unit tests more integration tests and of course ci cd pipelines logging metrics monitoring and alerting these all become critical to identify and debug issues care must be taken when handling api keys and secrets which could leak from source code deployments tend to be a little bit slower because of the extra coordination and qa so it's also nice to be able to change configuration values without redeploying the application there's a lot of extra care that goes into an enterprise application to make sure it's always up so to summarize it can be a little overwhelming when reading and navigating tech articles today take all of them with a grain of salt and context there are times to use them and there are times to not just remember there is no one-size-fits-all solution and it all depends on the context and thanks for making it to the end of the video i really do appreciate you spending your time with me and just a reminder if you're going to subscribe also click the bell icon or you won't receive notifications when new videos do come out and as always thanks again and i'll see you in the next video [Music] oh [Music] you
Info
Channel: Joel Codes
Views: 514
Rating: undefined out of 5
Keywords:
Id: olULbdwJ9rE
Channel Id: undefined
Length: 5min 52sec (352 seconds)
Published: Tue Nov 03 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.