Live data from Hacker News

A list of practical projects that anyone can solve in any programming language

github.com

11–20 of 67 posts

Re: A list of practical projects that anyone can solve in any programming language

#11
post #9

Nice list, but ‘anyone’? The first on the list is ”Find PI to the Nth Digit - Enter a number and have the program generate PI up to that many decimal places. Keep a limit to how far the program will go” Easily solvable if you set that limit low and cheat. Just put a string representation of pi in the program, and chop it off at the requested length: n = Input “num digits?” if n between 0 and 8 inclusive print left(“3…

There are simple math formulas that approximate pi. You can look one up and run it to the right number of digits. It would be hard without Google, but most programmers should be able to do it with Google so that they don't need to figure out any of the math.

Re: A list of practical projects that anyone can solve in any programming language

#12
post #9

Nice list, but ‘anyone’? The first on the list is ”Find PI to the Nth Digit - Enter a number and have the program generate PI up to that many decimal places. Keep a limit to how far the program will go” Easily solvable if you set that limit low and cheat. Just put a string representation of pi in the program, and chop it off at the requested length: n = Input “num digits?” if n between 0 and 8 inclusive print left(“3…

If you accept only a finite n this seems easily doable. You just may have to wait awhile for execution to complete.

Re: A list of practical projects that anyone can solve in any programming language

#13
post #9

Nice list, but ‘anyone’? The first on the list is ”Find PI to the Nth Digit - Enter a number and have the program generate PI up to that many decimal places. Keep a limit to how far the program will go” Easily solvable if you set that limit low and cheat. Just put a string representation of pi in the program, and chop it off at the requested length: n = Input “num digits?” if n between 0 and 8 inclusive print left(“3…

There are fast algorithms for calculating the Nth digit of pi.

Re: A list of practical projects that anyone can solve in any programming language

#15
post #4

Looks really good :-) I would just change Classes sot something more generic like Domain modeling ? I.e. I am thinking of using this as a list to help me learn some languages I find interesting, currently Purescript/Haskell and ReasonML/Ocaml. I don't think you would model any of the solutions to the projects in the list by creating class-hierarchies (and Ocaml even is capable of creating class-hierarchies.) Even in…

Agreed. The tagline talks about any programming language, and then the classes section goes on to talk aout classes, abstract classes, class hierarchies, etc. To me it seems like "any language" in that chapter at least would refer to what people traditionally call object oriented languages. Lisps, some low level c-style languages (go and rust among the newer ones), and some ML languages with algebraic data types don'…

Yeah, it really is a minor nitpick, even the "Classes" list is really solid :)

The last update seems to be five years ago and I have to admit, If were writing this 5+ years ago, I too might assume "All modern languages have class hierarchies, right?" comming from Object-Pascal/Java/Python/Ruby

Funny enough, 5 years ago I started workin on a Clojure project at work, which changed my perspective somewhat :)

Re: A list of practical projects that anyone can solve in any programming language

#16

I would add a bunch of cellular automata to that list, Conway's Game of Life, Wolfram and Wireworld are easy to make something very rewarding, cover many bases, and are absolutely open ended.

I've been working on trying to make a (relatively) performant and easy to extend strict cellular automaton in C#, as a project to learn more about .NET core and making stuff for multiple environments. It's been fun and rewarding, but as you try to generalize and expand, you can run into some annoying situations.

Re: A list of practical projects that anyone can solve in any programming language

#17
post #9

Nice list, but ‘anyone’? The first on the list is ”Find PI to the Nth Digit - Enter a number and have the program generate PI up to that many decimal places. Keep a limit to how far the program will go” Easily solvable if you set that limit low and cheat. Just put a string representation of pi in the program, and chop it off at the requested length: n = Input “num digits?” if n between 0 and 8 inclusive print left(“3…

There are simple math formulas that approximate pi. You can look one up and run it to the right number of digits. It would be hard without Google, but most programmers should be able to do it with Google so that they don't need to figure out any of the math.

You need to use an arbitrary precision math library, I don't know how hard to use those. Those formulas have a hard limit in precision for standard floating point types.

Re: A list of practical projects that anyone can solve in any programming language

#18
Not only do I doubt that "anyone" can write these programs, most of them do not look particularly interesting or fun. Many if not all of the non-mathematical ones are simply replicating off-the-shelf utilities or tools; what is the point of reinventing the wheel?

Even if you are looking to hone your skills in a new language, creating something genuinely new seems like it would be more useful and motivational.

Re: A list of practical projects that anyone can solve in any programming language

#20
post #17

Earlier quoted context omitted.

There are simple math formulas that approximate pi. You can look one up and run it to the right number of digits. It would be hard without Google, but most programmers should be able to do it with Google so that they don't need to figure out any of the math.

You need to use an arbitrary precision math library, I don't know how hard to use those. Those formulas have a hard limit in precision for standard floating point types.

You don't need arbitrary precision, use a spigot https://en.wikipedia.org/wiki/Pi#Spigot_algorithms
Post reply on HN