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'm a lawyer who launched an AI contract tool on Product Hunt today — here's what building it as a non-technical founder actually felt like User Avatar 152 comments Never hire an SEO Agency for your Saas Startup User Avatar 92 comments A simple way to keep AI automations from making bad decisions User Avatar 66 comments “This contract looked normal - but could cost millions” User Avatar 54 comments 👉 The most expensive contract mistakes don’t feel risky User Avatar 41 comments Are indie makers actually bad customers? User Avatar 35 comments