Press J to jump to the feed. Press question mark to learn the rest of the keyboard shortcuts
View
823
Moderator of r/learnprogrammingArchivedComments are lockedStickied post
Welcome to r/learnprogramming!
Quick start:
  1. New to programming? Not sure how to start learning? See [FAQ - Getting started][faq-start].

  2. Have a question? Our [FAQ][faq] covers many common questions; check that first. Also try searching old posts, either [via google][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][debugging-title].

  2. A [good description][debugging-description] of the problem.

  3. A [minimal, easily runnable][debugging-posting], and [well-formatted][debugging-formatting] 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][debugging] and the [subreddit rules][rules]. After you post a question, DO NOT delete it!

823
15 comments
9
Moderator of r/learnprogrammingStickied post

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.

9
11 comments
195

Hello,

I am preparing university notes in which I make the concepts concerning programming simple, so I would like to discuss them with you so that I can have different opinions.

Regarding the answer to the question, based on the book "Thinking in Java", I arrived at the division of the principles into 5 phases:

  1. Everything is an object. Think of an object as a fancy variable; it stores data, but you can “make requests” to that object, asking it to perform operations on itself. In theory, you can take any conceptual component in the problem you’re trying to solve (dogs, buildings, services, etc.) and represent it as an object in your program.

  2. A program is a bunch of objects telling each other what to do by sending messages. To make a request of an object, you “send a message” to that object. More concretely, you can think of a message as a request to call a method that belongs to a particular object.

  3. Each object has its own memory made up of other objects. Put another way, you create a new kind of object by making a package containing existing objects. Thus, you can build complexity into a program while hiding it behind the simplicity of objects.

  4. Every object has a type. Using the parlance, each object is an instance of a class, in which “class” is synonymous with “type.” The most important distinguishing characteristic of a class is “What messages can you send to it?”

  5. All objects of a particular type can receive the same messages. This is actually a loaded statement, as you will see later. Because an object of type “circle” is also an object of type “shape,” a circle is guaranteed to accept shape messages. This means you can write code that talks to shapes and automatically handle anything that fits the description of a shape. This substitutability is one of the powerful concepts in OOP.

However, I can't make it even easier. You have tips, even twisting the points or making them more synthetic. Also, could you recommend books that talk about Java in a really easy way?

195
56 comments
62

I'm quite new to programming, and I know only beginner level C and C++. My main motive is to be able to make Android Apps. Kotlin is a new programming language, and it is based on Java. And I don't know Java. Google is providing free training courses for this programming language. Should I learn it or do I know to learn Java first?

62
31 comments
626

I'm mostly wondering if my code is "clean" enough and what pracises I could do better for next time! The program prompts questions and outputs the time it took to answer after every question. It outputs the total time if all questions are correct at the end. I also tried to practice git and uploaded my script to Github. Feedback on commit messages is also appreciated!

import time
import random
# Imports my list of problems in the format of [["Math problem in str form", Answer in int form], ["Math problem in str form", Answer in int form]]
import math_problems

# Changes the order of the questions. Helps with learning
random.shuffle(math_problems.questions)

def mentalcalc(question, correct):
    start = time.time()
    answer = eval(input(question))
    end = time.time()

    answer_time = end-start

    if answer == correct:
        return answer_time
    else:
626
52 comments
32

I started with C++ mainly because of my arduino which I enjoyed coding on it a lot. However while learning C++, I tried using SFML for graphics/gamedev and I barely understand anything. Including library was a pain in the ass for me, I tried python which looked way easier to include and use library. Should I just stick to C++ since I'm already learning it with the arduino or learn python alongside it?

32
14 comments
32

I have come to a part now where I need to implement a new thing I just learned in my app. That's JS Promises and callback functions and some more things.

This is how working on my app goes:

  • Feel good, code for 5h/day 2 days straight, make lots of progress, feel good. Stop when I've finished complex implementation A and right before starting B

  • Because B is also very complex, I feel a lot of resistance in starting.

  • 3 weeks pass, I'm anxious because I wasted a lot of time + because B will be complex

  • Finally muster strength. Open VS Code, run app, and look into code.

  • Have no idea where I left off, but then finally find it, and lack any kind of structural approach so I just try to fix something here and there.

  • 30 minutes in, no progress made. I feel frustrated, sad and anxious.

  • 3 weeks pass

  • You Are Now Here

How do I overcome this? It's supposed to be a fun challenge to code (not always fun though, I get that), but now it's just something that thanks to my own planning is super anxiety and frustration inducing.

Please help, thank you.

32
12 comments
60

Hi so I am not really a reddit user, but a student of mine thought it is a good resource for my problem. I’m looking for some guidance on a programming project I want to do.

A bit of background, I’m a 21F student majoring in vocal at a music center/college. For work, I am a teacher at a small music shop. My boss is in her 50’s and is the head teacher and owns the shop. She is a really amazing musician and my mentor and she is the one who got me to fall in love with music. However, she is very traditional and strict and makes me work very hard. She still has the traditional Vietnamese conservatism and can often be overly critical. I forgot to mention that I am in Vietnam.

As a side project, I really want to learn how to program a computer. I have tried several times, but have not been able to really do anything except basic things :(. I tried using Ruby and Javascript by learning on CodeAcademy and EdX, but I just have not gotten very far. Thinking in code is really hard for me because I don’t do it before. The more I thought about it, the more I realize that it’s a common with my students. They have a hard time imagining the musical concepts in their brain so I have to draw it out to help them visualize it. That gave me the idea to make a tool to help my students “see” the music better. I want to make an app that will visually graph the vocal wave of my student’s singing. Kind of like a guitar tuner, but for singing.

My problem is that I am very busy with school and work so when I asked my boss for permission to make the app she said it was dumb and that it was a waste of time. When I told her that it could really help the students, she said that if I really want to help the students I should spend my time teaching more. I can’t change her mind and now I feel like I can’t do anything. I live in her apartment so she always knows what I am doing and am afraid she will swear at me if she catches me.

I really think this project can help a lot of students and help me finally make me a programmer, but I don’t know how to start. I am looking for guidance on exact steps to start out to make a program. I tried the online classes and MOOs, but they don’t help me enough to do this idea. I can do a little bit of different things, but I don’t know how to make something complete. I also tried YouTube tutorials, but they don’t have exactly what I need. I am looking for any other options to try to quickly get started on this and not get caught.

I am imagining an app that uses a phone/computer microphone to listen to the frequency of a voice and displays it on the screen to give feedback to the student. For example, a student can sing a “C” note and the graph will show him if he is really in “C.” Just like tuner, but since the voice is more layered than an instrument, I want the feedback to be like a graph instead of a meter.

I am not really sure who to ask, so I am planning on posting this in any channels I think are related. Feel free to delete or move if I put it somewhere it doesn’t belong. Thank you everyone in advance! I’m excited to be a real redditor!

TL;DR

I'm a music teacher from Vietnam who has very little time and is trying to learn how to program to make a graphical audio-tuner for my students, but my boss thinks it’s a waste of time and don’t want me to do it. I’ve already tried learning with CodeAcademy and MOOs, but still can’t figure out how to start this project. I want to make a program that shows a graph of the notes that a student is singing for better feedback. I need any advice on what else I can try?

60
11 comments

Community Details

1.2m

Members

3.8k

Online

Sep 24, 2009

Cake Day

A subreddit for all questions related to programming in any language.

r/learnprogramming Rules

1.
No unprofessional/derogatory speech
2.
No spam or tasteless self-promotion
3.
No off-topic posts
4.
Do not ask exact duplicates of FAQ questions
5.
Do not delete posts
6.
No app/website review requests/app showcases
7.
No rewards
8.
No indirect links
9.
Do not promote illegal or unethical practices
10.
No complete solutions

Asking debugging questions

When posting a question about code, you must include the following:

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

See debugging question guidelines for more info.

Asking conceptual questions

Many conceptual questions have already been asked and answered. Read our FAQ page and search old posts before asking your question. If your question is similar to one in the FAQ, explain how it's different.

See conceptual questions guidelines for more info.

Cookies help us deliver our Services. By using our Services or clicking I agree, you agree to our use of cookies. Learn More.
RedditView is Reddit Online Viewer ,Not Phising ,Not Hacking!