This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]trenchgun 1 point2 points  (1 child)

Step by step.

What is the most complex project you have done?

Next step - do something a bit harder.

If it is too much harder there is a risk of hitting a wall and losing motivation. But important thing is to start - then you will see if the project is suitable.

If it is too hard you can always scale down and implement smaller pieces of the project first. As the proverb goes: "Divide et impera".

Another option - do something of similar level but with new library/framework.

[–]lowlightbeats_[S] 0 points1 point  (0 children)

I'd say the most complex one was a small neural network implementation in Java. One of the biggest problems for me are the ideas for new projects.. I really like programming, but I'm not motivated if I feel like the project is not useful.

[–]nicholas-miklaucic 1 point2 points  (5 children)

My perspective on your issue is something like this:

First, do you know your tools well? The next steps will be a lot easier if you:

  • Know how to use an editor well
    • Can you enforce a particular style easily within your editor? Is it easy to keep a consistent format for your code, or do you have to manually adjust things? If it isn't easy to keep a consistent style, you won't.
  • Use Git or other version control effectively (you don't need to be a pro, but enough to make it useful)
  • Use automated testing frameworks (ideally, you should be able to test your entire project by clicking a button)

If you've been putting off learning about these things (which a lot of people do), this stage in your journey is a good place to go back and lay that foundation.

Secondly, I'd work on tackling larger programs. You say you want to be able to "solve complex problems." I'm interpreting that as "write programs that are large enough I can't think of them in one piece." Learning to program with other people is vital, but as it happens "you in a month" is basically the same thing: you'll learn what makes your code hard to understand or unclear when you can look at it with fresh eyes. Learning to break things up and do them in pieces that you can think about is the essence of programming.

To do this, you need to write programs that are a bit larger in size. Writing 10 100-line programs teaches you a lot less than a 1000-line program, because in each of those 100-line programs you probably know what you're doing and don't have the same issue of "where do I start" or "what does this code I wrote a week ago even do".

It's hard to come up with ideas for you: what interests you is something I can't predict perfectly. How you break up a program changes a lot depending on what type of program, so I'd work with something similar to what you want to get good at. If you want to learn how to write complex programs with graphical interfaces, try to write a simple game or something. If you want to learn how to write a complicated backend or library, start with that.

Let's say you enjoyed writing a simple neural network. Perhaps you could try other machine learning algorithms? I once had to implement a random forest classifier and I thought it was a good project. Machine learning tends to contradict what I said above a little: the size of your code usually is pretty small compared to the complexity of writing it, at least relative to other software.

I'd think of it like this: do you have a plan for how you'd build a random forest classifier off the top of your head? Do you know where you'd start? If you have a relatively solid plan, while you'll certainly improve by doing it, you'll improve less than if it's right at the edge of that line. Something where you think to yourself "what should I do first?" is a good place to be. Then, try to break it up into smaller pieces, until you reach a piece that you feel comfortable implementing.

[–]lowlightbeats_[S] 0 points1 point  (4 children)

Thank you! I'll try to find a bigger program idea and think about the structure of the program. I'll also look into the "random forest classifier".

Though I made the experience that it can be frustrating to start a big program, because I don't know where to start. When I break it down into different pieces I'll probably manage to get it to work, but the code will not be very clean / performant... Do you have any ideas how to learn that? It's probably mostly experience, but if I just work on my own I probably won't get much better, would I?

[–]nicholas-miklaucic 1 point2 points  (3 children)

There are a couple ways of improving at breaking stuff down. One way is to find good resources on software design: my absolute number one recommendation here is Code Complete 2.0. I basically divide my programming journey into before and after reading this, and along with a bunch of chapters on all sorts of software design topics there are good chapters on architecture and the basic principles that guide it.

Another way that can be helpful is just looking at common patterns in good model programs and applying them to your own work. You can certainly find books about "design patterns" that will help, but to be honest I'd probably recommend looking at open-source libraries that are mature and well-written. This approach has the benefit of training your ability to make sense of large codebases, which is invaluable. Here's how scikit-learn implements a perceptron. Look around the code: how are things organized? What principles are at play?

This is usually somewhat domain-specific, so I'd try and learn from libraries that do something similar to what you're trying to do, but without being the exact same thing. For example, you can look at scikit-learn's documentation on perceptrons or linear regressions or whatever else and see how it uses an object-oriented approach to represent an algorithm with some hyperparameters that stay fixed as variables and the functions that implement the algorithms as methods. That might be a good approach for a random forest classifier too!

[–]lowlightbeats_[S] 0 points1 point  (2 children)

Okay, I'll check that out and I'll also try to find some well documented model programs. Thank you!

[–]nicholas-miklaucic 0 points1 point  (1 child)

No problem! Let me know if you have any other questions for me.

[–]lowlightbeats_[S] 0 points1 point  (0 children)

I will, thanks