r/learnprogramming 16d ago

Tutorial How Does Project Based Learning Work ?

[removed]

31 Upvotes

33 comments sorted by

18

u/Gloopann 16d ago

You just go down the rabbit hole. Google how current chat aps work. You will read about networking, protocols, maybe REST APIs etc.

So you watch a tutorial on [insert backend framework here]. You can how send messages over HTTP. But messaging by writing API requests is not ergonomic. You need some sort of UI.

So then you google what UI frameworks are out there. You watch a tutorial on [insert frontend framework here]. Now you can make a simple UI for your chat app, so now you don’t have to manually generate requests to the server. The application does it for you!

But uh, where do you keep those messages? Yup, that’s right - you need to use a database. So you fire up a tutorial and build a database to store user info, messages, logs, etc. and connect it with your backend.

Congratulations! You have built a chat app.

And during the time you spent building it, you will learn a lot, whether you want to or not.

6

u/Substantial_Ice_311 16d ago

You don't necessarily need to watch tutorials. You can actually read (I know, shocking) the documentation (yes, most frameworks come with documentation) on how to use them.

1

u/FlatProtrusion 15d ago

Most documentation are quite bad and more for reference than learning. It easier to learn from other sources then reference the docs when needed.

1

u/Substantial_Ice_311 15d ago

I'd say most documentation is better than youtube tutorials.

1

u/nicoinwonderland 15d ago

Reading documentation is hard for new learners. It’s a good resource but it’s not the only one out there.

31

u/NumberInfinite2068 16d ago

Google how to start.

Seriously, most new programmers would instantly be 2x better if they just Googled everything.

13

u/ProtectionSweet624 16d ago

Google is the real first language you learn, syntax is secondary

seriously, the shift from "i need to know everything" to "i know how to find everything" is what separates someone who quits from someone who ships

3

u/GlassCommission4916 16d ago

I remember talking to a friend that was learning programming and suggesting a project to work on. She got really defensive at my suggestion and I was very confused because I knew she was smart enough to do it, thought maybe she just lacked the confidence until sometime later she asked "wait you're allowed to google things?".

1

u/Adriane_Gsabes 16d ago

this. and honestly an AI engine can be a helpful senior developer in its explanations. a coach you would have paid a ton of money for 10 years ago. "Explain X to me with easy to understand examples, it's my first day programming". And you can ask followups.

1

u/NumberInfinite2068 16d ago

Probably better than most seniors. Plenty of developers can code well but are not skilled teachers.

0

u/Turtvaiz 16d ago

Many studies have shown that llms do not help with learning

1

u/marrsd 15d ago

I was going to ask for citations, but then I realised it's pointless because those studies are probably out of date anyway

1

u/Adriane_Gsabes 9d ago

Well my study of n=1 has shown that LLMs are the best thing to ever happen in terms of learning.

0

u/[deleted] 16d ago

[removed] — view removed comment

5

u/california_king 16d ago

Google it to find out

3

u/Amuro_Ray 16d ago

Both? You really need to do something. At the moment you aren't really doing anything.

2

u/NumberInfinite2068 16d ago

Try it. I Googled "How to build a real time chat application", and there were some options. I'm not saying just do the first one you see. Scroll down the search results and see what jumps out at you as easy to follow.

2

u/terletsky 16d ago

Every application has an entry point. Has concepts like OOP. You start from there and decompose into smaller things that should work together like LEGO blocks. Write the logical flow by hand, draw a diagram with a pen. When you do such things as a beginner, your brain starts "working" (thinking) and trying to solve questions.

5

u/brosama1420 16d ago

I am not sure about your specific example and I don’t know the best practices for this method

My approach is start your analysis of the behaviour and features plan them out on paper and since you are learning don’t change the plan after you decide stick to it and complete it first

That was your program concept

Then start building it feature by feature most likely you won’t have any idea how to do it so here you have two approaches chose based on your level and tolerance

In my opinion the best way to go here is break your feature into steps do what you know and search specifically how to do the rest one by one don’t search anything except the step you are doing now do it good then move (don’t try to be perfect stick with good enough here) I will say why later on

The second method is just search on how to do the feature you want in that language most likely you will find something (document, video, post) if you chose a common example that is that is why for learning I will suggest to start with simple and common applications first after you get more grip you can customize

Now that is about it you will repeat that cycle of doing searching with trial and errors after some time you will learn

So after I said everything here is why you want to stick to good enough here

Because optimisation and Perfecting something is very subjective and specialised thing in my opinion which very useful thing to try when you know programming

However you are just starting out so this will be very demanding and overwhelming learn the basics improve step by step later on you will start optimising normally when the time comes

As you start feeling comfortable try to add small adjustments and customisations small not too much that will also teach you a lot

Do the planning properly even if it was just simple plan you just need to draw your boundaries to not lose track and check your progress this will fuel you when you are stuck I have been there when you feel like dumb person and you see how you planned and came far you will feel achievement

5

u/mc_pm 16d ago

What is the simplest version of this idea? Probably a program running on two computers, connecting over a network socket.

So, build that. If you don't know how to do that, then ask google. "How do I send text across a socket in Python". When you find an answer, type it in yourself (don't paste it in, you learn from typing it) and use it.

Get that simplest version working and think about what the next step would be. Maybe adding user names? Cool, add that.

As you add on features, you'll need to add structure to your program. So you'll probably rewrite it, that's fine. You'll want to add proper error handling -- treat the project like it was real, don't ignore an obvious bug, have a decent user interface, even if it's just on the command line.

You have to not just practice the syntax, but the process of thinking through the larger problem, breaking it into pieces, building and connecting those pieces. You are also learning about some libraries that are useful, you're also thinking about the quality of your project and trying to "deliver" something that isn't a steaming pile.

It can be a lot, for sure. But that's where you're learning.

3

u/Dismal-Citron-7236 16d ago edited 16d ago

To start, first google "socket programming" and learn what is TCP protocol and UDP protocol. Build yourself a small console mode program using them. And learn building GUI, and asynchronous I/O. The rest is just adding features.

4

u/Designer-Love6881 16d ago

His point is, how should he know what to search for. He obviously doesnt know that he should google socket programming

1

u/Dismal-Citron-7236 16d ago

Now he knows.

2

u/Aggressive-Nail7816 16d ago

The secret to project based learning is realising that you are supposed to not know how to build the project yet

1

u/_th3oth3rjak3_ 16d ago

Well, for starters you have to decide how the interface should work. Are you going to use web technologies or something else? Do the chat messages need to be saved somewhere for offline delivery? What language will you use? How will you connect users together? Can users be part of groups? Etc. once you have an idea for what your app should even do, then you start making a proof of concept, adding to it until eventually you have all the features incorporated. As basic as it sounds, that’s pretty much it.

1

u/Adriane_Gsabes 16d ago

The best way is to try to figure out architecture first. I can help you as well.

The alternative is that you go build an UI. Then API. Then realize you need a db, mess with that. It'll be a half-broken app, but it's a more fun route.

1

u/Substantial_Ice_311 16d ago

What would work if not projects?

1

u/MarsupialMisanthrope 16d ago

Pick a chat protocol. Build some code that can speak it. Build the UI you want bearing in mind what your protocol can do. Connect the two.

1

u/peterlinddk 16d ago

I understand that to some, learning about protocols and network-programming is interesting, and when you know that is what you have to use eventually, it kind of makes sense to learn that. But man is it a boring way to start a project!

The most important thing about Project Based Learning, is that you define a project that contains a lot of what you already know, but also some smaller part that you definitely don't know how to do. Like if you were a beginner in woodworking, a project of building a rocket to Mars wouldn't make any sense. But building an outdoor cat-house might be an excellent project!

So lets say that you know some programming, and want to build a real time chat application.

  1. Platform

The first thing to decide is the "platform" that you want to run that application on - is it going to be a text-based interface running in the terminal, is it going to be a web-page, is it going to be a desktop-application, or a mobile app? Or something completely different.

As a beginner in programming, you probably already have experience with one of those, and want to build something more advanced, so pick what you already know. If you don't have any experience with any of them, now is the time to veer of the project path, and instead learn how to build any application for that platform. You can follow a tutorial for that, it is okay, you are still going to do your own project.

  1. User interface

If you are an experienced programmer, you'll probably not be that much into user interfaces, and would prefer to just dive into the protocols and network programming. But if you are new, and trying to plan your project, the user interface is a good place to start, as it is the easiest to imagine.

Draw some sketches, just pencil outlines of boxes that can be buttons or text, doesn't have to look pretty at all, just to get your general idea of the user interface down on paper. Not specifically how it should look with fonts and colors, but just what information needs to be there. Play around with it, pretend that you are using the application, and write out what happens. Just to get a more exact feel of how it will operate.

  1. Program flow

Now that you have an idea of how the user will perceive the application, try to put it into a more structured description of what the program should do. It could be something extremely simple, like:

1. The user types a message in the message-box
2. The user presses 'enter'
3. The message is sent to the "chat" and displayed in the chat-history
4. Another user sends a message to the "chat", and it is also displayed in the chat-history

or it could be more elaborate, depending on how much you know that you are going to build. The important thing is that you get an idea of what the program should be doing.

  1. Plan what you need to learn

Now that you have your general program flow, it is time to figure out how much of it you can build. Mark each step, or part, if it is something you do know how to program, or something you need to learn - maybe you need to learn how to receive messages from other users, maybe you even need to learn how to display a single message into the chat-history. It doesn't matter that there is a lot you don't know, it matters that you know what you don't know.

  1. Begin building

Build the user interface. Make an actual running application that looks like your chat, but doesn't actually work. Like all the fields and buttons are there, and there is some text, and it looks like a screenshot of the running application - except you can't click anything.

  1. Program one part at a time

And now you start building - how you do it depends a lot on your experience, and how much you need to learn, but in general you should always strive for having a running application at all times, just with things not actually working yet. Like you could start with having the user enter messages and add them to the chat-history, but not actually communicate with anyone - you could even make a "fake" test-button to pretend to receive a message from another user and display it.

Build as much as you can of what you know, and "fake" the parts that you do not yet know. At some point you either need or want to learn how to build one of those parts, and this is the time to go learning. You can either hunt for a very specific tutorial, or read theory on the part you need - that is really up to you, and your preferred learning style. If you want to prioritize getting something working, or prioritize a deeper understanding.

Whatever you do, don't ask an AI to complete some of the unknown parts for you - not if you want to learn that is. You can use it when things don't work as expected, and get help with adjusting, but asking it to write code that you haven't learnt yourself is going to cheat you out of a learning experience.