YouTubevideo· Aug 9, 2024· 16:57
there's so much you can learn from just building things from getting out there and just creating something in fact that's why I call this series learning driven development because I think the best way to learn is actually by doing by building that Thing You Want to Build by learning that tool that you need to learn in order to build that thing that you want to build and on this episode we're going to be reading five lessons I learned from building my own Lille
package by Ash Allen so what do you need to learn in order to build something or what do you need to build in order to learn something so this is five lessons I learned from building my own Lille package by Ash Allen you can find Ash on GitHub Ash Allen that's ash- jc- Allen
on GitHub freelance Lille developer from Preston UK and then on Twitter SLX as Allen design that's Ash Allen design design so here is five lessons I learned from building my own Lille package and Ash has been incredibly gracious for the purpose of this episode he has two books battle ready laravel and consuming apis
in Lille you can find them in the show notes or the video description but he is giving five discount codes that I have ready to give away to anyone who is listening to this podcast or watching this video if you are on the podcast head over to YouTube That's YouTube Josh Siri and in the comments say keep creating and I will enter you to win a free copy of both of these books battle
ready Lille and consuming apis in lville I have five discount codes to give away so comment like subscribe and let's get into reading this five lessons I learned from building my own Lille package this was written by Ash on the 26th of May 2021 introduction during my Christmas holiday days at the end of 2019 I spent a bit of my free time building a larel package called larel exchange rates the
package is pretty simple and is just a wrapper for the exchang rates api. API with some cashing features added for performance at the time of writing this post the package has around 43,000 downloads and has started getting around 4,000 downloads per month it's not that big in comparison to some other projects but I'd like to think that I did something right for it to be getting that many downloads my main reason for building it was just so that I could experiment with packages as part of
using lville on a daily basis I gotten used to using lots of packages but I felt like the best way for me to properly understand how we use packages in larl was to build one myself by doing that I would be able to get an insight into every step of the process to try and improve my skills as a developer the entire development process was fun and taught me a lot here are the main things that I learned from building at larel exchange rates and that I pass on to other Developers one learn to take
criticism when I first started building the package I had only been working as a larel developer for around a year and a half so even though I had picked up the fundamentals of the framework there was still a lot I didn't know in comparison to now because of this I was already expecting to get criticism from more experienced developers after I'd built an initial version of the package I posted a link to the GitHub repository on Reddit on the Lille subreddit asking for opinions and feedback overall the feedback was useful and most people made
some really valid points about some of the code that could be improved I took their feedback on board and updated the parts that they mentioned however I did get some feedback that came across as criticism as an example one comment was just a link to an existing exchange rates package I wasn't too sure what to make of this but I took it as meaning what's the point in using yours there's already another one that exists as someone who was just starting out in web development and was quite excited to get a bit of feedback from the development
Community this was a bit demotivating because it made me think to myself what's the point in me actually doing it if someone else has already made it obviously looking back now though that probably wasn't the case and the commenter might not have meant it like that the important part is that if someone shuns your work or criticizes it don't let it get you down too much if it's possible try and find out why they criticized your work it can be good to sometimes take a step back and listen to other developers feedback to help you
improve but also bear in mind you don't know if the person you're taking feedback from is a top-notch developer or someone who only started writing hello world last week so it's really important to remember that the criticism won't always be valid top tip listen to the constructive criticism and use the feedback to improve your code but don't dwell on negative comments number two learn to look at code from someone else's perspective when I was building the package I found it really useful to
try and look at the package from another developer's perspective I tried to imagine how I would want to use the package if someone else had built it so my main focus was to keep the method names readable and reduce the amount of parameters that need to be passed to the methods sometimes when you're working on your own side projects especially ones that you're just building as a learning exercise it can be easy to let standards slip you might add a quick hack here and there to get something working instead
of spending a little bit more time to do something properly I wanted to try and avoid doing that with the package because I knew that it would be a Surefire way to put other developers off wanting to use it as developers we don't use packages purely for saving time we also use them to make our life easier it's such a great feeling when you install a new package into your project and it just works without having to mess around to get it working so I aim to provide that same feeling with this
package I wanted it to be installed and ready to go within a few lines of code without needing any complicated setup top tip if you can ask another developer you know to give your package a try and see if they run into any difficulties or have suggestions for improve improvements number three learn the importance of tests as any developer should know tests are crucial for any type of development whether it be a full-blown system or just a small
package thankfully I knew that early on in the process and made tests a priority when I'm looking at including a new package into my project one of the main things that I look at are if there are any tests they provide some form of proof that the code does what it says it should do assuming that the tests are written properly but that's for a whole other article without any tests written how are we supposed to have the confidence that the code works these tests then come in handy if you start to get other developers who want to
contribute to the package later down the line by using something like GitHub actions Travis Ci or Circle CI you can trigger your tests to run whenever a pull request is made to the package's repository this is extremely useful for letting yourself and the other developer know if the new changes break any existing functionality after all one thing that you want to ensure is ability if projects that use your package start running into issues with the new code it will likely get frustrating for them and
they may even remove your package and look for an alternative top tip make sure that you write tests to give yourself and other developers peace of mind that your code Works number four don't be scared to start again near the beginning of this article I said that I posted it on Reddit about the exchange rates package but that wasn't 100% the truth I actually posted about an earlier version of the package that I'd called coin verter converter was supposed to be the same as larel exchange rates except from it was
going to use the adapter pattern and support multiple apis rather than just exchange rates API the idea behind it was that a developer could just update their WV file to use a different exchange rates driver and change the API keys to switch between services without needing to update any of their code I spent quite a bit of time reading into the adapter pattern and I was quite excited to be working on the package but then I slowly started to realize that I'd B off more than I could Che and I wasn't experienced enough to do
something like this properly sure I got it to a working stage but I just never felt like it was done quite right so I decided to do what I mentioned earlier and I looked at it from another developer's perspective one of my main goals from the start of the package development was to try and make the package simple to set up and intuitive to use with a limited barrier to entry as a result of this I Ste back from the idea of using the adapter pattern for the sake of Simplicity I chose to use
just one service my reasoning behind using the exchang rates api. API was that it was free really easy to use and it didn't require any API keys or accounts to use at the time of building it I feel like by starting again and rebuilding the package I managed to strip away a lot of unnecessary code that was just going to be adding unneeded complexity the end result was a much simpler package that was easier to maintain test and use top tip don't be
worried about deleting your code and starting again the fact that you know to start again shows that you're learning and can spot your mistakes to improve next time number five understand the importance of standards and documentation as part of any development standards and documentation are an absolute must by following a set standard in my case at the time psr-2 you can make sure that your code is in a format that is understandable by other developers by using a standard that's
well known you can also make it easier for other developers to contribute to your code because they'll be able to structure code to be in the same style as yours the documentation is also really important because it's the only thing really that's telling developers how to install your package and use it before I started to write my documentation I searched around and looked at other popular packages to see how theirs were laid out after doing this I wrote my documentation and provided clear steps on the project
prerequisites installation usage license and how to contribute whenever I look at new packages I read the documentation before deciding whether to install them I check out things like does this package solve the problem that I've got does it look easy to use are there examples of it being used all of these questions form my opinion on whether to install the package if the documentation isn't very good it might be a hint that the overall package quality might not be very good either this isn't always the
case though top tip make the package as easy as possible to install and use by writing thorough documentation with code examples in conclusion to recap I'd say whenever you're writing a new package listen to the the constructive criticism and use the feedback to improve your code but don't dwell on negative comments if you can ask other developers you know to give your package a try and see if they run into any difficulties or have suggestions for improvements make the package as easy as possible to install and use by writing thorough
documentation with code examples also make sure that you write tests to give yourself and other developers peace of mind that your code Works don't be worried about deleting your code and starting again the fact that you know to start again shows that you're learning and you can spot your mistakes to improve next time but most of all make sure that you're enjoying it and having fun while you're doing it like I said at the start of this video I've always been
under the mindset of the opinion I should say that it is best to learn something by actually completing the thing that you want to build usually if you go about wanting to oh how am I going to learn how to build a package the best way to do that isn't to necessarily watch a course course or read a tutorial and see how is everyone else doing this and then I'll learn how
to create it that's a good step throughout the process but usually you don't start building a package that way you start by creating the package and then figuring out okay what am I going to do here and then the learning comes when I say and I call this series learning driven development I basically mean that as you learn as you get up to the task that you need to to complete in this case building a package like ash
did as you come across that particular instance that particular challenge now you have something actual to learn Ash was building with you know different API sets and was going to say okay I'm going to convert all these different apis but then learned that was probably more that he could chew so then it's learning which is the best way to do this whether it's starting from scratch whether it's
uh finding a particular package that you know that you trust and how do they accomplish this pattern I see this a lot when you're building anything building a product or I do it with building tutorials with building demos for tutorials I take a look okay how has someone else use this particular section am I showing this the right way that I would want someone else to show it I think
that leads really nicely into the whole deleting everything and starting again you know what happens the second time you build something not only do you build it faster but you tend to not make the same mistakes if you're learning you tend to not make the same mistakes that you did the first time around take a look at any modern uh package or even just like open- source project there are
people that have probably built that from the ground up three or four times the package I love in laravel Livewire was rebuil bu probably multiple times before every single release because that's just something Caleb porio the Creator does for fun I usually if I don't like how a video is going there's sometimes where I've created and recorded an hour-long video about a particular demo or like uh building you
know a particular project within a video and I don't like how certain parts flowed when I pressed stop recording so I just deleted the video and stop start it again but you know what happens that second time I start recording or that third time or fourth time depending on how many times delete it and start again things flow more smoothly and how I talk
and how I type and how I research the small bugs that still come up it does it doesn't mean I do it flawlessly there's still edits that have to be made there's still things that I need to redo in the video uh when I finally get my thoughts out onto the screen into the camera but it's in a way that I feel comfortable with because it feels familiar a lot of times when you're learning simply redoing it repetition even if you're
learning from scratch in this way shape or form of of building a larel package or maybe you're you know creating a a product or something like that most of the times the second time you do it people's second businesses for example are always better because you have that repetition put in you have the idea of I made this mistake akake the first time it's fresh in my mind I'm not going to
make it again so anyways before I wrap this up I really enjoyed what Ash said here but uh if you go on to the YouTube video in the comments type keep creating two words doesn't matter how you put it but you'll be entered to win one of the five discount codes that I have that's 100% discount off for battle ready layer
of as well as consuming apis and Lille those two books by Ash who has been gracious to be able to give those for the purpose of this show but thank you so much for listening thank you for watching and one of the things I think that you should always keep in mind when you have this idea that you have that I'm like hey I want to learn something and now I need to find these different pieces and collect all these different pieces so that I can learn this so that
it comes to fruition in the end start by saying I'm going to figure out what this next step is and then the next step is and it might not be you're you're learning this all in one but I guarantee you the second time you do it the third time you do it and the fourth time you do it now people are going to be starting to look at your project your package your app your insert name here for an example where before you were
looking at others I've done a myself with creators with tutorial people with Educators with bu Builders with designers with developers every single time I do it I do the thing I get better at it and every single time I do the thing usually because I'm better at it the thing is usually better too so keep building keep
iterating keep creating [Music]