by oldsklgdfth · 5y ago · 0 comments
Push-ups are almost universal in fitness tests. They are a solid proxy for strength. Additionally, they are an exercise that is manageable enough that you can do daily and reap significant returns if you do them consistently.
What are the push-ups of programming? More specifically for me, c++.
I mean, sure, you can do Project Euler (or many other things), but you can also work on cool projects. I'm writing a superoptimizer (and I have C++ coding stuff at work). For both, I make a conscious effort to try to figure out better ways of doing that stuff (rather than just banging out ancient idiomatic C++ that isn't modern or good) - it's easy to slip into "doing things a dumb but quick way" that doesn't teach you much about the language or coding.
I have a similar attitude to push-ups, honestly. I'd rather bench press once a week and do a sport than be constantly banging out push-ups. In both things, you quickly get to the point where you're hitting diminishing returns from the "push-up" type of operation, unless your goal is "to be the best at exercising".
If we're comparing someone who couldn't complete 10 pushups or do a basic Project Euler problem with someone who can, I'd say "sure, that first person needs pushups (or programming equivalent)". I'm not sure once you're well beyond that point whether it makes sense to do that many more "pushups", unless you are going to a push-up competition in a month's time.
What are you trying to accomplish with C++?
If you’re looking to have a better command of syntax, then do advent of code or something aimed at that. If you’re trying to implement algorithms in C++, get an algorithms book and implement them in C++. If you’re trying to get better at designing and architecting C++ code, look at good implementations (easier said than to find).
What ever you practice, that’s what will improve, so it’s best to align that with your goals and work backwards.
Athletes tend to have different phases of their training. Some periods of pre-season training, season, post-season where there may be a greater emphasis on things like strength, endurance, power.
I think building is good, but there must be some other phases too. You can’t just build all year or else you might get stuck in a local maxima. So, there should be phases of learning, building, refining. Again, aligned with what your end goal is.
I don't think performing a specific exercise is the route here. It's probably best to work backwards and find projects/challenges you find interesting and implement them in c++. You'll inevitably build new muscles + strengthen existing ones and most critically, be motivated to do it.
Once you're not a beginner, programming mostly becomes about the specific domain youre working on, rather than the code. So improvement comes from a better understanding of banking or file systems or whatever you're doing, rather than cross-training in some proxy thing the way you do with exercise.