9 ms·
A list of practical projects that anyone can solve in any programming language
- deleted 8y ago[deleted]
- leoh 8y agoThis is seriously awesome
- a-saleh 8y agoLooks 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 more mainstream languages, such as Golang or Javascript, you wouldn't go with classes/inheritance.
- snorremd 8y agoAgreed. 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't really have the same object orientation abstractions as Java, C#, and Python. Further more the class system in Javascript ES6 are a bit special. It would be better to talk about domain modelling, suggest interesting domains to model, without actually specifying any particular way to do it. Edit: I must add that the author have done a great job of collecting these suggestions for tasks though!
- a-saleh 8y agoYeah, 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 :)
- weavie 8y agoTo nitpick your nitpick, Common Lisp has one of the strongest object oriented abstractions around (The MOP). It would be quite fun to see how far you could abuse the metaobject protocol to implement some of these..
- lispm 8y agoCheck out Common Lisp, which was the first standardized OOP language (1994) with its Common Lisp Object System. Classes, class hierarchies, meta-classes, ... all there. It's not using message passing, but that can be viewed as a simple case of its generic functions...
- outime 8y agoPersonally (but most likely majority of the people) motivation is so much higher when new knowledge can be applied in the short-term, and a pool of ideas like this comes very useful after e.g. reading the basics of a language.
- dkersten 8y agoYes. I find it very hard to really learn a new language without a project to use it for, but most projects I want to work on are too large to do in a language I don't yet know, or I want to actually finish so it doesn't make sense to use a new language, but a list of smaller problems like this is really useful.
- cstuder 8y agoMy personal favorite to implement in order to learn a new framework (mostly GUI oriented): A RPN calculator. Learn about stacks, state, GUI... Small enough in scope, lots of additional features imaginable.
- albertzeyer 8y agoWriting a game should be on the list as well. You touch many of the listed topics, and some more, have to combine them in an efficient way, and also it's fun. And your can write games of any complexity level.
- hartror 8y agoA Roguelike.
- furo 8y agoI started a game clone challenges[1] list, but haven’t had much time to work on it. Some more project related resources are awesome-for-beginners[2], The UChicago X-Projects[3], and Beginner Projects[4]. 1. https://github.com/rby90/Game-Clone-Challenges https://github.com/rby90/Game-Clone-Challenges 2. https://github.com/MunGell/awesome-for-beginners https://github.com/MunGell/awesome-for-beginners 3. http://chi.cs.uchicago.edu/index.html http://chi.cs.uchicago.edu/index.html 4. https://github.com/jorgegonzalez/beginner-projects https://github.com/jorgegonzalez/beginner-projects
- Someone 8y agoNice 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.1415927”, n+1) else print “number out of supported range” If you don’t cheat or if ”Keep a limit to how far the program will go” doesn’t mean what I read in it, I have my doubts anyone can write that program, even with support from Google.
- computerphage 8y agoThere 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.
- leni536 8y agoYou 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.
- dhartmei 8y agoYou don't need arbitrary precision, use a spigot https://en.wikipedia.org/wiki/Pi#Spigot_algorithms https://en.wikipedia.org/wiki/Pi#Spigot_algorithms
- ajuc 8y agoWow, this blew my mind. And it's so simple, too. def nthHexDigitOfPI(n): return 4/(8*n+1) - 2/(8*n+4) - 1/(8*n+5) - 1/(8*n+6)
- 8y ago
- AndrewOMartin 8y agoI 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.
- AllegedAlec 8y agoI'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.
- mrsuprawsm 8y agoNot 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.
- a-saleh 8y agoCreating something genuinely new can be really tricky if you are learning at the same time. I.e. look at the TodoMVC as the comparison benchmark for various frontend frameworks.
- zabana 8y ago> what is the point of reinventing the wheel? The point of reinventing the wheel is to develop a more intimate familiarity with the tool or framework or utility you're trying to re-create. Yes the original ls program is perfectly functional but recreating it can be a good way to learn how to write C programs. This is applicable to any type of project really.
- djaychela 8y ago> what is the point of reinventing the wheel? For many of us (me included), it's not REinventing the wheel, it's inventing it. I've taken a quick look through here, and some of these are in the 'yeah, I can do that straight off' category, some are in the 'I -think- I could do that' and some are in the '...right.... I'm not sure how I'd approach that' category. Remember that not everyone is in the same boat as you, and at the same level. I'm sure I'm way behind 99% of the people on HN, so maybe this is the wrong audience. In addition, there's also the element of the development of the wheel - after all, they used to be wooden, and then gained a steel tyre, a proper bearing, etc... The code you create today may well be completely different (and hopefully better in every respect) than the code from yesteryear. >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. Maybe, but sometimes having the limitation of producing a specific thing can be useful - certainly when teaching music in the past, there has been room for both approaches, and I think that carries across into coding. There are also plenty of people who don't know -what- to create, and anything they look at is such a massive, difficult project combining multiple skills they may not have 100% down that it's probably better to do some simple 'test pieces' like I had to do when I was an engineering apprentice.
- AllegedAlec 8y agoAdditional one which I found very fun to dick around with: a symbolic calculator capable of doing simple differentiation and integration.
- leni536 8y agoI have also played around with differentiation. I even wrote a template metaprogram in C++ that could differentiate formulas in compile time. However integration is tough, I have never attempted to do it.
- jonathanstrange 8y agoIf you're talking German, I can wholeheartedly recommend Taschenbuch der Algorithmen by Vöcking et al., Springer 2008. Unlike the name suggests, it is a highly entertaining, but more or less unsystematic collection of common and also less common algorithms. The descriptions are informal and just detailed enough so you can implement them on your own. It's a great little book that is unfortunately only available in German.
- em-bee 8y agoi would love to see these projects and solutions be contributed to https://rosettacode.org/ https://rosettacode.org/ the readme mentions rosettacode as inspiration, which is great. i live the idea of working on tasks through git, but i'd love it even more if i could work on rosettacode tasks directly this way. greetings, eMBee.
- holografix 8y agoRecently implemented A* Path finding algo using Go as a way to learn Go. Couldn't help myself and went ahead and added a UI layer on top of it using a 2d game library called Ebiten. Very fun little project! Got a hairy bug, which took me about 1-2 hours to figure out, which involved not realising that when I created a struct and added it to a slice, it was not the same struct as I had just created, in terms of memory address! So in pseudo code: myThing := struct{attributes...} mySlice[0] := myThing sameThing := mySlice[0] &sameThing == &myThing False Definitely know Go a lot better now. Looking forward to doing some others on this list.
- dasanman 8y agoThe Web list is a good one for beginners
- OliverJones 8y agoHow about this? Write an autopilot module to take inputs from altimeters, airspeed instruments, compasses, gyros, GPS, and user input. Give outputs suitable for controlling ailerons, elevator, rudder, and throttles. Extra credit: deploy it in an airliner. :-) :-)
- sethammons 8y agoFun enough list. I'm not sure the "any programming language" part holds up. Some of these programs require a GUI element. Others, you have to squint at to see how you would put into some languages due to the wording (cough, class and abstract class, cough). The web ones, it will be hard to avoid JavaScript.
- gnode 8y ago> The web ones, it will be hard to avoid JavaScript. I don't think any of the projects mentioned are incompatible with a server-side implementation. You could even use something like HTML's image ismap attribute to implement an online white board.
- dragonwriter 8y agoThere's a whole set specifically about class-based OO, which is pretty hard for “anybody” to solve in a non-class-based or non-OO language; any solution involves developing a class-based OO extension to the language, which is kind of big deal. That could probably be addressed in part by focussing on types or data structures rather than classes per se. Similarly, there are problems which mandate threading rather than either concurrency or parallelism, whichever is intended; there are languages in which threads as such are not directly supported, but with one or more structures for concurrency/parallelism that could solve the problem (and languages where threads are supported but directly using them may not be the idiomatic approach depending on the actual concurrency/parallelism requirements.) So, for a language-neutral set of tasks, it focuses in some places too much on specific languages solutions rather than the problem to be solved.
- fooker 8y agoIt's sad that there isn't a single item related to implementing a compiler or an interpreter here. That is how I got interested in computer science, and I can bet, a significant fraction of the others here had that experience too.
- zerkten 8y agoSomeone already suggested that (https://github.com/karan/Projects/issues/87 https://github.com/karan/Projects/issues/87), but it doesn't seem to be incorporated.