12
7 Comments

Difference between Wrapper and Container

I had always a dilemma if to use Wrapper or Container in my component name.
I finally found a good description where is this simple rule.

In programming languages, the word container is generally used for structures that can contain more than one element. A wrapper, on the other hand, is something that wraps around a single object to provide more functionality and interface to it.

I hope it will help you as well to have a good naming convention in your great project.

posted to Icon for group Developers
Developers
on September 6, 2020
  1. 2

    Yeah! Naming conventions are the clue for the project success!

  2. 2

    Thank you! I don’t know about it before 😀

    1. 1

      You are welcome :) Thank you for your comment

  3. 1

    Wrapper sounds like a hack to implement something without changing 500 other places in your code.

    Container sounds like you had a plan.

    Just choose something and go.

    1. 1

      Hi @zoftbase. It can sound like it but I see it as a great name suffix for cover around 3rd party component where you are not going to change their code.

  4. 1

    That’s a great convention!

Trending on Indie Hackers
I shipped a productivity SaaS in 30 days as a solo dev — here's what AI actually changed (and what it didn't) User Avatar 218 comments Never hire an SEO Agency for your Saas Startup User Avatar 103 comments A simple way to keep AI automations from making bad decisions User Avatar 68 comments Are indie makers actually bad customers? User Avatar 37 comments We automated our business vetting with OpenClaw User Avatar 36 comments I sent 10 cold DMs about failed Stripe payments. Here's what actually happened. User Avatar 33 comments