Martin Baun
Martin Baun
  • 136
  • 37 982
DRY Software Principle makes you CRY
You’re building software
and now you want to make it more maintainable
some would even say make the code great, again
One way to do this is DRY
But usually, DRY is overused
AND DRY will make you CRY
Here’s how to use DRY well
Let’s get to it
Problems with DRY
The DRY software pattern is a dangerous one
The reason is pretty simple,
How do you balance DRY?
Well, the opposite of DRY is...
WET
Write Everything Twice
So the balance is between
something bad and something good
With this, you tend to go too much in one direction
In other words,
So how do we balance DRY and WET?
When to use DRY
The DRY software principle is hard to administer correctly
Senior developers might even argue for or against
Experience will teach you when it was a bad idea to use it
Because that’s how it works with DRY
Mostly, you’ll figure out when it wasn’t supposed to be used
When you have a function that can do everything and is impossible to refactor
I have some rules of thumb you can follow here
If you’re in doubt, don’t use DRY. Copy-paste is often better.
Use DRY when you truly do repeat. Not when things are similar. You can usually see this if there are if statements in the DRY entity
Only use DRY when you’re repeating yourself at least 4 times
They’re not perfect,
so take them with a big grain of salt
Do this instead
Before you even start using the DRY software principle
you should probably just make utility functions
How to use DRY
Here’s the secret sauce on how to use
the do not repeat software pattern
Keep your DRY abstractions simple
Then when you get to refactor or add
it should be a lot easier
Favor functions over classes
Again, simplicity.
Classes and other data structures will complicate your functionality
instead, just make a function
Inject behavior instead of complicating the DRY entity
For example, we have a runcron implementation
Instead of accepting a type of corn, it should run
or what database it should use
we just inject these dependencies.
This makes it extremely versatile
as our runcron code can run on many different projects
using different databases and functions
def runcron(db, name, func, on_error):
มุมมอง: 51

วีดีโอ

SaaS 02 Simple Business Plan - Lean Canvas
มุมมอง 534 ชั่วโมงที่ผ่านมา
You want to build a SaaS, or optimize your workflow? Then you’re in the right place, my friend. In today's episode, we’ll go through the thing nobody wants to do The dreaded Business Plan. but I am going to show you an easy way We’ll use Pareto’s law and make something in a day instead of spending 3 months on some business bullshit bingo Let’s get to it Business Plans Business plans are intimid...
Bad Optimizations in Business and Life
มุมมอง 8719 ชั่วโมงที่ผ่านมา
You’re probably doing optimizations you shouldn’t. Here I’ll go through some of the typical Business optimizations that are actually terrible If you like that, then consider subscribing And let’s get to it Bad Optimizations in software businesses? Bad Optimization do they even exist? Yes they do in both business and personal life. Let’s say you have diarrhea all the time and the way you optimiz...
SaaS Building Episode 01 Concept & Idea
มุมมอง 258วันที่ผ่านมา
You want to build a SaaS, or optimize your workflow, then you’re the right place my friend Todays’ episode we’ll go through the conceptualization and ideation of my mini SaaS It isn’t actually a SaaS as I wont try to sell it but all the steps are illustrative of how to build a SaaS So you’ll see how to improve your own work flow or guide through the your own creation of a SaaS Simple Tools I li...
SaaS Building Episode 00 Intro
มุมมอง 14914 วันที่ผ่านมา
You want to build a SaaS, Or get inspiration for your workflow? Then you’re the right place my friend. This is a no bs step-by-step guide on building an simple SaaS product you’ll see all the tools needed and how they’re used and mindset that helps you build faster Maybe this can inspire you to start your own thing It is not as hard to build the thing as you might expect and this video series i...
YouTube? How to start
มุมมอง 10914 วันที่ผ่านมา
You wanna start YouTubing? Well, you found the right place I’ll go over how I started How is it going and how you can do it as well. Why should you listen to me instead of Mr Beast? If you’re just starting out it’s better to learn from people at your level The things that work for Mr Beast probably won't work for you or me Let’s get to it Succeed on TH-cam? How do you succeed on TH-cam? Just st...
Meetings Suck, what to do?
มุมมอง 7221 วันที่ผ่านมา
Meetings Suck, what to do?
Securing Servers 2024
มุมมอง 14721 วันที่ผ่านมา
Securing Servers 2024
SQLite in Production - Master Course
มุมมอง 1.6Kหลายเดือนก่อน
SQLite in Production - Master Course
Boost Productivity with Checklists
มุมมอง 103หลายเดือนก่อน
Boost Productivity with Checklists
Get What You Want #productivity #advice #colaboration #worksmart
มุมมอง 752 หลายเดือนก่อน
Get What You Want #productivity #advice #colaboration #worksmart
3 Terrible Advice #productivity #lifelessons #advice #lifeadvice #2024
มุมมอง 382 หลายเดือนก่อน
3 Terrible Advice #productivity #lifelessons #advice #lifeadvice #2024
What is Goleko? Manage Projects Better #productivity #projectmanagement #businesstools
มุมมอง 2533 หลายเดือนก่อน
What is Goleko? Manage Projects Better #productivity #projectmanagement #businesstools
Golang is OG?
มุมมอง 2.8K3 หลายเดือนก่อน
Golang is OG?
SQLite is enough
มุมมอง 7K3 หลายเดือนก่อน
SQLite is enough
Micromanagement is great
มุมมอง 703 หลายเดือนก่อน
Micromanagement is great
Frontend JavaScript suck, here's why but not how to fix it
มุมมอง 1424 หลายเดือนก่อน
Frontend JavaScript suck, here's why but not how to fix it
Cycle Off Coffee
มุมมอง 1134 หลายเดือนก่อน
Cycle Off Coffee
The Cloud Sucks, and here’s why
มุมมอง 1754 หลายเดือนก่อน
The Cloud Sucks, and here’s why
Best Project Management Tool Upgrade #projectmanagement #productivity #entrepreneur #productivity
มุมมอง 404 หลายเดือนก่อน
Best Project Management Tool Upgrade #projectmanagement #productivity #entrepreneur #productivity
1 Advice
มุมมอง 484 หลายเดือนก่อน
1 Advice
Almost died in Medellin, Colombia, not what you think #traveling #colombia #medellin #lifeistooshort
มุมมอง 4874 หลายเดือนก่อน
Almost died in Medellin, Colombia, not what you think #traveling #colombia #medellin #lifeistooshort
7 Tips for Communication
มุมมอง 515 หลายเดือนก่อน
7 Tips for Communication
What Is Goleko? Manage Projects Easily - simple yet powerful
มุมมอง 2175 หลายเดือนก่อน
What Is Goleko? Manage Projects Easily - simple yet powerful
Go super generics - less code, more done #golang
มุมมอง 2718 หลายเดือนก่อน
Go super generics - less code, more done #golang
Mockups are terrible, do THIS instead
มุมมอง 588 หลายเดือนก่อน
Mockups are terrible, do THIS instead
Learnings growing my company the last 2 weeks | Build In Public 33
มุมมอง 399 หลายเดือนก่อน
Learnings growing my company the last 2 weeks | Build In Public 33
TWITTER IS BACK FROM VACATION | buildinpublic review week 31
มุมมอง 479 หลายเดือนก่อน
TWITTER IS BACK FROM VACATION | buildinpublic review week 31
TestingHelper.com Explained in 59 seconds
มุมมอง 8K9 หลายเดือนก่อน
TestingHelper.com Explained in 59 seconds
Build In Public Week 30
มุมมอง 2310 หลายเดือนก่อน
Build In Public Week 30

ความคิดเห็น

  • @RealDevastatia
    @RealDevastatia 9 ชั่วโมงที่ผ่านมา

    SQLite and MySQL are both enabled in PHP by default, and there's a PDO interface for both. So there's little difference there as far as usability goes. You can also write SQLite aggregate functions in PHP and call them in your SQL queries.

  • @mercykavutha7892
    @mercykavutha7892 17 ชั่วโมงที่ผ่านมา

    Very smart thinking. Nice!

    • @MartinBaun
      @MartinBaun 11 ชั่วโมงที่ผ่านมา

      Gracias Mercy

  • @thetechpreneur
    @thetechpreneur 20 ชั่วโมงที่ผ่านมา

    Soo true

    • @MartinBaun
      @MartinBaun 11 ชั่วโมงที่ผ่านมา

      thanks :))) Have an awesome weekeend

  • @thomasborg4442
    @thomasborg4442 20 ชั่วโมงที่ผ่านมา

    Dry makes you cry 😂😂😂

    • @MartinBaun
      @MartinBaun 11 ชั่วโมงที่ผ่านมา

      You got it ;)

  • @elvismurseli9919
    @elvismurseli9919 21 ชั่วโมงที่ผ่านมา

    🔥🔥

    • @MartinBaun
      @MartinBaun 11 ชั่วโมงที่ผ่านมา

      thanks Elvis!

  • @joshuabiyinzika2834
    @joshuabiyinzika2834 21 ชั่วโมงที่ผ่านมา

    Hey Martin, I counted the number of times you said "DRY" and they're upwards of 12. Don't you think your video is violating the DRY principle?? Ofc i'm kidding. #MessingWithYou xD I try to keep dry code at a minimum as much as I can. If I'm in a rush, I have a lot of dry, but I always come back and clean up. Thanks for the video :)

    • @MartinBaun
      @MartinBaun 20 ชั่วโมงที่ผ่านมา

      hehehe, good one Joshua! I should have simplified it to "X" that sounds like a good solution, it's very similar to what I do. A little copy/paste is often better and when you need to expand on the code you can go back and refactor a little :))

  • @kristinakristina6426
    @kristinakristina6426 21 ชั่วโมงที่ผ่านมา

    cool, I like this approach👍

    • @MartinBaun
      @MartinBaun 11 ชั่วโมงที่ผ่านมา

      Thank you :))

  • @PinnedBeats
    @PinnedBeats 21 ชั่วโมงที่ผ่านมา

    The more you know👀 Great content!

    • @MartinBaun
      @MartinBaun 11 ชั่วโมงที่ผ่านมา

      Exactly!

  • @mikhail_skvorchynskyi
    @mikhail_skvorchynskyi วันที่ผ่านมา

    Keep going man, good piece of info

  • @elvismurseli9919
    @elvismurseli9919 วันที่ผ่านมา

    🔥🔥

  • @user-bw1uk9ow5h
    @user-bw1uk9ow5h วันที่ผ่านมา

    I enjoyed this video, but please get rid of these annoying subtitles

    • @MartinBaun
      @MartinBaun 11 ชั่วโมงที่ผ่านมา

      Thank you! We have gotten rid of this in the newest videos :)

  • @kristinakristina6426
    @kristinakristina6426 วันที่ผ่านมา

    very good)

  • @PinnedBeats
    @PinnedBeats วันที่ผ่านมา

    FAQ - so cringe ))

    • @thomasborg4442
      @thomasborg4442 วันที่ผ่านมา

      I like it if it's an interesting person

    • @thomasborg4442
      @thomasborg4442 วันที่ผ่านมา

      Yeah, bigger accounts if there interesting can do faqs, probably not for you and me

  • @thetechpreneur
    @thetechpreneur 2 วันที่ผ่านมา

    here is some feedback: 1) Zoom out the camera angle is a bit awkard 2) Add full images with transition when making cutaway memes makes it look much cleaner 3) Add a more interestig background maybe in an office or somewhere else to create more authority? 4) I love the basic idea and where you want to go BUT what you gave is a bit plain in the way you gave it 5) Rather then talking about the business plan and the steps give real life examples Why did you start to use them? When did you realise you needed the structure? Give a story of how you failed without it? Give your light bulb momennt? Give a story of when you implemented the first and the results I think people like when they hear about your struggles and how the lightbulb moments help (Hope i wasn't too harsh)!

  • @thetechpreneur
    @thetechpreneur 2 วันที่ผ่านมา

    looks great amazing job! you can really see the direction you are going in!

  • @vincentdrews4341
    @vincentdrews4341 2 วันที่ผ่านมา

    Thanks for the video and the recommendation!!!

    • @MartinBaun
      @MartinBaun 2 วันที่ผ่านมา

      Anytime, if you have any special requests or questions just write!

  • @mercykavutha7892
    @mercykavutha7892 2 วันที่ผ่านมา

    The last point was the best of all. Also great sense of humor!😅

    • @MartinBaun
      @MartinBaun 2 วันที่ผ่านมา

      Thank you :))

  • @joshuabiyinzika2834
    @joshuabiyinzika2834 2 วันที่ผ่านมา

    Many, many thanks for this vid. Lean canvas varies slightly from Business generation model canvas which I've used in the past. PS. "Girls with d**ks" this one killed me 🤣 That value prop is nuts!

    • @MartinBaun
      @MartinBaun 2 วันที่ผ่านมา

      Hey Joshua! I think the people behind the Lean Canvas took the Business model canvas and adapted it to more "lean-software" based type of projects. Thanks! I try to make it as light hearted as possible and my editor is an absolute savage with the memes hehe. Next video is about how to apply it, I am working on it right now. You'd wouldn't want to miss it ;) And next next video will be finding the domain!

  • @kristinakristina6426
    @kristinakristina6426 2 วันที่ผ่านมา

    thanks for sharing your experience and great ideas

    • @MartinBaun
      @MartinBaun 2 วันที่ผ่านมา

      Thank you! :))

  • @PinnedBeats
    @PinnedBeats 2 วันที่ผ่านมา

    lean canvas is something people need to know

    • @MartinBaun
      @MartinBaun 2 วันที่ผ่านมา

      Yea exactly!

  • @thomasborg4442
    @thomasborg4442 2 วันที่ผ่านมา

    Yeah, waited for this one! ❤

    • @MartinBaun
      @MartinBaun 2 วันที่ผ่านมา

      Thanks!

  • @vitalyl1327
    @vitalyl1327 3 วันที่ผ่านมา

    Nah. I'm not going to use Go for anything, ever. It's got a GC, which disqualifies it immediately for most of the use cases I care about. It's a very low level language with zero capacity for defining abstraction, which makes Go code immediately overbloated, extremely verbose, so you won't see the forest behind the trees, you won't be able to see the business logic behind such a verbose code. Those new developers you're talking about will be absolutely perplexed by your bloated code base and will take a very long time understanding what it's doing. "Simplicity" of the language is a red herring, simple languages make code more complex.

    • @MartinBaun
      @MartinBaun 2 วันที่ผ่านมา

      Hey Vitaly, , I would just caution this kinda thinking and instead try Go on a real project and see how it goes. Go is a special one yes, but for a reason. I just visited an medium sized project in Go that was structured terribly (my fault) and I also didn't do 90% of the code here. It took me no time to find and fix the thing I needed to do. In Python, good luck. In C# Good luck. In JavaScript... forget it.

    • @vitalyl1327
      @vitalyl1327 2 วันที่ผ่านมา

      @@MartinBaun yes, Golang tooling is exceptional and you can get a lot from it. But the language limitations unavoidably affect the code base quality even if all the best practices are followed. It is particularly harmful where the safety and reliability requirements are very high (and reasoning about the code is hard because of the low level and lot of ritual), where performance is important (and there are no ways to implement any zero cost abstractions), where problem domain itself is complex (e.g., scientific compute areas, robotics, etc.) and you absolutely need to express higher levels of abstraction. I tried Golang a few times, was very impressed by the tooling and then put off by the very quickly bloating code base and tons of unavoidable boilerplate on levels not seen even with C++.

  • @UuU1001.
    @UuU1001. 3 วันที่ผ่านมา

    Why would you use Dorian develops TH-camr as your thumbnail pic? Oh wait he’s a software developer that’s why, makes sense

    • @MartinBaun
      @MartinBaun 2 วันที่ผ่านมา

      hehe ;)

  • @dagulya
    @dagulya 3 วันที่ผ่านมา

    Great job balancing critique with appreciation!

    • @MartinBaun
      @MartinBaun 3 วันที่ผ่านมา

      Thank you! Tell me if you need more :)

  • @thomasborg4442
    @thomasborg4442 3 วันที่ผ่านมา

    Sooo many memes i love it. And htmx is the way to go 🎉

    • @MartinBaun
      @MartinBaun 11 ชั่วโมงที่ผ่านมา

      awesome!

  • @kristinakristina6426
    @kristinakristina6426 3 วันที่ผ่านมา

    php -_-

  • @mercykavutha7892
    @mercykavutha7892 3 วันที่ผ่านมา

    A lot gets done when you simplify 💯

    • @MartinBaun
      @MartinBaun 3 วันที่ผ่านมา

      Exactly! simple things get htings done

  • @PinnedBeats
    @PinnedBeats 3 วันที่ผ่านมา

    HTMX is the small beast.

    • @MartinBaun
      @MartinBaun 3 วันที่ผ่านมา

      Exactly ;)

  • @astrozen28
    @astrozen28 3 วันที่ผ่านมา

    ❤❤❤

    • @MartinBaun
      @MartinBaun 3 วันที่ผ่านมา

      Thanks Mr Astro ;)

  • @goonnguyen
    @goonnguyen 4 วันที่ผ่านมา

    I'm still not brave enough to do a video of myself, you're doing good bro 😎

    • @MartinBaun
      @MartinBaun 4 วันที่ผ่านมา

      Thank you! :) well, it is all about practice. I wasn't in the start either... actually still aren't. But you get better at it :) and you can cut away the bloobers. I might ask my editor just to make a video of bloobers hehe

  • @thomasborg4442
    @thomasborg4442 4 วันที่ผ่านมา

    Smart, didn't think about that

    • @MartinBaun
      @MartinBaun 4 วันที่ผ่านมา

      yeah, that's the way to start it

  • @elvismurseli9919
    @elvismurseli9919 4 วันที่ผ่านมา

    🔥🔥

    • @MartinBaun
      @MartinBaun 4 วันที่ผ่านมา

      Thanks Elvis!

  • @kristinakristina6426
    @kristinakristina6426 4 วันที่ผ่านมา

    exactly)

    • @MartinBaun
      @MartinBaun 4 วันที่ผ่านมา

      Da!

  • @PinnedBeats
    @PinnedBeats 4 วันที่ผ่านมา

    Yeees!

    • @MartinBaun
      @MartinBaun 4 วันที่ผ่านมา

      thanks Kosta!

  • @thetechpreneur
    @thetechpreneur 5 วันที่ผ่านมา

    100%%%%

    • @MartinBaun
      @MartinBaun 5 วันที่ผ่านมา

      thank you, soon releasing the next version! Stay tuned The Techpreneur! PS. I love your name :)

    • @MartinBaun
      @MartinBaun 2 วันที่ผ่านมา

      Hey new video in this series ;) th-cam.com/video/3R7LJC7pIUw/w-d-xo.html

  • @SM-ok3sz
    @SM-ok3sz 5 วันที่ผ่านมา

    I want to have YAGNI tattooed on my team’s architect’s forehead.

    • @MartinBaun
      @MartinBaun 5 วันที่ผ่านมา

      It should be mandatory at least as an tattoo on the forearm. It is easier to see when they start architecting their grand solutions that eventually becomes tragic problems.

  • @angelapalacios4274
    @angelapalacios4274 6 วันที่ผ่านมา

    Starting is the essential step 😊

    • @MartinBaun
      @MartinBaun 6 วันที่ผ่านมา

      exactly Angela Palacios

  • @mercykavutha7892
    @mercykavutha7892 6 วันที่ผ่านมา

    Great tips!!

    • @MartinBaun
      @MartinBaun 6 วันที่ผ่านมา

      Great you like them!

  • @rudraksha-8506
    @rudraksha-8506 7 วันที่ผ่านมา

    God bless you Buddy ❤

    • @MartinBaun
      @MartinBaun 7 วันที่ผ่านมา

      Thank you Rudraksha!

  • @AnastasiiaSyrykh
    @AnastasiiaSyrykh 7 วันที่ผ่านมา

    so true

    • @MartinBaun
      @MartinBaun 7 วันที่ผ่านมา

      Gracias Nastya

  • @thomasborg4442
    @thomasborg4442 7 วันที่ผ่านมา

    Slow then suddenly works both with going bankrupt and going viral

    • @MartinBaun
      @MartinBaun 7 วันที่ผ่านมา

      Exactly!

  • @kristinakristina6426
    @kristinakristina6426 7 วันที่ผ่านมา

    you're a great motivator)

    • @MartinBaun
      @MartinBaun 7 วันที่ผ่านมา

      thank you Kristi!

  • @PinnedBeats
    @PinnedBeats 7 วันที่ผ่านมา

    true true!

    • @MartinBaun
      @MartinBaun 7 วันที่ผ่านมา

      Thanks Pinned :)

  • @mrkostya008
    @mrkostya008 8 วันที่ผ่านมา

    But what does Johnny Sins have to do with this 😭😭💀

    • @MartinBaun
      @MartinBaun 7 วันที่ผ่านมา

      So many girls say to me > Don't I know you from some where? I say > Johnny Sin Immediately they say > YES! and then they get all red in their face :D

    • @UuU1001.
      @UuU1001. 3 วันที่ผ่านมา

      That’s the programmer TH-camr Dorian develops

    • @MartinBaun
      @MartinBaun 2 วันที่ผ่านมา

      @@UuU1001. yeeea don't think so hehe.

  • @elvismurseli9919
    @elvismurseli9919 8 วันที่ผ่านมา

    🔥🔥

    • @MartinBaun
      @MartinBaun 7 วันที่ผ่านมา

      Thanks Elvis

  • @kristinakristina6426
    @kristinakristina6426 8 วันที่ผ่านมา

    Good thoughts

    • @MartinBaun
      @MartinBaun 7 วันที่ผ่านมา

      Mercy Kristi!

  • @AnastasiiaSyrykh
    @AnastasiiaSyrykh 8 วันที่ผ่านมา

    🤔🤔

    • @MartinBaun
      @MartinBaun 7 วันที่ผ่านมา

      Thinking hat :)

  • @thomasborg4442
    @thomasborg4442 8 วันที่ผ่านมา

    Yeyeye best example ever

    • @MartinBaun
      @MartinBaun 7 วันที่ผ่านมา

      Didn't know if it was too much hehe

  • @PinnedBeats
    @PinnedBeats 8 วันที่ผ่านมา

    So true :D

    • @MartinBaun
      @MartinBaun 7 วันที่ผ่านมา

      Thanks!

  • @elvismurseli9919
    @elvismurseli9919 9 วันที่ผ่านมา

    Nice 🔥

    • @MartinBaun
      @MartinBaun 7 วันที่ผ่านมา

      Thanks Elvis!