24 votes

Newbie here looking for advice on how to get into Programming/CS by building a project

Been lurking for a week on tildes now and I am really glad this place exists. The crow here is exactly what I have been missing on Reddit for a while now.

Having said that, the whole Reddit situation has some-what motivated me to get the balls rolling on an idea that I have had for a while and I am looking for advice on the same.

I have often heard this phrase "Learn programming by building" but whenever I dive in to the resources, I fall flat due to the information overload and the general abstractness that the field has (I appreciate abstractness but here it demotivates me) and I have never found a proper resource that I could follow to actually build something instead of just blindly following tutorials and playing with them.

So, my question is how do I translate "learn by building a project" into a practical framework.

I know of 100 days of swift and I really like that approach however I don't think I want to start with swift or build an iOS app right now.

15 comments

  1. [3]
    bugsmith
    Link
    Great that you want to do this, and it really is the best way to learn. How to do it? Break it up. Most projects are little more than a collection of ideas that need to be executed. The larger...

    Great that you want to do this, and it really is the best way to learn.

    How to do it? Break it up. Most projects are little more than a collection of ideas that need to be executed. The larger idea is kept in mind so you build each piece with the others in mind.

    If you wanted to build your own version of, well, Reddit shall we say? How would you do that? Well, you'd need a a database. So you can design that. A table for users, a table for comments and all of the other various tables, junction tables, etc.

    So now you have a database. You'll need a way to interface with it. So it's time to build the back end. You'll need to have a way to communicate with both the front end and with the database, so it's good to plan this work flow. I would start by choosing the language a framework. Which one to choose it kind of arbitrary, so go with something in line with what you want to learn (in the workplace you'd just use whatever the standard tech stack is of the employer). Python and FastAPI could be a good option (or Django if you want a lot of the heavy lifting done for you).

    Once you've picked your tech stack, you can think about the individual problems you need to solve and start looking up the standard ways to solve them, by searching Reddit (maybe not at the moment...), StackOverflow and just generally web searching. Join some communities for your chosen stack on Discord or Matrix (or wherever). To find the problems, just think about what needs to be implemented to get to a minimum viable product (MVP). It can be good to frame these as user experiences like this:

    • As a user I need to be able to create an account.
    • As a user I need to be able to login
    • As a user I need to be able to create a new submission
    • As a user I need to be able to comment on existing submission
    • ...view existing submissions
    • ...edit my comments
    • ...manage my preferences

    And so on. You can group these needs into things like authentication, authorization, CRUD (create, read, update, delete: database operations).

    You'll want to think about how you're going to get things from the backend to the frontend. Will you create a bunch of API endpoints and create a front end app to consume them? That gives you flexibility and the option to make lots of different front ends (website, iOS app, android app). Or you can render your views server side (a bit less flexible, but can make for a more performant site).

    Then there are all of the front end problems to break down, which I won't go into as this reply is already getting a bit long.

    I deliberately chose something not related to iOS or swift so hopefully you can see that this would apply exactly the same to what you want to do, even with a different stack and medium.

    Think about all of the problems you need to solve, write them down and remember you can (and will need to) add more as you discover new ones during development. Search for solutions to the problems you do not know how to solve.

    Open-source projects are an invaluable resource by the way. Find some that are solving similar problems to you and just look at how they solved them. Don't worry if you don't understand what you see - you can ask others in the community, and now you have examples to share when you ask.

    Lastly, don't worry about building somethings shitty the first time through. The only way to learn is to build and learn from the things you wish you had done differently. You can always rebuild in the future.

    20 votes
    1. [2]
      stonednietzsche
      Link Parent
      Thanks! I have procrastinated enough over this but I finally have reason and the mindset to do this. Before I proceed to replying to the other parts, let me apologize for the late reply, I wasn't...

      Great that you want to do this, and it really is the best way to learn.

      Thanks! I have procrastinated enough over this but I finally have reason and the mindset to do this.

      Before I proceed to replying to the other parts, let me apologize for the late reply, I wasn't mentally available to get on internet.

      Thanks for breaking down in the way of you have. It certainly has made a few things clearer.

      If you wanted to build your own version of, well, Reddit shall we say? How would you do that? Well, you'd need a a database. So you can design that. A table for users, a table for comments and all of the other various tables, junction tables, etc.

      I actually want to do this. That's the intent and the project in mind to learn while building this. I have a community over Reddit which is devolving for various reasons and I would like to make a gradual shift over something more crafted under different principles and guiding philosophy.

      While the breakdown has given a relatively simpler picture, could you help me out with resources & a roadmap (Sorry, if it's asking for a lot) ?

      Books or a beginner's course in line with my goal (without getting lost in tutorial-hell), @cdb mentioned CS106a course from Standford. Shall I start with that?

      1. bugsmith
        Link Parent
        Well, in all honesty, I wouldn't learn to build a Reddit alternative to solve that problem. It's a huge undertaking for experienced programmers, let alone someone new to the craft. You'd be far...

        Well, in all honesty, I wouldn't learn to build a Reddit alternative to solve that problem. It's a huge undertaking for experienced programmers, let alone someone new to the craft. You'd be far better learning the basics of programming and then exploring existing options. You could spin up your own instance of Lemmy, or you could fork the code of lobste.rs and many other options if you just want something similar that you can have more control of.

        Otherwise, I would always recommend Harvard CS50 as a starting point. I think anyone who completes that in full will be in an excellent position to move forward with creating their own projects. Supplement it with things like Al Sweigart's Automate the Boring stuff to get some practical hands-on projects under your belt.

        I am not familiar with CS106a, but a quick glance suggests that it looks pretty solid to me.

        Having said this, don't let me dissuade you from building your Reddit alternative. It will be an excellent learning project. I just wouldn't bank on building one that is production ready on your first attempt.

        I'm not great with specific roadmaps. I'd certainly start with CS50 or another quality MOOC. The Odin Project would also be something to consider, as that has you building tangible software while you learn. After those, pick a language that interests you and choose something to build. Break it down into small chunks and start researching how to solve those parts with various frameworks in the language you chose.

        It can also help to make prototypes of smaller features. For example: Don't start with an all singing, all dancing Reddit clone. Start with a simple page where you can write a message and someone else could see it. Then add the ability to reply. And build up gradually from that.

        1 vote
  2. [2]
    unkz
    Link
    The key to successfully learning to program in my view is to make it relevant to you instead of working on some abstract projects that don’t actually matter to you and have a chance of being...

    The key to successfully learning to program in my view is to make it relevant to you instead of working on some abstract projects that don’t actually matter to you and have a chance of being directly useful to you specifically rather than just ticking some boxes in some list of resume skill.

    Writing a Reddit clone for instance is IMO more likely than not a waste of time. Who is going to use it? Do you actually want to even be a social media site?

    Instead I would work on things that solve your current problems, in the vein of “Automate the boring stuff with Python”.

    10 votes
    1. stonednietzsche
      Link Parent
      I agree and thanks for being straight-forward. I appreciate it! I actually answered this in my previous comment, here Noted.

      The key to successfully learning to program in my view is to make it relevant to you instead of working on some abstract projects that don’t actually matter to you and have a chance of being directly useful to you specifically rather than just ticking some boxes in some list of resume skill.

      I agree and thanks for being straight-forward. I appreciate it!

      Writing a Reddit clone for instance is IMO more likely than not a waste of time. Who is going to use it? Do you actually want to even be a social media site?

      I actually answered this in my previous comment, here

      Instead I would work on things that solve your current problems, in the vein of “Automate the boring stuff with Python”

      Noted.

  3. mjodr
    Link
    Maybe this isn't the answer you are looking for, but seriously just start coding. Download VS Code and just try to bang out the most basic thing you can think of. It just starts to snowball and...

    Maybe this isn't the answer you are looking for, but seriously just start coding. Download VS Code and just try to bang out the most basic thing you can think of. It just starts to snowball and get easier.

    Like unkz said, program something relative to you and you will have more motivation. I'm the worst programmer in the world, but I kept Googling and writing terrible code and eventually came up with this that actually works: https://github.com/themeadery/reefer

    I started to gravitate towards Python, because it just makes sense how it's written. It is human readable and writable. It doesn't have weird rules, it just flows.

    6 votes
  4. actionscripted
    Link
    Pick a language and find a framework and get going. If you try to learn how to do everything and build everything from scratch you’ll never get anything done and likely burn out before building...

    Pick a language and find a framework and get going. If you try to learn how to do everything and build everything from scratch you’ll never get anything done and likely burn out before building anything meaningful. You also won’t get exposure to certain types of architecture and design.

    I’d suggest Python and Django and you can find great resources for both to get started. Try to absorb the patterns you see: settings, forms, views, etc. Remember that it’s all just classes and you can always override class methods or properties if you need to do something different. Look at the Django source code and see how they do things.

    Or, pick another language or framework and do the same. You can absolutely learn it all from scratch but it’s nice to have fun and feel productive also.

    1 vote
  5. gf0
    Link
    Well, could you give a bit more details on what actually interests you? I found that out of my friends who want to become programmers (everyone wants to become one nowadays), only one of them has...

    Well, could you give a bit more details on what actually interests you? I found that out of my friends who want to become programmers (everyone wants to become one nowadays), only one of them has the motivation to actually stick with it -- and he has quite clear goals he has in mind (he is an expert "shithacker" as we joke around, building some Rube Goldberg contraptions to ease his work/studies, like auto-joining a Zoom call, reading the context of a popup quiz question, inputting it into ChatGPT and having it auto-answered, while he works as a doctor.. so it really is not laziness, he is quite an incredible guy).

    But getting back to you: please mention some hobbies you have, e.g. another friend of mine tried to write a text-based game - that is actually a quite reachable first goal. If you give a goal like this, we could mention starting points (like what language/framework might make sense -- e.g. you would probably do a terminal-app with a different stack than a mobile one).

    1 vote
  6. [2]
    cdb
    (edited )
    Link
    I think the advice to learn by building presumes you have certain fundamentals down, or that you go search out material. For example, I had taken Stanford's free CS106a course (highly...

    I think the advice to learn by building presumes you have certain fundamentals down, or that you go search out material. For example, I had taken Stanford's free CS106a course (highly recommended), which taught me Java, OOP, and just generally how to break problems down. Then moved on to Google's official android courses on Udacity, which went through the process of building a weather app. From there, I was able to take that knowledge and build a news reader app. I had to learn all sorts of things on my own about concurrency, databases, network requests, etc. but I wouldn't have been able to do that without those online courses.

    So if the example is you want to make an iOS app and you don't know how to get started, the first step would be to find some course or book or guide that will walk you through a basic example. Then you will have a basis for starting, and you'll be able to branch out on your own. I agree that this next step is kind of difficult. No one warned me about how much code I'd have to read just to understand how to use some feature of Android. There are no tutorials for a lot of this stuff. I think a good way to get going on your own is to first build out an extra feature for the tutorial project, rather than starting a whole new app with all new and different features.

    Lastly, it's important to break a project down into very small tasks. Even very simple looking apps have a lot of moving parts. This can quickly become overwhelming as you attempt to get going on your own apps beyond the tutorial. If your goal for the day is to get your news reader working, you're going to have a bad time. If your goal is to simply fetch a JSON file from the internet and print it to the console, that's much more achievable. You can probably copy the boilerplate code for that library and hard code in an example URL. This sounds simple, but as a novice you may have to learn a decent number of things just to get something like this working. Then you can start thinking about how you're going to decide what URLs to feed into it, what to do with the data once you've downloaded it, etc. The only way to eat an elephant is one bite at a time.

    1 vote
    1. stonednietzsche
      Link Parent
      I actually want to start building a progressive web app. More about this here. What do you think my approach should be?

      So if the example is you want to make an iOS app and you don't know how to get started, the first step would be to find some course or book or guide that will walk you through a basic example. Then you will have a basis for starting, and you'll be able to branch out on your own. I agree that this next step is kind of difficult. No one warned me about how much code I'd have to read just to understand how to use some feature of Android. There are no tutorials for a lot of this stuff. I think a good way to get going on your own is to first build out an extra feature for the tutorial project, rather than starting a whole new app with all new and different features.

      I actually want to start building a progressive web app. More about this here.

      What do you think my approach should be?

  7. mordae
    Link
    My first program was a simple popup dialog that boldly proclaimed "You are an idiot!". You had two options represented by buttons to either acknowledge that you are, in fact, one or another one to...

    My first program was a simple popup dialog that boldly proclaimed "You are an idiot!". You had two options represented by buttons to either acknowledge that you are, in fact, one or another one to try to deny the fact. If you tried to deny, the button would jump around and make it impossible to get clicked.

    My first bug was that the button was reachable by using the [tab] key and I had not in fact handled using [spacebar] to press that button. I sure was an idiot.

    Anyway, I suggest building a game. Just a single screen with two vehicles moving around, shooting projectiles in a single-hit instant death manner. Then try extending it with various improvements. You can use Godot, PyGame, C+SDL, JavaScript or about anything else. That should cover the basics.

    1 vote
  8. BlueKittyMeow
    Link
    A few things I would say. First, do you like programming? It involves knowing exactly the behavior of each element that you would like to have happen and figuring out how to deal with the ways...

    A few things I would say.

    First, do you like programming? It involves knowing exactly the behavior of each element that you would like to have happen and figuring out how to deal with the ways those elements and actions interact. It involves often poring over the same block of code trying to tease out what the possible errors causing your code not to run could be. It often involves getting into a zone and just... programming, for hours.

    So, identifying whether or not you like coding is something you can only do by starting that. As others have suggested, first try to build a simple, small tool to see if you like it. What you can do is try to make something that you could ultimately integrate with your larger app idea. This could be something like writing up the html and css for your landing webpage and have a little interactive widget there (unique page visits counter or something like that). That should give you a very small window into whether you like doing this.

    As others have also said, a reddit-type app is not really a one person thing. There are a ton of different parts that make it work - some programmers can do all of these things to some extent, but this IS a very heavy lift. Here's an example of things to keep in mind, just regarding the database:
    What are you going to use as a primary key for your users? If you are generating a uuid, then no worries, but if you link account creation to a username, you won't have the ability for people to (easily) change their username. What type of database will you need for your project? You could have something like PostgreSQL, but maybe you have a use case where an object oriented database might be helpful. These choices have implications for functionality down the road, so understanding the options and making choices with an eye towards desired functionality is important. None of this gets into any of the actual coding or any of the other related aspects of making this app, or even the construction of the DB or the way you will talk to it (some ways of querying your db limit results to a specific number of results - this could lead to issues with surfacing content from ALL posts that fit a specific set of criteria).

    I'm not trying to discourage you at all! I will say that it is incredibly unlikely that your first programming project will result in you sucessfully creating a Reddit replacement. I think that is just a wildly unrealistic thing. However - this doesn't mean you shouldn't have this as a goal project! I personally would start by trying to make a very simple CRUD app that would be useful for you. Do you need a task tracking app? Great, make a database and play around with what tables and fields you will need, write a simple app (a node.js approach is good for a beginner), write a simple index.html page on which you will read a few pieces of data from your db and include some input boxes to write data as well, and see if you can make this work. What issues do you run into? How can you fix them? Continue solving problems and adding functionality.

    I also suggest getting an overview of best practices before diving in too deeply - learn how to use a .env file to hide your sensitive information. Learn how to use git and make branches of your project when you are adding new functionality (this way you can roll back to your main build and have some stable working code - being able to play around without breaking the whole thing gives you a lot more ability to experiment). I'm sure there's a lot I'm not touching on, but those are my $.02. I know I harped a lot on databases here, that is because my degree is in Library Science and databases are the core of your app and are something that are very easy to underestimate in terms of complexity.

    It should be, yes hard and frustrating, but it should also be FUN. You will spend hours per week on this project for a very long time if you are to be successful - leap in and see if you enjoy it and then figure out what it is you need to know. As other said, it gets broken down into steps and is much more solveable if you approach it from that angle. Good luck!

    1 vote
  9. R51
    Link
    Learn c++ in the terminal. All you need is a terminal. Learn the basics. Make a calculator. Learn to manipulate data. Here's some quick pointers* to get you started.. int, double, char, string,...

    Learn c++ in the terminal. All you need is a terminal. Learn the basics. Make a calculator. Learn to manipulate data. Here's some quick pointers* to get you started..

    int, double, char, string, bool

    int = 12 //an integer, no decimal spaces

    double = 3.14 //a number that uses decimal

    char = 'a' //one single character

    string = "a string of characters"

    bool = TRUE; //either true or false

    Five of the most common types of data. Using these five you can build monuments, with the help of variables and logic.

    int numberA = 8;
    int numberB = 3;

    Say we wanna add these.

    int answer = 0;
    answer = numberA + numberB;

    if using c++ you can actually output the answer to the terminal like

    cout << "The answer is " << answer << ".";

    Then the logic, e.g. checking which is bigger.

    cout << "The bigger number is: ";
    
    if (numberA > numberB) {
        cout << numberA;
    } else if (numberB > numberA) {
        cout << numberB;
    } else {
        cout << "Numbers are equal";
    }
    

    You can do loops

    int count = 0;
    while (count < 5) {
        cout << "hi ";
        
        count = count + 1;
    }
    

    which will output

    hi hi hi hi hi

    I highly recommend looking up beginner c++ tutorials that guide you with using the terminal. Once you make some cool stuff you will have a crispy clear grasp of raw programming basics that you can take with you to whatever language you want (I enjoy php cuz it's like water if you are coming from c/c++).

    *if you get this far then feel free to ask for help

  10. marcellerusu
    Link
    So, lots of opinions here, don’t take us all too seriously, just find what works for you — we are all different. See if you resonate with this. IME the hardest part about learning programming is...

    So, lots of opinions here, don’t take us all too seriously, just find what works for you — we are all different. See if you resonate with this.

    IME the hardest part about learning programming is not getting overwhelmed, what’s best is find an environment that isnt overwhelming

    For me that was learning processing, its a minimal graphics programming environment. Try very simple things like making images of boxes & circles (try to draw a simple car), try to make things handle mouse & keyboard events, eventually making the classics like snake, space invaders, brick breaker (my fav) is a lot of fun.

    Most importantly IMO, if you’ve been stuck on something for too long, learn to move on & try something else, not everyone is the same. Eg, i found python really hard and almost gave up, but java made sense.

  11. bytesmythe
    Link
    Sometimes the hard part is just coming up with an idea in the first place. If you are in need of inspiration, check out Build Your Own X. It is a large list of projects that walk you through the...

    Sometimes the hard part is just coming up with an idea in the first place. If you are in need of inspiration, check out Build Your Own X. It is a large list of projects that walk you through the basics of building a variety of things, such as terminal shells, game engines, 3D renderers, chat bots, etc.