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
This Week in AI: The Gap Is Getting Clearer User Avatar 38 comments 1 small portfolio change got me 10x more impressions User Avatar 24 comments 🚀 From Frustration to Foundation: The Indie Hacker Story Behind Building aDirectory User Avatar 22 comments Saving extra $1200 and 60 hours in 1 month User Avatar 14 comments A Tiny Side Project That Just Crossed 100 Users — And Somehow Feels Even More Real Now User Avatar 13 comments From 1k to 12k visits: all it took was one move. User Avatar 11 comments