Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 144857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:19:13+00:00 2026-05-11T08:19:13+00:00

Recently, I’ve got a dangerous idea into my head after reading this blog post.

  • 0

Recently, I’ve got a dangerous idea into my head after reading this blog post. That idea can be expressed like this:

I don’t need most of what the C++ standard library offers. So, why don’t I implement a less general, but easier to use version?

As an example, using the STL spits out reams of incomprehensible and mangled compiler errors. But, I don’t care about allocators, iterators and the like. So why don’t I take a couple of hours and implement an easy to use linked list class, for example?

What I’d like to know from the StackOverflow community is this: what are the dangers, possible disadvantages and possible advantages to ‘rolling my own’ for most of the existing functionality in C++?

Edit: I feel that people have misunderstood me about this idea. The idea was to understand whether I could implement a very small set of STL functionality that is greatly simplified – more as a project to teach me about data structures and the like. I don’t propose re-inventing the entire wheel from the ground up, just the part that I need and want to learn about. I suppose what I wanted to figure out is whether the complexity of using the STL warrants the creation of smaller, simpler version of itself.

Re-using boost or similiar.

Most of what I code is for University and we’re not allowed to use external libraries. So it’s either the C++ standard library, or my own classes.

Objectivity of this question.

This question is not subjective. Nor should it be community Wiki, since it’s not a poll. I want concrete arguments that highlight one advantage or one disadvantage that could possibly occur with my approach. Contrary to popular belief, this is not opinion, but based on experience or good logical arguments.

Format.

Please post only one disadvantage or one advantage per answer. This will allow people to evaluate individual ideas instead of all your ideas at once.

And please…

No religious wars. I’m not a fan boy of any language. I use whatever’s applicable. For graphics and data compression (what I’m working on at the moment) that seems to be C++. Please constrain your answers to the question or they will be downvoted.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T08:19:14+00:00Added an answer on May 11, 2026 at 8:19 am

    So, why don’t I implement a less general, but easier to use version?

    Because you can’t. Because whatever else you might say about C++, it is not a simple language, and if you’re not already very good at it, your linked list implementation will be buggy.

    Honestly, your choice is simple:

    Learn C++, or don’t use it. Yes, C++ is commonly used for graphics, but Java has OpenGL libraries too. So does C#, Python and virtually every other language. Or C. You don’t have to use C++.

    But if you do use it, learn it and use it properly.

    If you want immutable strings, create your string as const.

    And regardless of its underlying implementation, the STL is remarkably simple to use.

    C++ compiler errors can be read, but it takes a bit of practice. But more importantly, they are not exclusive to STL code. You’ll encounter them no matter what you do, and which libraries you use. So get used to them. And if you’re getting used to them anyway, you might as well use STL too.

    Apart from that, a few other disadvantages:

    • No one else will understand your code. If you ask a question on SO about std::vector, or bidirectional iterators, everyone who’s reasonably familiar with c++ can answer. If you ask abut My::CustomLinkedList, no one can help you. Which is unfortunate, because rolling your own also means that there will be more bugs to ask for help about.
    • You’re trying to cure the symptom, rather than the cause. The problem is that you don’t understand C++. STL is just a symptom of that. Avoiding STL won’t magically make your C++ code work better.
    • The compiler errors. Yes, they’re nasty to read, but they’re there. A lot of work in the STL has gone into ensuring that wrong use will trigger compiler errors in most cases. In C++ it’s very easy to make code that compiles, but doesn’t work. Or seems to work. Or works on my computer, but fails mysteriously elsewhere. Your own linked list would almost certainly move more errors to runtime, where they’d go undetected for a while, and be much harder to track down.
    • And once again, it will be buggy. Trust me. I’ve seen damn good C++ programmers write a linked list in C++ only to uncover bug after bug, in obscure border cases. And C++ is all border cases. Will your linked list handle exception safety correctly? Will it guarantee that everything is in a consistent state if creating a new node (and thereby calling the object type’s constructor) throws an exception? That it won’t leak memory, that all the appropriate destructors will be called? Will it be as type-safe? Will it be as performant? There are a lot of headaches to deal with when writing container classes in C++.
    • You’re missing out on one of the most powerful and flexible libraries in existence, in any language. The STL can do a lot that would be a pain even with Java’s giant bloated class library. C++ is hard enough already, no need to throw away the few advantages it offers.

    I don’t care about allocators, iterators and the like

    Allocators can be safely ignored. You pretty much don’t even need to know that they exist. Iterators are brilliant though, and figuring them out would save you a lot of headaches. There are only three concepts you need to understand to use STL effectively:

    • Containers: You already know about these. vectors, linked lists, maps, sets, queues and so on.
    • Iterators: Abstractions that let you navigate a container (or subsets of a container, or any other sequence of value, in memory, on disk in the form of streams, or computed on the fly).
    • Algorithms: Common algorithms that work on any pair of iterators. You have sort, for_each, find, copy and many others.

    Yes, the STL is small compared to Java’s library, but it packs a surprising amount of power when you combine the above 3 concepts. There’s a bit of a learning curve, because it is an unusual library. But if you’re going to spend more than a day or two with C++, it’s worth learning properly.

    And no, I’m not following your answer format, because I thought actually giving you a detailed answer would be more helpful. 😉

    Edit:

    It’d be tempting to say that an advantage of rolling your own is that you’d learn more of the language, and maybe even why the STL is one of its saving graces.. But I’m not really convinced it’s true. It might work, but it can backfire too.

    As I said above, it’s easy to write C++ code that seems to work. And when it stops working, it’s easy to rearrange a few things, like the declaration order of variables, or insert a bit of padding in a class, to make it seemingly work again. What would you learn from that? Would that teach you how to write better C++? Perhaps. But most likely, it’d just teach you that ‘C++ sucks’. Would it teach you how to use the STL? Definitely not. A more useful approach might be utilizing the awesome power of StackOverflow in learning STL the right way. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 64k
  • Answers 64k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer NSCoding will do exactly what you want. I recommend you… May 11, 2026 at 10:54 am
  • added an answer Don't you need to use a value converter there instead… May 11, 2026 at 10:54 am
  • added an answer I would just do an LDAP query directly. This is… May 11, 2026 at 10:54 am

Related Questions

Recently, I started changing some of our applications to support MS SQL Server as
Recently, I've been dealing with an error with accessing MAPI via the .NET framework
Recently, I read an article entitled SATA vs. SCSI reliability . It mostly discusses
Recently, I've started having a problem with my SQL Server 2005 client running on
Recently, I noticed some people mentioning that std::list::size() has a linear complexity. According to
Recently, I made a post about the developers I'm working with not using try
Recently, I found myself having to write up some concerns I have about race
recently I downloaded this open source project and I am trying to compile it.
Recently, I've been reading up on the IRC protocol (RFCs 1459, 2810-2813), and I
I recently became aware that the strdup() function I've enjoyed using so much on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.