How do you find interesting problems to solve? [closed]

徘徊边缘 提交于 2019-12-20 08:07:42

问题


How do you find interesting problems to solve?

I often want to learn new programming languages. However, I feel that to really understand it, I must write something which is:

  • Real—it should solve some real-world problem. That problem doesn't have to be new (in fact, having a reference solution might be a good idea), but it has to be something that forces me to work out some grubby, dirty details. I don't want to solve math puzzles or implement algorithms-and-data-structures, because that only teaches me how to solve math (or A&DS) problems in 'new-language.

  • Something I can get passionate about—it takes time learning the ins and outs of a new programming language. That means I have to put in that time. To help me stay motivated, I want to solve problems that appeal to me on some level. I think this part is the most difficult, at least for me, judging by all my half-finished projects; it's also the most important part. No matter how real-world a problem is, if you don't work on it you don't learn from it.

  • Finishable—connected to the passionate aspect, I want something I'm confident I can bring to a shippable state when only working in my spare time. Even though "C compiler" is very real world and I really like compilers, it's a somewhat big mouthful. Even a simple expression evaluator is something you can redesign, debug and optimize many times when you're not familiar with the idioms of a particular language.

So, how do you (or would you) solve the problem of finding something interesting to work?

Particular solutions—that is, problems to work on—will be greatly appreciated, but (pardon the arrogance) they're just "dumb knowledge". What I'll be most impressed by are new ways of thinking about and attacking the problem (i.e. algorithms >> data :D).

EDIT: the winners so far are "make a game" and "fix something that annoys you about (programming|using comptuers)".

The game suggestion has going for it that there are plenty of reasonably simple games I can reimplement (giving me a large selection of problems to attack), they're definitely real world, and I'm a gamer so I'm passionate about good games.

The "fix something annoying" has the passion and real-world-iness built in, but it requires that I'm not spoiled by having things just work and that the fix isn't modifying some program not written in the language I want to learn.

(You both earned an upvote. An accept may be on its way)


回答1:


To generate ideas, I find it's always helpful to ask "what bugs me about programming" and "what bugs me about working on the computer."

Finishing things is another story. Finishing things is really hard. I think you will be happier if you accept that you will have a portfolio of projects, many of which remain unfinished. If you finish everything, you will have the opportunity to explore many fewer ideas and technologies.

Choose carefully which projects you wish to finish, and remember the words of Piet Hein:

Put up in a place
where it's easy to see
the cryptic admonishment

T. T. T.

When you feel how depressingly
slowly you climb,
it's well to remember that

Things Take Time.



回答2:


Make a game. You'll learn a ton about any language. It doesn't have to be fancy. Make a dungeon crawl or something.




回答3:


Jeff Atwood blogged about coding practice "code kata" awhile back.

http://www.codinghorror.com/blog/archives/001138.html

Also see (reference in Jeff's blog):

http://www.codekata.com/




回答4:


I collected this "standard" problem that I've used several times to learn a new language.

http://homepage.mac.com/s_lott/books/oodesign.html

It's real. It has some tangible value. It's finishable.




回答5:


Find some 'problem' in your own life that you can solve with programming. While it's easier said than done, I'll give you an example. I received one of those calendars with a word jumble on it for every day of the year (real). I like word puzzles and such (passion) and at the time I had been wanting a project to dive into python with. So I created a simple commandline script to solve the jumbles with a sqlite backend, and I've been doing quite a bit with python ever since. The project is as finished as I want it to be, I still add on things to it and continue to improve and add to it, but it served its purpose as a starter project for me. So I really think the trick is to find something that you can work at that is easily and directly connected to your everyday life.




回答6:


Project Euler




回答7:


Every time I see something being done over and over again I see an opportunity to create some piece of reusable code. It was that with my DAL, and many other pieces of projects I worked on.




回答8:


I don't go looking for problems, in code or otherwise. Instead I keep my eyes open as much as possible so that I don't miss inspiration for simpler solutions to old problems :)

Sometimes I just watch people be people .. or a cockroach going about its daily activities.

Often times, if you do that, you'll encounter new problems to solve. Don't try to think of complex problems, doing so typically leads to complex solutions. Every thought you think trains your brain, you are as much what you eat as you are what you think.




回答9:


Another source of "inspiration" for bits of software to develop (or just have an explore of how the technology works) is those "Why does it not cope with that?" or "It should work with that!" moments. I've had a few of those moments with things like code generation from XSD's.

Another source are those "There must be a more elegant way to do that!" moments. Simple little things like the C# "if(x is typea) do_a else if(x is type_b) bo_b else ....". Start me thinking about better ways to do things.

Another source, which some have mentioned before, is the "Could I write a system to do that?" moment (or the rhetorical question). I know programmers who have tinkered with an ISAM system for year, tweaking here and there just because the like playing with it. No idea of even finishing the project, just playing with different ideas and implementations.




回答10:


Although not apparently real-world, I've had an idea for a good source of projects that are at least finishable, and probably something you should be motivated to do (then again, you should floss every day :p).

For reviewing and testing understanding, implement various algorithms you've learned as part of your CS education. Some projects:

  • implement a finite state automaton library, with language membership testing, product construction, and brzozowski minimization.
  • implement max flow, min cost flow and a linear program solver.
  • implement reductions between select NP-complete problems, polynomial time approximations and brute-force solvers.
  • write your own implementation of cryptographic algorithms (but don't use them :D)

IIRC, mona is a finite state automaton thingie used to verify the correctness of an electrical circuit; ISTR my lecturer talking about the applications of linear programming in economics, and gcc does register allocation (which is graph coloring, which is NP-complete). Crypto of course secures all credit card transactions on-line. So it's not completely unreal-world :)




回答11:


Am i too late? here is a "sub-real" problem. Since you liked the game thing. Check this Java4K, you should make a game in 4096 bytes only. You will learn a lot about Java, lot of code optimizing and for sure, how to think simple.

And at the end of the day, you will have a new game :)




回答12:


I usually find that there is already a problem that I have been encountering that could be more easily done in a different language. Example: working with PDFs in multiple languages.




回答13:


Hmm. If that's your goal, then you might try it in two stages...for the algorithms side of things, I'd highly suggest looking at some of the programming challenges out there, and do it in conjunction with reading Skeina's book Programming Challenges. It provides a great deal of theory about how to approach problems from an algorithms and data structure point of view, and then points you to a bunch of sample questions where you can try to put these ideas into action on your own. It will very definitely put you through the mental wringer, in a very good way. Very similar to Project Euler, but for hard-core algorithms and data-structures people, rather than math people.

For just the "learning the language enough to feel like you can really use it", well, there are a lot of ideas for that...for me, just to use an example, I like to build a database driven website. Forces me to do a lot of things that you're going to have to do to get into a language in some breadth/depth.

If you need a specific example of a site, and really want to be pushed to do something real, you could contact a few charities that you are fond of, and see who needs a website or other application done for them for free. You're forced to learn, and have a reason to do so in a reasonable timeframe, and they get a useful app for free. Win-win.




回答14:


I maintain a list of projects/classes/functions to create "when I get the time and inclination". I maintain similar lists for other hobbies. Then there's always something to do if I'm feeling bored or want a challenge.




回答15:


You could try coding a solution to a real problem a friend or family member has on a computer. This could be a particularly good way to practice coding if you're creating the solution for someone who's relativly inexperienced with computers - those kind of people will ask you questions that another coder never would. These real-world questions about your solution might be things like, "Why does this come up in a black window with all this writing?" - in reference to a script running from a DOS command prompt. When you get hit with questions like that, you need to have a firm grasp on your own understanding of the language, and must be able to respond in layman's terms in order to be able to answer them.

I'm in the process of learning perl at the moment and I'm using it to design an property management system for a family member who runs an apartment complex.

By building something for someone who's close to you and expecting you to finish it, you might find yourself more motivated to write the entire solution instead of stopping halfway.



来源:https://stackoverflow.com/questions/604094/how-do-you-find-interesting-problems-to-solve

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!