Consider Yourself a Developer? You Should Solve the Project Euler Problems

(blog.usejournal.com)

32 points | by pps 1896 days ago

18 comments

  • AceJohnny2 1896 days ago
    I used Project Euler as a framework of problems when I was learning Go. The experience disenchanted me from the value of Project Euler for that purpose.

    Project Euler is more about mathematical problems that you need to apply some generic algorithmic concepts but more importantly mathematical thinking to. It didn't drive me to exercise anything particular feature of the language I was using. I used it with Go, but I just as well could've used C, or Python. Which is part of Euler's point, really: not to be linked to a particular language.

    I didn't complete 50 exercises however. I think I reached in the low 20s, stopping at a problem that involved Pascal's Triangle [1]. By that point, all problems had exercised mathematical ability, and none of my programming ability, which is why I stopped.

    Maybe further exercises provide more of a programming challenge?

    [1] https://en.wikipedia.org/wiki/Pascal's_triangle

    • synthc 1896 days ago
      Advent of Code is a similar project, that has much more relevant exercises that do not rely on knowing arcane details about number theory
      • AceJohnny2 1896 days ago
        Thanks for the recommendation. I should try that.
    • crispyambulance 1896 days ago
      The nice thing about math problems is that they're reasonably self-contained. If they didn't focus on toy math problems they would have to do other stuff like endless, increasingly complex form validation, filesystem manipulation, or things like graphics that involve external libraries-- it would just become hard to manage for code-golf scenarios, I think.

      What would be a non math-heavy alternative to project euler be like?

      • IronBacon 1895 days ago
        Similar to Project Euler but about bioinformatics I would say http://rosalind.info/problems/locations/

        But for learning a specific programming language and confront with other developers, not mentioned yet, there is http://exercism.io/

        Edit: also http://www.puzzlenode.com/

      • msla 1896 days ago
        > If they didn't focus on toy math problems they would have to do other stuff like endless, increasingly complex form validation, filesystem manipulation, or things like graphics that involve external libraries-- it would just become hard to manage for code-golf scenarios, I think.

        It would also make it hard to use the exercises in some languages. For example, awk or retrocomputing languages like JOSS or BLISS.

        There's definitely a need to have good little or mid-sized projects which do call for library-wrangling, though. They help get programmers acquainted with the culture surrounding the language, and what kinds of problems other people using the language are solving.

      • ambulancechaser 1896 days ago
        Advent of Code fits this bill nicely. I think 2017's was particularly nice. I didn't go far this year.
      • infecto 1896 days ago
        Leetcode problems? Hacker rank?
    • mlazos 1896 days ago
      A lot of the time I try to see how far I can push the brute force solution which turns into a nice little programming exercise in optimization.
  • clem 1896 days ago
    Consider yourself a goal-post mover? You should post an article detailing arbitrary gatekeeping exercises that separate yourself from the chaff.
  • SketchySeaBeast 1896 days ago
    I found the Euler problems to quickly become too difficult to suss out if someone doesn't have a strong math background. While I did enjoy the first couple dozen, it quickly left me in the dust just because I didn't understand all the notation and concepts at play.
    • superpermutat0r 1896 days ago
      Well, even if you get all the notation in the problem statement the background math knowledge required to solve the problem is ridiculous.

      I remember a problem with Fibonacci numbers that required me to know some really weird Fibonacci identity.

    • vonseel 1896 days ago
      Well, guess I won’t make it past the first few dozen, then.
  • civilian 1896 days ago
    Counter to some of the other posters, I got a lot of value out of doing 50 Project Euler problems when I was learning python. (I don't have a strong math background-- I took Calc in college and majored in biochemistry.)

    I agree that PE problems aren't the best are getting familiar with the whole language, but you'll own the math, array, loop, and recursive nature of whatever language you do the first 50 problems in.

    My math-major buddy solved the first 20 or so PE problems using _excel_. His "loop" was just him dragging in excel to duplicate a recursive excel equation.

    I think the problems are very do-able by noobs looking to learn some aspects of a language. And you get a sweet badge when you do it: http://projecteuler.net/profile/civilian.png

    If you're getting bogged down in the algorithms aspect of PE, then I highly recommend taking the Stanford Algorithms course: https://lagunita.stanford.edu/courses/course-v1:Engineering+...

  • oxymoron 1896 days ago
    I’ve completed 120 of them or so. It’s definitely true that most of then are more challenging in terms of mathematics than programming, but there are plenty of exceptions. That said, I don’t think people without a math background should get discouraged. The math required is mostly of the type that few people are taught in school (number theory in particular) which means most people working through these problems are probably going to be encountering many concepts for the first time. Playing with the problem, getting a feel for it, and discovering neat facts through exploration, that’s the real beauty of Project Euler. It really is a pretty amazing experience.
  • Doctor_Fegg 1896 days ago
    Modern cycling evangelism differentiates between a “cyclist” (someone who defines themselves by their mode of transport) and a “person on bike” (someone who just uses a bike as the most practical way to get places). The implication is that we’ll build better towns by providing infrastructure that works for people on bikes, not just for self-identified cyclists.

    So, “consider yourself a developer?”. No, not really. I’m just a person who codes.

    • booleandilemma 1896 days ago
      Would you consider yourself a person who codes, then?

      There’s a word for that, you know.

      • pan69 1895 days ago
        Maybe just a person who solves problems by writing/creating software.
      • igouy 1895 days ago
        Apparently they do not consider themselves to be a coder or a programmer.
  • Datenstrom 1896 days ago
    A lot of sentiment here seems to be that Project Euler is more about math than programming. I feel like that depends on ones definition of the term programming. Computer science of course has nothing at all to do with computers as it only asks the question "What can be computed?" and Project Euler is very much in this spirit just as Knuths "The Art of Computer Programming" is. For example many of the problems require you to use specific algorithms to find an answer in polynomial time.

    If you define programming as software engineering then of course Project Euler is mostly irrelevant. But computer science is math, not software engineering.

  • infecto 1896 days ago
    I have limited exposure to the problems but the few times I took a stab at them I found the problems to be more centered around math theory and less computer science. Sure there might be some basic optimizations to be made but at some point it was about understanding the math. I don't think its necessarily helpful as a developer.

    EDIT: I find it much more useful to run through building basic data structures and writing base algorithms (like sorting) in a new language.

  • Madmallard 1896 days ago
    I don't think solving project euler problems will make you any better at being an effective programmer for pretty much anything except maybe game programming or other really mathy puzzly programming
  • bsamuels 1896 days ago
    Project Euler is great for teaching yourself all the parts of programming that you will never use in the real world.

    On the flip side, it's a fantastic exercise for learning how important time complexity can be, but again, 99% of real world programming is CRUD.

  • zorronimous 1896 days ago
    Create your own "problem" and post it to Reddit. Its fun seeing people strugle and to see creative solutions. Here is mine

    http://go-here.nl/the-rabbit-problem

  • pan69 1895 days ago
    I've been a professional software developer for over 25 years and in that time I have seen very few "computer science" related problems that needed solving.

    Sure, it depends what type of work you do. E.g. if you work on limited power embedded devices for the medical industry your work as a developer will probably lean more towards the comp-sci end of the spectrum whereas if you're building snazzy browser based UI's with React.

    How well you perform with Project Euler problems has absolutely nothing to do with how great a developer you are or whether or not you could consider yourself a developer because of it.

  • klyrs 1895 days ago
    Reading the comments as a mathematician... yup they're tough and require enough knowledge that I know they'll be challenging the next time around.

    Reading this as a computer scientist: Knuth is where the education is at. And like project Euler, don't feel bad if you miss a few of the hard ones.

    I was trained in computational number theory, and when I used them to teach myself ruby, and I stopped when I got comfortable enough with the language to find the problems tiring

  • dccoolgai 1896 days ago
    Project Euler is cool, but sometimes I worry about the proliferation of these "No True Scotsman" statements.
  • taddevries 1896 days ago
    Have a look at the Online Judge [1]. I've worked through a handful of these problems and they are good for forcing you to understand the problem and not over solve things.

    [1] https://uva.onlinejudge.org

  • berbec 1896 days ago
    "Lombardi’s ruthless focus on the fundamentals made him the winningest coach in the history of football, with more championships (5) than any other coach in history."

    Much as I hate everything he stands for, there is a certain hoodie-wearing punk that disproves this.

  • jhowell 1896 days ago
    > Lombardi’s ruthless focus on the fundamentals made him the winningest coach in the history of football, with more championships (5) than any other coach in history.

    Needs and update

  • karmakaze 1895 days ago
    Obligatory recommendation for the Structure and Interpretation of Computer Programs (SICP). It not only gets deep into programming fast, it really shows you what a program actually is, or can be.

    https://en.wikipedia.org/wiki/Structure_and_Interpretation_o...

    Edit: Also +1 for Advent of Code