Okay, this shit is hard - A look at one of my old code comments

As the title already announces it, and the post image shows, a code snippet of a web scraper I programmed for one of my sites, of course the code to decompose HTML, for this I use the Simple DOM HTML PHP code, but every website is different and although many have great similarities, there are exotic content management systems, where I wonder why so complicated, even if simple, well, probably just to make it difficult for me then 😛

The code I programmed should extract a link to a picture, only this picture link has parameters with further information to further picture sizes, but not as simple Key=Values, but with rectangular brackets and there it becomes already a little bit jerky to manipulate the code in such a way, in order to be able to read out finally this then.

The code itself is easily 5 years old, and in the 5 years I have also been able to expand my knowledge, you never stop learning.

So it's more a relic from my work a few years ago and ultimately shows how important it is to document, especially when the code or function is not easily understandable. The snippet came to me when I was looking for, well, snippets to reduce the programming effort. And there you smile yourself sometimes, when you read: Okay, this shit is hard....

Posted by Petr Kirpeit

All articles are my personal opinion and are written in German. In order to offer English-speaking readers access to the article, they are automatically translated via DeepL. Facts and sources will be added where possible. Unless there is clear evidence, the respective article is considered to be my personal opinion at the time of publication. This opinion may change over time. Friends, partners, companies and others do not have to share this position.

Leave a Reply