When I took my first steps in PHP, I was an old wizard already. Uptime around 35 years, and several other programming languages behind me, PHP was a fresh and somehow fascinating experience to come upon. However, it had been a while since I’d really been in “hacking mode”. I’d done a lot of administration and consulting in general, but grinding code is whole another plank of
Though the way in which I learned doing PHP was under exceptionally busy project, taking a hold of around 10k+ lines of code, with scarce documentation. Like I texted to my friend: “Got a job. Got a weekend and 5 books, reading a lot.”
When you plunge into unknown code, it’s always a bit challenging to adjust to another programmer’s mindset. Depending on a lot of factors, you either start reading the code fluently or you don’t. I was faced with a situation where getting my first production line took about 2 weeks from the start – up until that point I just read over and over the lines, trying to gleam a ray of light among the mist.
Sometimes writing your own coding aids is the best thing to do. It helps in three separate ways; first, you will get to know the syntax and theory of the new programming language (assuming that you are not in your own pond of comfort zone). Second, at least for me, doing a code analyzer also primes me into a specific mindset – I kind of give an extra 10% of concentration. Third, by mechanizing parts of the analysis (or synthesis of new code) you will very likely speed up the development in the long run.
I’ll write a series of texts covering the different aspects of a “code jail” creation. By code jail, I mean taking ahold of a large set of code, putting it into a mechanical analyzer, and then either visualizing or modifying the code in a programmatic way. The code jail aims to capture a lot of aspects from source code; doing lexical analysis, tokenizing, and guiding the programmer in amending the existing code. Since there’s already a great body of open source software that have features similar to what this project aims to achieve, I’ll be familiarizing myself with the tools before trying to reinvent the wheel.