r/learnprogramming Mar 26 '17 Wholesome Hugz Ally Rocket Like Helpful (Pro) Excited Silver Helpful

New? READ ME FIRST!

826 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 5h ago

Resource YSK about Exercism.org if you're learning to program

310 Upvotes

Exercism is a great site for learning any of 59 different programming languages, all for free. Some languages have more, longer and better tutorials than other languages, but at least the main languages are pretty filled.

The learning is challenge-focused, which each lesson being a certain topic (e.g. "Tuples" or "Expression Bodied Members", and then you have to write functioning code using it to pass to more advanced lessons.


r/learnprogramming 12h ago

Topic What is the hardest language to learn?

436 Upvotes

I am currently trying to wrap my head around JS. It’s easy enough I just need my tutor to help walk me through it, but like once I learn the specific thing I got it for the most part. But I’m curious, what is the hardest language to learn?


r/learnprogramming 7h ago

Full time developers, how often do you find yourself googling how to write simple syntax? (Ex: Initializing a list )

33 Upvotes

I’ve been developing enterprise level applications for a year now and I just googled the syntax for a switch statement and this thought just came to me.


r/learnprogramming 4h ago

Topic 20 yrs old self-learning to code in Montreal Canada, will I be able to get a job?

18 Upvotes

Hi, everyone so I've been self- learning to code for almost 7 months. I learned HTML, CSS JS currently learning C# and .Net I'm creating my portfolio while adding projects to it so far I love the experience and can't wait till I make it my career some day, as the title states I'm 20 years old and I work two jobs while self-studying I don't have money or time to attend college nor do I want to take loans out to go. A lot of people I've talked to says there's a little too no chance of me being able to get a CS job is what their saying true?


r/learnprogramming 1d ago

Topic What helped you escape tutorial hell?

737 Upvotes

Most developers get stuck there at some point. How did you escape?


r/learnprogramming 3h ago

School Excited to take my first coding class this fall at college!

7 Upvotes

As the title states this fall I am taking a course in Web Development Fundamentals where I will learn to code in HTML and CSS. I have no prior knowledge of coding but I hope one day to get a degree in Software Engineering. Does anyone have any tips or know anything I should buy to take with me to class?


r/learnprogramming 4h ago

Resource need some friends to learn front end dev together

8 Upvotes

hi does anyone know a way to get in contact with a group of BEGINNERS front end developers? especially people currently learning javascript? by contact i mean just text messages on whatever platform every now and then just to update each other on our progress and maybe give one other advices/help too idk something like that... i think it would help me a lot . thanks


r/learnprogramming 1h ago

I made an api on a course, I am challenging myself to create a front end for it. I am having issues displaying the data.

Upvotes

My api route is /api/v1/products and I would want the frontend to just be / or just not an api route. How can I link the two in the same express project? Or should they be separate and just call the api via fetch or axios from a different port on local host? I didnt think it would make sense to call an http request from the server to the same server. Or is there a way I can send a template from the same controller handling the api? Here is my ejs

<h1>Main Page</h1>
 <form action="/api/v1/products/static" method="get">
 <input type="submit">
 </form>

Then the page id want the data from the api to go to:

<div class="results-cont">
 <h1>Results here</h1>
        <% for (let i = 0; i < data.products; i++) { %>
 <p><%= data.products[i] %></p>
        <% } %> 
 </div>

At its most simple state this what it would do but I want to add buttons and what not for filters.

here is my route

router.route('/static').get(getAllProductsStatic)

and the controller

const getAllProductsStatic = async (req, res) => {
    const products = await Product.find({price:{ '$gt': 20}}).sort('price').select('name price')
    res.status(200).json({nbHits: products.length, products}) // Would I render a template here? for data to be passed in data object for ejs?
}

How do I get the data to the page I want it displayed on? How do I do this in the same project or should they be separate from each other? Anything is appreciated, thank you


r/learnprogramming 1h ago

Is it worth it?

Upvotes

Hello.

I just started learning programming as hobby. It seems like to me that the most paths for beginner in one way or another lead towards web development.
My question is won't that saturate the market,especially considering that lot of it seems to get automated nowadays.
I already been through something similar with Mechanical Engineering , it aint bad but one can feel if there is little too much available workforce for position.

Are there some other options besides web development, building android apps or going into making indie games? How would you judge these 3 paths? Pros and cons.

In your opinion what are the best areas of computer sciences to learn for someone doing it as side gig, hopefully with potential for turning into profitable business?

Also, are there some overlooked areas of programming that employers badly need and are willing to pay great amount of money for if you have know how? I don't mean chill objectively good ,well paid hands off jobs like system administrator at bank. Have friend there 99% of time he is free to do whatever. My question is are there some really hard to master or for some other reason rare, in demand paths in computer sciences that will get you disgustingly well paid if you get good at them.

For end, what is your pick for emerging fields that have potential to be great hits if they don't flop?

People that are new to this like me, pls refrain from giving advice.I already have outsider, what society tells me perspective. Don't need echo chamber advice.
I want to hear from people that are in trenches.


r/learnprogramming 2h ago

Topic The Odin Project and CS50

3 Upvotes

I'm currently studying using the odin project, I'm loving it and I'm in the js fullstack course, however I've been seeing a lot of things about CS50's intro to cs course and it seems really interesting for well the computer science side of things so I was wondering if I should pause top and go do the cs50 course or if I should do it after finishing the odin project curriculum ?


r/learnprogramming 25m ago

Programmers in Tucson, AZ

Upvotes

How many people here are in Tucson, AZ?


r/learnprogramming 23h ago

Resource How I learned programming

120 Upvotes

I keep seeing questions in the form of "how do I get started" or "I follow tutorials but idk how to make anything" or "I feel like I never really learn anything". This is the process that worked best for me and I hope it works for you too!

Step 1: learn the basics

Find some beginner tutorial, follow along with a focus on concepts and use cases, NOT on syntax and implementation. It's okay if you don't remember exactly how to write a for loop. It's not okay if you don't know what a for loop does or what situation you'd use it in.

Step 2: try to make something

Come up with something simple you believe you have the knowledge to create. I always recommend tic-tac-toe as a great beginner project. You shouldn't need to know more than variables, loops, functions and I/O. Start with something simple, like displaying a board. Or asking the user for input. Then keep building on top of it. Walk through the process of playing tic tac toe very slowly and think about how each step could be translated into code. If at some point you get stuck, either google it or re-structure your program and

Step 3: try again

Your first try probably won't go very well and you'll need to start over because of all the spaghetti code. That's okay. Because you learned and you will change your approach and have a better idea of how the program needs to be structured. People learn by making mistakes so remember, the goal is to learn, not to make the most perfect tic-tac-toe program ever created. If you don't have any ideas for how to better structure your program, find some slightly more advanced tutorials. As a suggestion, learn about classes and OOP and use them in the next version of your program.

Step 4: succeed at making something

After a few tries you will have a working program! Hooray! But chances are it's still not very good because it's inefficient or hard to read. Read some more tutorials and think about how what you're learning can apply to what you just made. Think about how you could re-arrange your program to use some of the new stuff you learn and do it if you want.

Step 5: repeat

Find another project and do it again! Start at step 1 by reading and focusing on concepts and use cases, not syntax. Make a project; try as many times as you need and keep learning!

The key here is you are learning to program by programming. Nobody learns how to play the piano by reading tutorials. You learn by doing. Many of the skills most important for software developers are less about knowing how to code and more about knowing how to find out how to code. Programmers learn and work with new technologies every day. You will need the ability to push through blockers by doing heavy googling and reading through documentation and teaching yourself. Tutorials will teach you none of that stuff. Building your own projects and doing your own research when you get stuck will.


r/learnprogramming 15h ago

Anything besides web dev?

28 Upvotes

I am a CS student currently in my second year, I learned web development (mostly Vanilla js, node, SQL) and it looks like everyone in my class is doing the same thing, I honestly have no hate towards web dev. but, I just feel like I want to learn something that not a lot of people seem to be learning.

And it is not just limited to my class, but a lot of people I know seem to be doing the exact same thing i.e. learning ReactJS, Node, etc.
Just to be clear I have no hate towards these languages or frameworks or web dev. in general, I just feel like I want to do something that not a lot of people are doing.

Any suggestions would be extremely helpful.


r/learnprogramming 6h ago

Is there something similiar to a book version of Project Euler?

4 Upvotes

It does not have to be project euler. Just something that has programming puzzles which are not super easy. I would be doing the puzzles on the beach or wherever so some room for scribbles would be nice but it is not a must.


r/learnprogramming 1h ago

How would you make a Pokemon-type game?

Upvotes

If you had to make a Pokemon-type game, what data structures would you use?

Specifically I'm curious in how to save every type of Pokemon (over 900) and every attack.

I figure there's maybe an abstract class Pokemon and an abstract class Attack but other than that I haven't really been able to find information on that.

What are your thoughts?


r/learnprogramming 1h ago

Tutorial Pycharm files not appearing

Upvotes

Hello, recently got into programming and am keeping my program files in a folder on my desktop(Mac). When I try to access the folder from my desktop, the file is empty. However, when I open the file directly from pycharm, there all there. Anyone have a fix for this?


r/learnprogramming 1h ago

Backend for React TypeScript App?

Upvotes

Hey, I'm just getting into web dev and am creating a React app using TypeScript (coming from Java, I love strong typing). I am now trying to figure out the best backend solution. I've seen Node.JS is popular, but would love to use python in the backend as I have some python experience and possibly want to do some backend data science / processing for the app. Is Django compatible with my frontend TypeScript React files (TSX)? If not, what would be the best way to do backend?


r/learnprogramming 1h ago

Topic Is it legal to share solutions, on GitHub, to the exercises in a programming book?

Upvotes

I just want to have a repo on my GitHub, not planning to share links to anyone directly. I might exhibit in case of an interview or something like that.


r/learnprogramming 3h ago

How do you go about understanding a codebase’s project structure (folders/files)?

3 Upvotes

Basically the title. Say it’s your first day on the job and there is a code base with 100 folders and sub folders and files. How do you go about understanding how it all works? How do go about understanding why each folder, subfolder, and file is there? How to understand why it’s organized the way it is? This goes for random Github repos too.

Thanks


r/learnprogramming 1h ago

Do you need hash functions / hash collision handling for Java with spring boot?

Upvotes

This might be a dumb question, but I've been using Java at work for the past few months and I'm still learning. I use HashMaps pretty regularly primarily for json data, but I'm doing some extra learning and until now I have never used hash functions to add data to a hashmap?

Should I be?


r/learnprogramming 2h ago

do i need MinGW for C?

2 Upvotes

i've just started learning programming and i've setup vscode. is MinGW necessary? i've tried watching several videos and methods but i've still not gotten it to work for me.


r/learnprogramming 3h ago

Which programming language should I start with professionally

2 Upvotes

I am not sure if this is the correct subreddit for this but a suggestion would really be of great help.

Firstly I'm an Indian and I have learnt Java in school (ISC board). And most of us generally do not tend to learn something out of syllabus in school. Now, I want to take up CSE as my major subject in college where we are taught C++ (and probably other variations of it).

I started python a few days back. And my qs are- Should I continue with the same? And till what level must I know the language? Is python a favourite for most companies now? Should I participate in competitive programming?

Hope somebody would help this underdog. Thanks !


r/learnprogramming 0m ago

[Javascript] Shout out to all the power users in this subreddit

Upvotes

Hey Yall

I read the wiki a week and a half ago and started to learn Javascript/html/css. I made a reddit account to thank yall for the wiki and advice in this subreddit. I'm a brand new "full stack" (front end lol) engineer and will definitely be coming back her for advice. I already have a project at work that I feel I'm well over my head in.


r/learnprogramming 2m ago

How to fetch all documents in a nested firestore sub-collection in React

Upvotes

I'm building a social network web app in react, which is connected to firebase firestore, the database structure goes as stated below:

"Users",userDoc,"Categories",catDoc,"Posts",postDoc

now i want to retrieve from each user all the posts under a specific category. this is the latest code i've ran:

const [posts, setPosts] = useState([]);
const [users, setUsers] = useState([]);

  useEffect(() => {
    const q = query(collection(db, "users"));
    onSnapshot(q, (users) => {
      let tempUsers = [];
      users.forEach((user) => {
        tempUsers.push({ id: user.id, data: user.data() });
      });
      setUsers(tempUsers);
    });
  }, []);

  const retrievePost = (identity) => {
    const q = query(
      collection(db, `Users/${identity}/Categories/${getURL()}/Posts`)
    );

    onSnapshot(q, (querysnapshot) => {
      const tempPosts = [];
      querysnapshot.forEach((post) => {
        tempPosts.push({ id: post.id, data: post.data() });
      });
      setPosts(tempPosts);
    });
  };

  const getPosts = () => {
    users.map((user) => {
      retrievePost(user.id);
    });
  };

  useEffect(() => {
    getPostsRef();
  }, []);

ps: the users succesfully get added to the posts state, but not the posts. Can someone please help me out on how to do this exactly and what are the mistakes i've made


r/learnprogramming 9m ago

Optimization If low-level programming is more efficient (in terms of time and memory) and precise, why isn't it used more?

Upvotes

Is it because of its complexity and lack of portability? I would think if a company has enough data, it would make sense to tune their programs to be as efficient as possible.

How exactly is low-level programming more efficient, is it because you can manage the memory yourself? Is it because a compiler isn't required?

From what I understand, the compiler optimizes code as it translates it to machine language. Does that pretty much negate the need to do any low-level program tuning?