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
Why Indie Founders Fail: The Uncomfortable Truths Beyond "Build in Public" User Avatar 109 comments I built a tool that turns CSV exports into shareable dashboards User Avatar 91 comments $0 to $10K MRR in 12 Months: 3 Things That Actually Moved the Needle for My Design Agency User Avatar 71 comments The “Open → Do → Close” rule changed how I build tools User Avatar 57 comments I got tired of "opaque" flight pricing →built anonymous group demand →1,000+ users User Avatar 43 comments A tweet about my AI dev tool hit 250K views. I didn't even have a product yet. User Avatar 42 comments