• Post Reply Bookmark Topic Watch Topic
  • New Topic

Learning by Reverse Engineering ?  RSS feed

 
justin smythhe
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am looking at some Java code which (is open source &) uses many new classes which are not a part of Standard Java API. Can you suggest how I may figure out how the code, and the imported classes work ?
 
Greg Brannon
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since your thread title asks a question, I'll answer it first: Reading other people's GOOD code is a fine way to learn how to program. Many point to Java source code as an excellent place to start. Obviously, reading other people's BAD code is not such a good way to learn, unless you're confident that you can tell the difference between the bad and the good, AND you can tell what's bad about the bad code so that you don't make the same mistakes. I'd characterize this learning method as "learning by example," bad and good, rather than "reverse engineering."

As for the question in the body of your thread, if the code is not well documented and it's not obvious how the foreign or non-standard Java classes work, then try to find the API for those classes online. Some have them, some don't, and some have them, but they aren't very good. I don't want to characterize all code of a particular project as either good or bad, but I've had good luck with the libraries from Apache. The common ones I've used are well written, well documented, and have active development and user communities that will help and take suggestions and comments.
 
justin smythhe
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greg Brannon wrote:Since your thread title asks a question, I'll answer it first: Reading other people's GOOD code is a fine way to learn how to program. Many point to Java source code as an excellent place to start. Obviously, reading other people's BAD code is not such a good way to learn, unless you're confident that you can tell the difference between the bad and the good, AND you can tell what's bad about the bad code so that you don't make the same mistakes. I'd characterize this learning method as "learning by example," bad and good, rather than "reverse engineering."

As for the question in the body of your thread, if the code is not well documented and it's not obvious how the foreign or non-standard Java classes work, then try to find the API for those classes online. Some have them, some don't, and some have them, but they aren't very good. I don't want to characterize all code of a particular project as either good or bad, but I've had good luck with the libraries from Apache. The common ones I've used are well written, well documented, and have active development and user communities that will help and take suggestions and comments.


I am not beginning the learning by reverse engineering. But, I wanted to learn about some new classes using that approach, besides referring to the documentation.
Are there any tactics that are commonly used by developers in "learning by reverse engineering" ? Thats the kind of stuff I want to know.

 
Campbell Ritchie
Marshal
Posts: 56540
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would suggest you avoid that. Unless you are already expert, as GB has suggested, you will learn very little from that sort of code. And it may not be permissible to reverse‑engineer such code.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
justin smythhe wrote:Are there any tactics that are commonly used by developers in "learning by reverse engineering" ?

"Learning by doing" (or using) is a lot more common. Also, a good practitioners book, such as Effective Java can be invaluable.

Winston
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!