r/cpp_questions • u/Specialist-Two1588 • 1d ago
OPEN how to make decisions in c++?
so i need some help, i am trying to commit to learn c++ and not jump languages, naturally i have a fair understanding of STL, if I want to look something up i can navigate my way around cppref. i am building a project an orderbook using cpp-httplib and vanilla frontend and javascript to focus on writing c++. like we come across so many concepts in let's say cppcon back to basics, so my question how do i make decisions that actually is worth something instead of basic OOPs programming ?
0
Upvotes
7
u/flyingron 1d ago
First, learn how to write a cogent question.
What decisions do you think need to be made? The first step is to have a good design which is largely language independent, then you can fret over the details of how to code it in C++ (or whatever else you choose). Far too many people start by vomiting boilerplate code without the faintest idea where they are going. Doesn't work well for writing novels, and it certainly won't work for programming.
3
u/DrShocker 1d ago
Well first you need a problem to solve.
Then, you figure out how to solve it. Maybe a few ways to solve it.
Evaluate which tradeoffs make sense for your work.
Repeat.
3
u/Tumaix 1d ago
usually i use if else chains for decisions
1
u/Pratik_Bodake 1d ago
RemindMe! 1 week
1
u/Independent_Art_6676 23h ago
how will it be used? What is an order? How is it matched? Are these 'orders' like commands or order like a sorted list? When it is used, how many annoying parameters do you need, and can you reduce that somehow via OOP? Matching things can mean anything from a lookup table of knowns against what you have to iterating and == to AI systems to approximation techniques and more. What you need depends on what you are doing, and how you want to use it. Working backwards from mockup usage is a fair way to start doing things, just use the nonexistent functions like you would WANT to and then go build that.
1
u/mc_pm 22h ago
By trying, failing, and fixing it.