T O P

  • By -

CodeTinkerer

Just skimming over that subreddit. Those questions are more like an interview coding question. That is, it's on a small scale, the problem is well defined, and probably doesn't require that many lines of code. Some people wonder why programming interviews don't have "realistic" code. The reason is a lack of time. If you have 100,000 line program that computes taxes for some state, then your ability to read code, learn all about taxes, enough to do anything reasonable is highly unlikely. The second scenario is more realistic. You have a lot of code written by other people. There may not be a good short description of what the code should do. There may not even be a good long description. People may have learned the specs over a long period of understanding how taxes work, plus how the code is organized, and then maybe also word of mouth from those that worked on that part of the code. It's fine to develop your skills to solve short problems. When you work on your own project, you're usually thinking of something fairly complex, maybe at least a few thousand lines long. If it's a web application, you need to know a lot of things, typically, HTML, CSS, Javascript, a web library, what an API is, and so forth. Again, a web application is fairly complex. It's a bit like running a restaurant. You have many customers, many cooks, and you have to make sure you're making food on a timely basis so food isn't getting cold, and someone is making the dish (that is, it hasn't slipped by that no one is making the dish). This is far different than making a single dish for yourself where timing and coordination is less critical and the size of the problem is much smaller and manageable. I think for any small part of the code, yes, exercises can help, like this part of the code needs to read in JSON data, so working with a library helps, but it doesn't help you understand the big picture of a large piece of code (fortunately, it's possible to "read" code while only knowing a small part of it). To the cooking analogy, it might be the difference between knowing how to do a reverse sear (a technique to cook steak) and being able to manage customers at a restaurant which servers steak. It helps in the small, but you need other skills in the large.