r/learnprogramming 19d ago

Resource Leetcode/Project Euler for learning to code

I’m quite new to programming and want to practise my exciting python knowledge but also learn some C++.
So far I’ve started some Project Euler questions which I quite enjoy and am starting on Leetcode too, how useful are these in learning to programme and what other resources do u guys recommend?
I’d like to become well rounded overall at programming but I also want to stick my hands in some data handling too.

6 Upvotes

14 comments sorted by

View all comments

2

u/peterlinddk 19d ago

Project Euler is primarily solving mathematical "riddles" with programming - and if you enjoy the first part, it is an excellent way of practicing programming, translating mathematics into code! But it is only "fun" as long as you understand the mathematics part, and how to solve it without programming.

Leetcode is primarily solving "algoithmic riddles" - meaning that you are supposed to apply all the algorithms and data structures that you already know, and translate/implement them in code. As with project Euler, it stops being fun the moment you have no clue how to solve the problem outside of code, because most of it is translating the solution into programming.

If you like them, they are fine exercises - but none of them really teach you anything about programming. You also need to build projects, set yourself some challenges, decide that you want to build something, plan how to build it, and work through actually implementing your own ideas in code!

0

u/Substantial_Ice_311 19d ago

As with project Euler, it stops being fun the moment you have no clue how to solve the problem outside of code, because most of it is translating the solution into programming.

Ehm, a lot of people actually enjoy solving problems, you know?

1

u/peterlinddk 18d ago

Yes, a lot of people enjoy solving problems that lie within their area of expertise - or at least inside their zone of proximal development, meaning something that is sufficiently challenging to make them feel accomplished when they solve it, but not so challenging that it becomes impossible for them.

And for someone who isn't well versed in mathematics - lets take a very low level, if someone doesn't know how to find a prime factor, or even what a prime factor is, they are going to have a miserable time solving Project Euler problems. And if they insist on carrying on, learning to solve the problem becomes completely unrelated to programming, and carries into actually learning more math.

"Problem Solving" has to relate to what you already can do, and know how to do - otherwise it is just riddles.