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
Meme marketing for startups 🔥 User Avatar 11 comments Google Whisk - Generate images using images as prompts, not text prompts User Avatar 1 comment After 19,314 lines of code, i'm shutting down my project User Avatar 1 comment Need feedback for my product. User Avatar 1 comment We are live on Product Hunt User Avatar 1 comment Don't be a Jerk. Use this Tip Calculator. User Avatar 1 comment