tips for learning from opensource [closed]
Want to improve this question? Update the question so it 开发者_如何学编程focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this questionBesides practice(practice and more practice) reading books and forums, analyzing others people code is a must in order to have a career in this field.
The problem is that I'm a student(feels like always on learning stage) but sometimes i can't solve the problems by my own. I was thinking that on public open source repositories might be the answer I'm looking for.
My question is how can i find the answer to some of my problems in open source projects/community? Do you have any tips to share for me?
ty
A few things for learning problem solving skills related to software developement (once you've found a project that you are interested in that is also written in a language you feel comfortable with) are:
- Sign up to the mailing list
- Lurk about on the project's IRC channel (assuming they have one)
- Read through bug repots (the open ones to try solve them, and the closed ones to see how others solved them).
and of course discuss discuss discuss, if you think you have a basic grasp of the problem at hand but need clarification on some issues don't be afraid to ask your peers.
Hope this was of at least some help, Welcome to the open source world and good luck!
Analyzing others people code is a must... I'm a student... public open source repositories might be the answer?
The problem with open source is that the quality varies too much. (There's lots of my own code sitting in public open-source repositories that I wouldn't want anyone to try to see, let alone learn from. And yet some of my code, the code I have lavished time and attention on, is very good—or so my peers tell me.) So you don't want to pick an open-source project and learn from J. Random Hacker. You want to learn from the best hackers.
Here are some strategies:
If you're a student, you have acccess to teachers. One or two of them may have an idea about software. Ask them what is worth reading—what you will learn from.
Look at conferences and journals that publish about software: SIGPLAN, SIGSOFT, USENIX, Software—Practice & Experience, Journal of Functional Programming. Read about systems that look interesting to you. Write to the authors and ask them if they recommend you try to learn from their code. Listen carefully to what they say; most of the best hackers know they can do better. If you extract a grudging admission, with a bunch of caveats, that maybe there is something to learn there, you've found the right person.
If you're learning C, a lot of the old Bell Labs stuff is really worth looking at (and a lot isn't). I admire the work of Jon Bentley, Brian Kernighan, and Rob Pike, among many others. You can download and read the source of the original
awk
, or Pike's interpreter for Newsqueak.Popularity does not correlate with suitability for learning. The GNU tools are very popular, but almost anyone who has seen both will tell you that you will learn more from the Bell Labs versions. And Linux is very popular, but people I trust who work in the field tell me that if you want to learn about operating systems, you should study BSD. I myself work in the field of compilers and can tell you that if you want to write a compiler in C, the model to emulate is the little-known
lcc
, not the wildly populargcc
.
Finally, I highly recommend the work of Richard Bird, Hans Boehm, Ralf Hinze, and Phong Vo (two Haskell programmers and two C/C++ programmers).
What I've found useful over the years, is to validate your code, go through coding conventions and best practices for various languages. Open Standards are the inevitable part of Open Source Software. In order to maintain a successful OSS project, it has to have some common ground in the community, so for instance:
- if doing some (X)HTML and CSS, always do it by the W3C standards. Passing validation will in itself improve your skills greatly. Use tableless markup (see Benefits of tableless design);
- if doing some PHP, go through PEAR coding standards which is the de facto standard for all OSS PHP projects;
- if doing some Flash Platform coding in Flex/ActionScript, see Flex SDK coding conventions and best practices;
- if doing some Java, see Code Conventions for the Java™ Programming Language.
Lastly, but not less importantly, research Object oriented programming and various architectures used for software development, e.g. the MVC pattern.
... analyzing others people code is a must in order to have a career in this field.
I wouldn't say that is correct. Certainly it is not a must. Reading other people's code doesn't usually explain why they chose to solve a problem a certain way, and what alternatives they considered and then dismissed. Besides, it is not uncommon to find open source code that is badly designed and/or badly implemented.
The problem is that ... but sometimes i can't solve the problems by my own.
Ah. Well the solution to that is to practice, practice, practice, and not be afraid to make mistakes. Be self-critical, but don't let this stop you from "having a go". The more you do your own problem solving, the easier it will become.
Ask, ask, ask, ask if you come across a particular problem or solution that you don't understand. Make a good-faith effort to solve the problem or to understand a solution, share your thought process, and ask. SO is an excellent place for that, which you undoubtedly have already discovered. Good luck!
As other said, ask to the mailing list of the project, anyway some of open source developers are not willing to help (unfortunately) for this sort of things.
In this situation I search answers by myself: pick up a terminal and use grep.
Guess naming of classes/functions that involves your problem you will find the way toward the module where the interesting bits are written.
精彩评论