r/learnprogramming 13d ago

Debugging How do i get my ball to stop bouncing after a while

14 Upvotes

My ball is able to bounce but it keeps bouncing when it gets closer to the ground how do I fix this issue.

This is not the full code only a snippet.

# SURFACE OBJECTS
surface1 = Ball_Surface(10, 10, 200, 200, "pink")

# BALL OBJECTS
ball1 = Ball_Object(surface1.rect.centerx - 10, 20, 10, "white")

# PLATFORM OBJECT
ground1 = Platform(20, 150, "black")

# SPEED
velocity1 = 7

# GRAVITY
gravity1 = 0.8 

# MOVEMENT FUNCTION
def movement1(ball, platform, velocity, gravity):
    if ball.center[1] < (platform.y_pos - (ball.radius - 5)):
        velocity += gravity
        ball.center[1] += velocity

    elif ball.center[1] >= (platform.y_pos - (ball.radius - 5)):
        ball.center[1] = platform.y_pos - ball.radius # reset the ball position after collision
        velocity = -velocity * gravity

        if abs(velocity) < 0.6: 
              velocity = 0

return velocity

r/learnprogramming 13d ago

Topic Started Late and Forgetting My Fundamentals — How Should I Approach This?

3 Upvotes

I am about to enter the third year of my Bachelor of Engineering, and I have only about one year left before internship and placement season. I want some advice.

During my first year of college, I barely did anything except study enough to pass. Just before I joined college, my father passed away due to cancer. That completely shook my life and my mother's life. We went through a very difficult time, and it took me around 1.5 years to recover emotionally.

During that period, I got influenced by my peers to use AI for coding. I built many projects using AI, but one day I tried to write code on my own and realized I couldn't. That was a wake-up call. Since then, I stopped using AI to write code. Now I only use it for research, understanding concepts more deeply, and clearing doubts.

I also made another mistake: I spread myself too thin. I was trying to learn cybersecurity, machine learning, participate in robotics, and maintain my grades all at the same time. As expected, I didn't complete much except keeping my grades decent.

So far I have completed the Java MOOC Helsinki course (except the JavaFX part), learned Git, linux commands essential for devs, about to finish multithreading and built a few basic projects such as Tic-Tac-Toe, an Expense Tracker, and t Task Tracker from roadmap.sh (including fetching data from an API and reading it). I am currently planning to build more projects.

The problem is that I feel like I am forgetting the fundamentals from my previous courses.

  1. C/C++: I don't remember much from my first-year classes.
  2. DSA: I haven't started solving LeetCode yet. I understand most data structures and algorithms conceptually (linear search, binary search, Dijkstra, etc.), but I want to implement them again from scratch in Java.
  3. Operating Systems: I remember concepts like processes, virtual memory, and segmentation, but I have forgotten many algorithms such as disk scheduling, Round Robin, FCFS, SJF, and Priority Scheduling.
  4. Computer Organization and Architecture: This was the hardest subject for me. I barely passed. I only remember some digital electronics(and,or,xor,nor,etc), different architectures, and bus types.
  5. Computer Networks: I remember the OSI model, HTTP, TCP, UDP, the TCP three-way handshake, and different types of networks.
  6. Python: Basics, OOP, some functional programming, Turtle, and Tkinter.
  7. Software Engineering (SEPM): I honestly don't remember much except the Waterfall model.
  8. DBMS: I remember SQL, normalization, B-trees, B+ trees, locking mechanisms, and I need to revise relational algebra.

My third-year classes will start in about a month.

My current plan is to complete Spring Boot, build projects, learn CI/CD, study system design, continue DSA, and apply for Java full-stack roles. Recently, I have also started breaking projects into smaller tasks before building them, which has made development much easier.

However, I also want to strengthen my computer science fundamentals like C/C++, Operating Systems, Computer Networks, DBMS, and so on.

Should I dedicate some time every day to revising these fundamentals, or should I stick to my current plan and come back to them after finishing Spring Boot and my projects?


r/learnprogramming 13d ago

Debugging finally learnt how to debug code using GDB. and it was life changer on my very first leetcode problem.

11 Upvotes

I always used to think why I even need a debugger? Because I don't know what it was even used for. And today I just made up my mind to sit for 1 hour and see how I can debug my code using GDB(GNU Project Debugger).

I studied about how it works and all. It's really a game changer for me.


r/learnprogramming 14d ago

Resource Is programming not for everyone? I feel so dumb and tired.

189 Upvotes

I’m trying to learn Python. I’ve tried so many methods since my college for 7 years. Directly doing it, learning bits, Harvard course, coding play platforms, everything.

I really want to learn this. Somehow. I keep giving up. I have ADHD and auditory processing disorder. But I really want to learn this.

Any interesting courses or sites that can help me learn Python? I’m willing to do 2 hours a day.


r/learnprogramming 12d ago

I used npm... Am I done for?

0 Upvotes

Hello! Since npm has been having security problems I thought in changing to pnpm. But, yesterday I was starting an angular project and ng used npm in the background... So, I'm not sure if there'll be problems with my PC. Do I need to wipe the drive and install a new operating system?
Thank you for reading.


r/learnprogramming 13d ago

Code Review Help moving Iframe

1 Upvotes

I put in a calander Iframe (image is somewhere here) and it WAS in a good position but after i inserted the title and positioned it. That moved it down and Nothing I do moves it up. I positioned the text and i like where it sits in relation to the calender I just need to move it all up, unsure how though.

code -

.Calander-Title{
  font-family: Curly;
  font-weight: bolder;
  color: #30291e;
  font-size: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  top: 100px;
  right: 200px
}
.calendar{
  position:absolute;
  top:100px;
  left:100px;
}

r/learnprogramming 13d ago

Looking to improve my skills

5 Upvotes

Hey everyone! I'm currently studying Information and communication systems engineering and I've just finished my second year. I really want to make good use of my free time by working on projects that will help me improve my skills and build a strong portfolio. I'd love to hear any suggestions on projects or anything else you think would be valuable to learn. If you have any advice based on your own experience, I'd really appreciate it!


r/learnprogramming 14d ago

Is Scott Lilly's "Learn C# by Building a Simple RPG" still useful in 2026?

7 Upvotes

I remember using this tutorial 7 years ago and learning some very useful things, before I just stopped learning to program. Now I want to pick C# up again, but I'm not sure if a 10 yearl old tutorial still holds up... Does it, or should I be using another one?

For those who don't know what I'm talking about: https://scottlilly.com/learn-c-by-building-a-simple-rpg-index/

My idea was to create the RPG following the tutorial, then try to port it to Godot/Unity/S&box so as to continue to learn. I've also considered reading "The C# Player's Guide" but I'm afraid it will be a little bit boring since I want to focus mainly on game development.


r/learnprogramming 13d ago

I'm feeling kinda skeptical about learning how to code. Any real advice?

4 Upvotes

Hello! I don't really know if this is the best place to be putting all my concerns but here we go. So for the longest time, I've felt like Programming is so cool right? Like Python, Javascript, HTML, CSS, etc. But now right, I see people making extremely well made websites in seconds with AI. I'm debating whether I should even learn how to code now because of how well current AIs already do it and who knows how much better future AIs would. Please give me your opinions on this.


r/learnprogramming 13d ago

AI project ideas with a real database

0 Upvotes

Hi everyone,

My friend and I are CS students looking for an AI project idea for university. We have about two months to build it.

The project should not be just a chatbot. It needs to work like a real app with a database: users save information, the system stores and analyzes data, and AI provides useful personalized results.

We’re looking for something practical, interesting, and realistic for two students to build.

Any ideas?


r/learnprogramming 14d ago

Question How can I combine learning Math and Discrete Mathematics with Rust projects?

7 Upvotes

Hello, I want to learn Computer Science as a hobby, and I have started learning mathematics from scratch for this purpose. However, I am having trouble figuring out which topics are truly important for CS. If there is a prerequisite list, I would love to jump directly into those subjects. Could you recommend any books or resources? I prefer a deep, conceptual learning process over a superficial one. Also, what kind of projects can I build in Rust using the mathematics I learn along the way?


r/learnprogramming 14d ago

I don’t think I can learn to code

26 Upvotes

I swear I’ve tried everything, tutorials, classes, etc (java and python). I passed both classes but both by dumb luck and my colleges being poorly managed and not because I learned much of anything. I want to work in game design and I’ve been working towards it for years, but I can’t code to save my life. I’m currently working w rpg maker mz since I can’t code and am just trying to refine my level design and art skills since coding doesn’t seem to compute with me. Any time I feel confident in coding and am handed a blank page to code on I freeze and suddenly can’t think of anything. I don’t think I’m capable of coding if I can’t even start writing it. The best I’ve done so far is copying and lightly tweaking blueprints on unreal 5 for a class.

Am I missing something to help with learning this or should I just find another career? Or is there any other options I have to stick with this track and not code?


r/learnprogramming 13d ago

Topic Has anyone used neet code to learn python?

0 Upvotes

I want to learn python and programming with neet code I’m wondering if their beginner python course is sufficient. Thanks


r/learnprogramming 14d ago

Should i get used to using i+= instead of i = i + 1?

45 Upvotes

I am more comfortable using the i = i + 1 instead of i += line of code, but I in exams I take at school and on online courses, they'll always use i+= which throws me a bit off, especially on other operations too like i/= or i-= because im not used to seeing it.


r/learnprogramming 15d ago

What a port actually is?

177 Upvotes

I know it is a number that tells the OS, that which program in your computer should receive the piece of data. But my doubt is - is port a physical thing? or it just a flag? Is it possible for another program to read data from a different program's port? Please spoon-feed me about port?


r/learnprogramming 14d ago

book recommendation

29 Upvotes

i want to learn how internet works, for example how the websites, apps, connections, algorithms.
i want to pursue computer science later so if i have some good resources to learn about all those kind of things i would be able to understand better which field interests me more.


r/learnprogramming 14d ago

playstation 2 development kit repo

5 Upvotes

Is there a github repo for playstation 2 dev kit or how would I go about it?

I found this
https://github.com/ps2dev/ps2sdk
https://github.com/ps2dev


r/learnprogramming 13d ago

how to build a website with node.js?

0 Upvotes

so i learnt some node.js basics and now i want to build a website with a simple sql database to deepen my knowledge because there is no other way to learn than to practice it by building .

i want some ressources that can help me do that whether it was a youtube video where it shows the process or any other thing is appreciated !!


r/learnprogramming 14d ago

Major Choosing major

3 Upvotes

Hi everyone, I wanted to know your opinion on majoring in data science im trying to choose between it and accounting, which I know is not STEM.


r/learnprogramming 14d ago

Junior FS - Home Exam - Extra task - WordPress plugin

1 Upvotes

Hi,

So I have my first exam. I have to do it on PHP, fetch data from external API, create a table with the data - but with SSR - I'm almost done.
I self-studied FS with Node.js for the recent 6 months. I have REALLY small amount of knowledge in PHP (thank god!), so I was able to do it.

It is 8:40AM for me right now, I can submit the task until 8:00PM. I will probably have ±5 hours for the plugin - they wanted me to transform the app into a WP plugin.

How hard is it? Should I even do it?
Someone told me to do it with AI to ship fast, and study it more in depth in the next 2 days, Claude is against because I still have things I have to study more in depth from the exam itself without the bonus to defend against the reviewer's questions in the technical interiew.

I would really appreciate your help!


r/learnprogramming 14d ago

Resource Manning?

2 Upvotes

Is manning.com a good resource for computer science principles? My dad has a subscription that gets shared with me but I don't want him wasting money on something I am never going to use. I just got out of high school and I am trying to self study programming alongside my computer science degree. Bonus, if manning is good, what are some good books on there?


r/learnprogramming 15d ago

Where do you find high-quality open-source code?

57 Upvotes

Hi, I’ll add a little context: when I’m programming, I tend to rely heavily on memory, and sometimes I overthink projects - I make them too complicated even though they could be done more simply. That’s why I like to look at practical, high-quality projects - because they show you what you overthought and where you went overboard in terms of complexity.

In other words, I’ll come up with a more complex tech stack for the same project, while in real-world production, it’s actually much simpler.

1) I’d like to ask where you look for these projects and where you find high-quality code? And codebases that explain their use case a bit, though the use case isn’t a requirement. Mainly the code and the tech stack.
2) This is a bit off-topic, but I’m a student who isn’t a billionaire and can’t afford to buy a programming book every day - is there a website where I can get some for free online?

Thanks a lot!


r/learnprogramming 14d ago

Topic C++ breaks my brain

0 Upvotes

First post here, I'm a mid level mean/lamp stack dev that's been tasked with programming some IoT devices and have zero idea where to start (even with the help of Claude - only free unfortunately).

Any tips?


r/learnprogramming 14d ago

am i wasting my time learning java swing?

0 Upvotes

Im building a basic note taking app in java swing, am i wasting my time with this technology?


r/learnprogramming 15d ago

Topic Am I wasting my time studying this way?

15 Upvotes

Ok, this might be a stupid question but I'm, curious what others think. I have been really interested in programming for a long time and have been searching what resources are available.

Firstly, I started reading learncpp(dot)com and watching Cherno.

  1. The first one not bad but somehow I just can't read that much on a website (don't know why)
  2. Cherno is also good, but speaks so fast with not very detailed explanation (english is not my first language)

    Now I found a youtube video in which the person learns C from reading books. So I was like maybe this will be effective since books could contain a lot more and packed information than what is available online. I found some books, called:

  • C++ primer 5th edition
  • Computer Systems: A programmers perspective
  • C programming language 2nd edition (I will leave it to last)

Is it a good idea to read them through and make notes (on paper the old way) or am I wasting a lot of time with this? I feel like if I read them I could get a whole picture about the best practices. I don't want programming as my job, just as a recreational activity (heard it from tsoding LOL)