New to programming? Not sure how to start learning? See [FAQ - Getting started][faq-start].
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.
Your question isn't answered in the FAQ? Please read the following:
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:
A [concise but descriptive title][debugging-title].
A [good description][debugging-description] of the problem.
A [minimal, easily runnable][debugging-posting], and [well-formatted][debugging-formatting] program that demonstrates your problem.
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!
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:
If possible, include a link to your source code when sharing a project update. That way, others can learn from your work!
If you've shared something, try commenting on at least one other update -- ask a question, give feedback, compliment something cool... We encourage discussion!
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.
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:
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.
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.
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.
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?”
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?
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?
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:
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?
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.
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.
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!
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?
When posting a question about code, you must include the following:
See debugging question guidelines for more info.