Sometimes we need to read some code from different languages which we don’t need to know. There can be plenty of situations where we need to get some information from code.
For example:
- To review someone code
- To get info on how something works
- To look for a bug
- To understand some cases
But how to do it if I don’t know that particular language?
In an ideal world, all code would be well written, documented, structured, and comprehensibly tested, both with automatic tools such as unit tests and end-to-end tests.
However, we don’t live in an ideal world. We live in the real world, where code never dies and programmers come and go, which leads to people spending an enormous amount of time reading code. This makes understanding unfamiliar code all the more important. Probably more important than writing code.
So, first and foremost, you have to read comments. A well-written project is that one is commented (hopefully). From comments, you can get to understand a code and basic concepts from its project.
If you have some needed tools (e.g. IDE) on your machine you can run or debug some parts of it. Just copy and paste it to a separate file and play with it.
One other method I’ve recently started to adopt is adding some sort of bookmarks above methods that triggers behavior that affects the functionality I’m exploring. This will guide you through the debugging process, and reduce the time spent searching for methods over and over again.
To be honest, if you know the basics of computer programming or any programming language you are good to go! Most languages are quite similar in expressions and style. In the end, I’d like to say that there are many options and the best one doesn’t exist so you have to figure it out in your own best way.
Comments
Post a Comment