DEV Community

Yilong Wu
Yilong Wu

Posted on

My STL Post Sparked a Real Discussion — Here's Where It Landed

Algorymer came back with more thoughts after the AoC article. The conversation drifted from "which container to use" to something bigger: is the tool even the point?


The argument, summarized

Their point: the real skill isn't picking between vector and map. It's breaking down a problem on paper first. Language and data structures are just implementation details. A good solution works in any language.

They're not wrong.


Where I agree

When I solve problems on Luogu, I sketch on scratch paper before typing. Not because it looks smart — because jumping straight to code means rewriting everything three times.

The container choice comes after you understand the problem. If you don't know what operations you need, how can you pick the right tool?


Where I still disagree (respectfully)

Yes, the core skill is problem-solving. But here's the thing: if your go-to solution for every problem is int arr[1000], you're making the problem-solving step harder too. You're translating the problem into a form your limited toolbox can handle, instead of into its natural shape.

Picking the right container IS part of problem-solving. It's not separate from it.


The middle ground

Someone in the thread said: use pen and paper, use imagination, the language doesn't matter.

I'd say: use pen and paper first. But when you reach for the keyboard, reach for the tool that matches your mental model. If your brain sees stacks, type stack. If your brain sees key-value pairs, type map. That way the code validates your thinking instead of fighting it.


Thanks Algorymer for pushing the discussion beyond syntax. That's the good stuff.

My GitHub: https://github.com/Cn-Alanwu

Top comments (4)

Collapse
 
algorhymer profile image
sassenheimer

Okay... I'll be straight with you:

I am not philosophizing.
I am not trying to make a philosophical argument.
I am literally saying that the solution path which was discussed so far will not work.
I am literally saying that the current solution path has a time and additional space complexity which will NOT work, with the following bounds:

  • There are at most 10 stacks.
  • You'll get an input with 80 000 lines of move 393742347236428342386 from 1 to 2. Please understand:

I will not spoil the fun for you, because I think you are on the right path.
I'll give you a Computer Science hint, by sharing a scene from the movie Tenet.
Please watch this scene and write down what the lady scientist says.
It begins by 'One of these bullets is like us...'.

I'm not trying to make a philosophical argument.
I personally do not have an opinion about data structures.
In this discussion I do not even care about hash tables, vectors, arrays or whatever.

I'm trying to sass you into breaking your chains, that the problem statement put on you.
It sneakily imprisoned your imagination.

Collapse
 
alanwu profile image
Yilong Wu

Sorry bro, I may have misunderstood some parts of what you said because I am using a translator (I am only in junior high school and my English is not very good)

Collapse
 
algorhymer profile image
sassenheimer

No worries. Also I write in quite crazy metaphorical ways, so it is not your problem alone, but me being a bit tall tale-ish.
But... please keep up the roleplay, Jon.
Tha an taigh-cluiche glè chudromach.

Here's the last hint...
Read it at your own caution:
What is the difference between an online algorithm and an offline algorithm in the context of competitive programming?

Some comments may only be visible to logged-in visitors. Sign in to view all comments.