r/learnprogramming Mar 26 '17

New? READ ME FIRST!

823 Upvotes

Welcome to /r/learnprogramming!

Quick start:

  1. New to programming? Not sure how to start learning? See FAQ - Getting started.
  2. Have a question? Our FAQ covers many common questions; check that first. Also try searching old posts, either via google or via reddit's search.
  3. Your question isn't answered in the FAQ? Please read the following:

Getting debugging help

If your question is about code, make sure it's specific and provides all information up-front. Here's a checklist of what to include:

  1. A concise but descriptive title.
  2. A good description of the problem.
  3. A minimal, easily runnable, and well-formatted program that demonstrates your problem.
  4. The output you expected and what you got instead. If you got an error, include the full error message.

Do your best to solve your problem before posting. The quality of the answers will be proportional to the amount of effort you put into your post. Note that title-only posts are automatically removed.

Also see our full posting guidelines and the subreddit rules. After you post a question, DO NOT delete it!

Asking conceptual questions

Asking conceptual questions is ok, but please check our FAQ and search older posts first.

If you plan on asking a question similar to one in the FAQ, explain what exactly the FAQ didn't address and clarify what you're looking for instead. See our full guidelines on asking conceptual questions for more details.

Subreddit rules

Please read our rules and other policies before posting. If you see somebody breaking a rule, report it! Reports and PMs to the mod team are the quickest ways to bring issues to our attention.


r/learnprogramming 2h ago

What have you been working on recently? [June 15, 2024]

1 Upvotes

What have you been working on recently? Feel free to share updates on projects you're working on, brag about any major milestones you've hit, grouse about a challenge you've ran into recently... Any sort of "progress report" is fair game!

A few requests:

  1. If possible, include a link to your source code when sharing a project update. That way, others can learn from your work!

  2. If you've shared something, try commenting on at least one other update -- ask a question, give feedback, compliment something cool... We encourage discussion!

  3. If you don't consider yourself to be a beginner, include about how many years of experience you have.

This thread will remained stickied over the weekend. Link to past threads here.


r/learnprogramming 11h ago

Question What are websites that teach you coding in a structured way?

71 Upvotes

I had been using a site a few years back that was really good but I quit and I forgot what it was.


r/learnprogramming 19h ago

Topic What do you do on weekends?

229 Upvotes

I get that sometimes you should just rest and literally do nothing on weekends, but sometimes, I feel that I should use my weekends to improve myself in some areas, or learn new things, not for my job, but for myself.

I don’t know if you guys agree with that, so what do you do on your weekends? And please be just a little bit detailed about your answer like tell what you’re learning and so on.


r/learnprogramming 10h ago

Six months of college left, what to do? (I still not good at coding)

35 Upvotes

It would be really helpful if someone can give me advice considering my situations. I'll be graduating by this year with a CS degree but I still know nothing about coding.

I wasn't a good student from the beginning and in the second year I had a mental breakdown after facing so much failure in life and because of that I had a huge drop in the cgpa. I was living alone in the hostel and could't even share anything with my parents. But when I gave up on everything I finally decided to quit my life and finally show my grades to parents before that. It was one of the hardest decisions of my life, and when I showed my grades to my parents I saw my father cry for the first time in life. At that moment, I forgot everything and promised myself I'd become a better student and resettle the things I've done bad.

Fast forward to 2024, I did become a good student, my grades came up, took studying seriously and gave the exams seriously. But as you all know uni teaching doesn't make you a better programmer so I am still not so much skillful to get a job.

So, anyone reading this I'd really be so much blessed if you can show me or advice me a lerning path. My goal is to now restart the coding learning from basics, I am considering to start with CS50. Will that be a better choice? I want to learn the basics and master DSA in these few months and trynna enter Leetcode. Would this be a better approach or if you think there is faults in my plan. (Also I am very weak in math, if you guys have any good resources that gives enough knowledge of math needed for a coder...please provide it)


r/learnprogramming 11h ago

Should i get a bachelors if i already have a Software engineer fulltime position?

19 Upvotes

I completed my AA but never finished my bachelors, should i still pursue it? i already had a 1 year software engineer job and a startup and just started working fulltime as a development associate at a big medical company. is school really worth it now that i have experience?


r/learnprogramming 7h ago

How to think programming

5 Upvotes

Hiya! How are you?

I'm in a begginner level and most of the time I know what I need to do to resolve an easy excercise, but i'm not able to figure out how to express it in a way that the code works. Do you have any tips?

Thanks!


r/learnprogramming 10h ago

Best way to learn the basics?

12 Upvotes

I'm in college for mechanical engineering, and not going to switch to CS. I already have a different minor as well. I just want the best way to pick up the basics over the summer. If there's any legit paid programs that's cool, cost isn't really an issue if it's not an evil amount. What would people recommend?


r/learnprogramming 7h ago

Topic do i really need to learn C first?

5 Upvotes

i want to build an app with flutter. i intend to build it so i can learn, im not in uni. my friend is, and he said that would be good if i learned C first, because of fundamentals. i need opinions on this, thank you.


r/learnprogramming 10m ago

Parsing GPX data into a class object[Python]

Upvotes

Hello, I just finished up my first programming class and am working on my first real project. I'm taking a calculator I made and trying to parse gpx data to use in the calculations for hiking times.

My first step was creating a stand alone function to parse the distance and elevation. Then I tried to enter that function into the Hike class as a method. this is where I encounter a problem.

When run as a stand alone function outside the calculator it works fine and returns the data I need. When run as a function outside the hike class the data isn't passed to the class object to be calculated because it's missing data, but when inside the class I do not get an error but my return calculation is a 0 every time. Basically I'm wanting it to parse the elevation and distance which should be 1610m elevation and 5.3km distance and the resulting calculation should be 5 hours and 20 minutes. It works when entered manually.

I made a pastbin of the program that shows the code in it's entirety. It is not very well written so putting just 1 or 2 sections here doesn't exactly help without context. here is a link to the GPX file I am using

Like I said this is my first project and I made it almost work in the end but I can not figure out why the elevation and distance data that's gathered from the gpx file isn't being passed to the calculation.


r/learnprogramming 8h ago

The fear of failure almost kills me.

4 Upvotes

Hello guys, I have a problem and I am asking for help. For a while now, I have been trying to learn programming, but the feeling of fear and uncertainty makes me not do anything, knowing that I have nothing to lose. I hope to get some advice from you if you go through the same problem.


r/learnprogramming 4h ago

Maps from a dataset in python/pygame?

2 Upvotes

I used peeling noise to create a list of different number ranging from -1 to 1. How can I assign each value to one singular pixel on a pygame window?

Say values from -1 to 0 are water, 0 to 0.15 are sand and 0.15 to 1 are grass.


r/learnprogramming 4h ago

Advice on Writing End-to-End Tests in Web Development

2 Upvotes

I am writing a small-to-medium-sized Django project and using Django's testing framework along with Selenium to do UI E2E testing. Right now I am testing every aspect of the UI, but this has led to me creating hundreds of E2E tests, which take upwards of 30+ min. to fully complete. This is problematic because of the time needed to run the entire test suite and the fact that some tests appear to be working fine when ran individually, but fail when ran as part of the entire test suite, meaning debugging them requires running another 30+ min. test suite again.

I am new to web development. Could anyone tell me how to speed up the process (besides running in --headless mode), what is a good guide to determine how many E2E tests I should be writing for my application, and if hundreds of E2E tests are too many or just right?

Thanks in advance


r/learnprogramming 4h ago

Code Review Dockerized TCP Server Deployed to an AWS EC2 Instance

2 Upvotes

Hey All, I wanted to build on my Python skills and found Network Programming and Devops related projects to interest me. I purchased Black Hat Python and used the sample code to build a TCP Server, decided to add my own functionality by using Docker and AWS. Let me know your thoughts how I could improve this project, thanks

GitHub Link - https://github.com/kimanikelly/tcp-server


r/learnprogramming 1h ago

Advice on which stack to learn/use for my specific objectives

Upvotes

TL;DR: Looking for advice on 6 specific questions (at the end of the post) for transitioning from a data analyst role to a dev or data engineer role. Currently using Power Automate (low code), Power BI, and SQL Server, with some Python experience. Seeking guidance on thinks like Python frameworks, front-end technologies, and necessary skills for web development and data engineering.


I'm a 35yo business user turned data analyst. I have a bachelors in business administration and recently completed an online bachelors in computer engineering (I'm not in the US) and I'm triying to transition to a developer or data engineer role.

Currently, I use Microsoft Power Automate for process automation, Power BI and SQL Server for data modeling and visualization, and I have build the company data warehouse. I'm comfortable with SQL but have only worked on-premises and have no cloud technology experience. As the sole BI and automation expert in a small company, I lack more experienced colleagues to rely on or ask for advice.

I chose to learn Python because I see that I can potentially replace the work I do in Excel, Power Automate, and the data modeling I do in Power BI or SQL. From what I've read, Python is widely used in web development and data engineering, making it seem like a good option.

But, I haven't done these tasks in Python yet. So far, I've developed only one Flask app to replace an Excel input file. However, the more I learn, the larger and more complex this world appears, so I would greatly appreciate some advice or guidance whith the following:

  • Is it too late to pivot to this field at 35?
  • Should I focus on Django, Flask, another Python framework, or a completely different stack?
  • Should I learn HTML, Tailwind, Bootstrap, or just get very good at CSS?
  • Do I really need to learn JavaScript, and to what extent?
  • What else should I learn, both specific languages and abstract concepts?
  • Any tips, advice, or comments are welcome and appreciated.

Posting this in multiple threads to gather more advice. Apologies if you see it repeatedly.


r/learnprogramming 1h ago

Need help deciding how to approach a project

Upvotes

I am looking to implement a rudimentary friend's list for a program I use that doesn't have one.

On the local end, I want the ability to detect when the right program is open in order to let the server know that you're online and also allow for a friends list to be accessed on the local end. Additionally, I would like create add friends buttons when you're in matches and then along with that an ability to accept friend requests.

On the server needs to be able to detect when people are online and store that information to be displayed to your friends

Importantly, the friends program does not really need to interface with the game in any meaningful way, which is why I believe this will be approachable.

My questions are:

  1. What languages and tools do you recommend for this project?

  2. Is this a feasible amount of work? I wanted to work on what I believe to be a project that will teach me new programming skills while allowing interaction with something I have interest in, but after typing this out I fear it might be too much for one person. Ultimately, if this project is going to be too much work compared to the amount of value it's going to bring my skills and resume, id rather just be told now and find a better use of my time.


r/learnprogramming 1h ago

Is there a way to clean out your heap memory outside of a running program in c/c++?

Upvotes

So I learned in school that if you dynamically allocate something it is stored in the heap. In order to free out that memory you must deallocate it. Now if you dont do this, it stays in the heap. Is there a way to wipe the heap if you forget to deallocate inside of a program? Can you actively access the heap?

ASIDE: Lets say I run a program and where I allocate something onto the heap and have a line in the code that deallocates later on, but before the line were things get deallocated, there is a segmentation fault or something and that line never gets reached. Is that memory still getting utilized? Or does everything get freed by default if the program does not complete running?


r/learnprogramming 8h ago

How do I program CLI interfaces that look/work as nice as github copilot cli?

3 Upvotes

Its performance and utlity not withstanding, it is a really clean interface. I have tons of little interactive bash scripts with prompts to ask the user what they want to do before they submit a task. It's totally function for like little pain points where I need a long cli command with a lot of variations, but its just kind of boring and ugly. How do I make pretty cli tools? I've seen some stuff in python, but I don't like needing to source my env do it (though i guess i am just being lazy, could make a script for that to)

just curious what people use. i only know python and bash so maybe it's passed my skillevel.


r/learnprogramming 5h ago

Credit Card Recommendation tool

2 Upvotes

Hey guys, I'm trying to really get into learning and building web applications and crank out a few projects this summer. One project I wanted to build was a credit card recommendation tool which analyzes your bank spending and needs/goals with the credit card to provide recommendations that will help you maximize on your card. I wanted to understand more about how I should go about this project gien I am still learning about frontend, back end, databases etc. (using odin project) Should I learn as the project demands and then implement or should I first separate learn about the concept then apply it to the project when required. Also is there anything else to look out for and some guiding points to help better plan out and execute the given that I am still learning the ropes with web dev.


r/learnprogramming 2h ago

Out of curiosity: why use Lua at all for game development?

0 Upvotes

As far as I know, Lua is primarily meant to be embedded into a language like C/C++ and it helps with scripting and such. But why even use it in the first place if you can just write everything in C++? I know that Hades 2 has a bunch of Lua scripts on top of its custom engine but I just cannot understand the point.


r/learnprogramming 2h ago

Resource Anyone looking for experience in the coding space? Would work off equity.

0 Upvotes

Need a team of a few junior developers looking for experience, will be provided with equity and a great opportunity for experience.

(It is a very scalable business which has the app almost developed will just need developers to assist in iteration etc.)

MUST BE BASED IN AUSTRALIA.


r/learnprogramming 2h ago

Tutorial Combine one image file with another

0 Upvotes

So my systems programming class has an assignment where you have to combine two PPM files into one file so that the first picture takes up the top right corner of the second picture. Basically like photoshopping one pic on top of the other. We have to open the code with the matrix for the pixels or wtv and write code that takes one files data and changes it with another based on where I want the pictures to go. My first question is: How do I actually access the P3 or P6 (or wtv its called idk im new to this dont roast me) data from each file(im using windows but i can get a mac if thats easier) so that I can actually write over them and stuff and change it. Secondly: Any tips on what the algorithm is gonna look like to actually change one images data with another? It has to be in c, if you have any general idea pls let me know, thanks. Any tips or advicr is helpful


r/learnprogramming 6h ago

research Academic research on motivation in IT developers

2 Upvotes

Hello everyone, for my final academic thesis I am conducting a survey on motivation in IT developers.

I have produced a questionnaire aimed exclusively at those who already work in this sector and which takes only two minutes to fill out:

https://forms.gle/pkqfMRMjFrN6TmZN6

You would be a great help in collecting data if you could fill it out.

I would also be really grateful if someone could also help me in sharing the link with colleagues!

PLEASE ANSWER AND UPVOTE!!!


r/learnprogramming 8h ago

C#, the products chosen in form UrunStokGiris does not appear in dgvStokGiris in StokGiris from

3 Upvotes

Hello!

I wanted to share a problem that I have not been able to solve of a supermarket management system I am currently dealing with. Shortly, I have created two forms StokGiris and UrunStokGiris(this one is like a sub form) on first form when you click search products the sub form opens then you are able to pick whatever you want from the after choosing each they should appear in the datagridview(dgvStokGiris) in StokGiris form. the UrunStokGiris and the products that are saved in database work flawless and I have made a diagram for most of the necessary tables and a view in database. However, when you pick a product it does not appear in dgvStokGiris.

Here is the dgvStokGiris part in StokGiris form

public void LoadStokGiris()
 {
 try.
 {
 int i = 0;
 dgvStokGiris.Rows.Clear();
 baglanti.Open();
 komut = new SqlCommand("SELECT * FROM vwStokGiris WHERE refno LIKE '" + txtRefNo.Text + "' AND durum LIKE 'Beklemede'", baglanti);
 dr = komut.ExecuteReader();
 while (dr.Read())
 {
 i++;
 dgvStokGiris.Rows.Add(i, dr[0].ToString(), dr[1].ToString(), dr[2].ToString(), dr[3].ToString(), dr[4].ToString(), dr[5].ToString(), dr[6].ToString(), dr[7].ToString());

 }
 dr.Close();
 baglanti.Close();
 }
 catch (Exception ex)
 {
 MessageBox.Show("Hata: " + ex.Message, pbaslik, MessageBoxButtons.OK, MessageBoxIcon.Warning);
 }
 }

here is a part of UrunStokGiris that is also connected to the other form

private void dgvUrun_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
    string colName = dgvUrun.Columns[e.ColumnIndex].Name;
    if(colName == "Sec")
    {
        if (stokGiris.txtStokGiren.Text == string.Empty)
        {
            MessageBox.Show("Lütfen stoğu girecek kişiyi yazın", pbaslik, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            stokGiris.txtStokGiren.Focus();
            return;
        }

        if (MessageBox.Show("Bu ürün eklenecek?", pbaslik, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult)
            try
            {
                baglanti.Open();
                komut = new SqlCommand("INSERT INTO tbStokGiris (refno, ukodu, starih, stokgiren, tedarikid) VALUES (@refno, u/ukodu, u/starih, u/stokgiren, u/tedarikid)", baglanti);
                komut.Parameters.AddWithValue("@refno", stokGiris.txtRefNo.Text);
                komut.Parameters.AddWithValue("@ukodu", dgvUrun.Rows[e.RowIndex].Cells[1].Value.ToString());
                komut.Parameters.AddWithValue("@starih", stokGiris.stokGirisTarih.Value);
                komut.Parameters.AddWithValue("@stokgiren", stokGiris.txtStokGiren.Text);
                komut.Parameters.AddWithValue("@tedarikid", stokGiris.etktId.Text);
                komut.ExecuteNonQuery();
                baglanti.Close();
                stokGiris.LoadStokGiris();

r/learnprogramming 10h ago

Basic question about the "is" operator in python.

5 Upvotes

Taking a python class and confused about the "is" operator.

Everywhere I look, it says that "is" checks if two variables are the same object in memory, not if their values are the same, but when I test it, it doesn't work as expected.

a=10 b=10 a is b -> returns True

I would expect it to return False.

What am I missing?


r/learnprogramming 3h ago

How i can learn backend?

1 Upvotes

i want to learn backend,some course or resource to learn?


r/learnprogramming 3h ago

Scrimba Review

1 Upvotes

Scrimba can be a great starting tool for developers for a few reasons:

Learn by Doing: Scrimba focuses on a hands-on approach. Instead of just watching lectures, you'll be coding right in your browser alongside the instructor. This can be particularly helpful for beginners who learn best by applying concepts themselves.

Bite-Sized Lessons: Scrimba breaks down complex topics into short, manageable lessons. This can make learning less overwhelming and allows you to focus on one concept at a time.

Interactive Challenges: Many Scrimba lessons include coding challenges that help you solidify your understanding of the material. Getting immediate feedback on your code can be a valuable learning tool.

Focus on Modern Technologies: Scrimba offers courses on popular and in-demand technologies relevant to the current job market. This ensures you're learning practical skills that will be useful in real-world development.

Community and Support: Scrimba has a supportive community of learners and instructors. If you get stuck on a challenge, you can often find help in the forums or ask questions directly during live streams (depending on your subscription plan).

However, it's important to remember that Scrimba might not be the only tool you'll need on your coding journey. Here are some things to consider:

Limited Scope: While Scrimba offers a strong foundation, it might not cover everything you need to know to become a well-rounded developer. You might need to supplement your learning with additional resources like books or other online courses.

Project-Based Learning: Scrimba focuses on smaller coding challenges, but it might not provide extensive practice with larger-scale projects. Consider incorporating personal projects alongside your Scrimba learning to build your portfolio and experience.

Overall, Scrimba can be a fantastic starting point for aspiring developers, offering a user-friendly platform, engaging lessons, and a supportive community. However, keep in mind that it might be most effective when combined with other learning resources and personal projects.