just switched jobs and the owner of the code had just left. the code is hardly commented and there is no proper documentation in a language i am not fully familiar with. i spoke to my manager abt this and I was told to hang in there for a few weeks until some resolution. they also added to treat it as a good first project and as an opportunity to dazzle everyone 😉. how would you go about understanding the code? ps: i saw dinesh and gilfoyle understanding Richard’s code after he left in Silicon valley — looking for some tips like that. pps : language is in objective C
You start with tests. If you are able to understand what tests test, you will get a bird’s eye of codebase.
What if youre expected to write the tests for a code you have no understanding of?
Then you try your best to write some tests that capture the current behavior of your system. Starts from there as the invariants of the system.
Single step debugging is the best way to learn the code. Example: going thru end to end flow of getconfig.
Objective-C is pretty verbose, it would be unusual to see it heavily commented. Set breakpoints and use the view debugger to find the relevant classes.
Write UTs and you're on your way. Writing tests for legacy code can a living nightmare but you end up understand wtf is going on and have living documentation of it
Start rewriting the codebase or parts of it in Swift.
Thats not an option
Maybe obvious, but use an IDE to navigate the code and jump to definitions, callers, etc. Some decent tooling can alleviate significant pain.
Print it and read it.
Tech Industry
Yesterday
1872
Do people underestimate E6 role at meta?
World Conflicts
Yesterday
507
Why I Find Free Palestine Inspiring
India
Yesterday
697
'Hindutva': The Radical Hindu Ideology That Seeks to 'Push Christianity Out of India’
World Conflicts
Yesterday
666
Israeli precision-guided munition likely killed group of children playing foosball in Gaza, weapons experts say
Tech Industry
Yesterday
361
Machine learning, 6 yoe, no PhD, $310k TC. How am I doing?
Recommended reading: "Working Effectively with Legacy Code".