+ 2

Reverse Engineering: Usability in learning code.

So I've attempted different ways to learn code, started at the shallow end with markup HTML onto CSS and now JavaScript. A method I've used amongst countless networking, library trips, video tutorials and online courses is to reverse engineer another person's source code to grasp functionality of there syntax, a lot like learning a guitar riff and taking snippets of another persons solo then utilising it into my own work. My question is aimed towards those that have a few years of experience as to whether this is a good or poor learning style to use and whether this practise is seen widely through out the professional scope.

9th Sep 2020, 9:41 PM
Kieren Hawthorne
Kieren Hawthorne - avatar
9 Respuestas
+ 3
Technically, all software is written by copying and combining various design patterns and ideas, using the building blocks offered by the programming language. But of course we can't ignore the subject of copyright protection, both from moral and legal point. The extent and implication of this is sometimes unclear, even for large companies, for example there is a lawsuit between Oracle and Google going on for 10 years, regarding the copy of Java APIs in Android's design. I am not a lawyer so don't take any legal advice from me, but I believe that at the level we are discussing right now, ie. for learning purpose how to write better, nicer, more efficient programs, it is perfectly acceptable to copy material/snippets written by others that is readily available and accessible, as long as it is not protected by copyright, trademark, patent or something similar. But closed source software is obviously off limits. Copying entire programs without attribution of the author can be considered copyright infringement.
10th Sep 2020, 8:42 AM
Tibor Santa
Tibor Santa - avatar
+ 5
Kieren Hawthorne Not a pro here ... But understand that people are different when it comes to learning. There are those who grasps info better by reading, watching videos etc. So it is not easy to say whether someone's learning method or style is "good or poor". What works best for one doesn't necessarily become best for others. So how do we know a learning style works for us? look inside, ask and answer yourself honestly, "do I understand clearly {the subject} by learning it {learning style} way". The bottom line is, to understand. Also FYI reverse engineering is not needed when we have access to source code : )
9th Sep 2020, 10:19 PM
Ipang
+ 3
Reverse Engineering is a different concept. It's when you only have the end product, and you try to figure out how to come to that result, by guessing what the code would be... without actually having access to the source code. What you describe is code analysis, and indeed it is a very useful learning method (one of my favorites). Use it together with api references / documentation, and creative google searches. The code other people write, may not always be the best way to do something, keep that in mind. But you can discover new methods of doing things, and maybe even antipatterns (how NOT to do things).
10th Sep 2020, 3:18 AM
Tibor Santa
Tibor Santa - avatar
+ 3
Kieren Hawthorne In that case, as Tibor Santa said, it wasn't reverse engineering. However, I guess it's nonetheless a good way to learn - by removing something, try to recreate it, and see whether it works as expected, or better. Self challenging is good where there's real action performed (writing) opposed to just reading or viewing videos. Actually riding a bike teaches ourself better than just seeing others do it, or being told the theories of how to do it : )
10th Sep 2020, 3:31 AM
Ipang
+ 2
Thank you for your answers so far, if I rephrase it from 'reverse engineer' to 'code analysis' how would this sit in a professional environment, for example you see a code do something you really think would work well in your companies Web page like a Nav bar, or a specific program, is it looked down upon to mimic similar code? A lot of projects I'm coming up with are from seeing another design or function and using it as part of my overall, obviously not being employed in the industry I haven't a clue on what would be acceptable or not.
10th Sep 2020, 7:36 AM
Kieren Hawthorne
Kieren Hawthorne - avatar
+ 2
Tibor Santa That makes a lot more sense now and puts me at ease of what I can use to create a site, many thanks!
10th Sep 2020, 9:01 AM
Kieren Hawthorne
Kieren Hawthorne - avatar
+ 1
Ipang When I mention reverse engineer I mean to remove functions and see how you'd utilise it yourself.
9th Sep 2020, 10:36 PM
Kieren Hawthorne
Kieren Hawthorne - avatar
+ 1
Note from someone who used to learn by reverse engineering a lot of codes: lots of codes are really dumb and are more of an example of how not to do things. I'm not sure I even have any good code on the app myself. The actual method that works is programming yourself, then refactoring it until it's perfect/you get bored. You can spend some time figuring out how other people wire up something you've never done, but personally I've never learned much more from other codes besides that.
10th Sep 2020, 3:16 AM
BlazingMagpie
BlazingMagpie - avatar
0
Good
11th Sep 2020, 6:55 AM
Humayun Ijaz
Humayun Ijaz - avatar