Insomniaonline https://www.insomniaonline.de Einfach mal runterscrollen... Fri, 29 Mar 2024 13:16:31 +0100 de-DE hourly 1 Give the code statics https://www.insomniaonline.de/en/give-the-code-statics Tue, 27 Jul 2021 21:27:05 +0200 https://www.insomniaonline.de/en/give-the-code-statics

Yes, I know, statics and static code analyzer has nothing common in the first place, but at last will code be better by using them. Harder. And so they contribute to a solid code structure that makes our applications more stable and better.

Roland Golla writes in the edition 5.2021 of the Entwickler Magazin: "Legacy code makes sick." His article is about PHPStan. How you integrate this static code analyzer in your development environment (and that doesn't mean your IDE only), not only to identify undiscovered sources of error but to improve your skills and your knowledge as developer.

You just can't know everything, development in PHP takes place in ever shorter release cycles. On the other hand, the customer's aging application is maintained. Every developer has to cover an enormous range of features that are made available by the PHP version used in the respective project.

In my opinion, the unbelievably beautiful and always fascinating thing about being a software developer is that you learn something every day. Really every day. And tools like static code analyzer can help. I think everyone knows the feeling when you look at code from three, maybe four years ago, shake your head and then after a courageous "git blame" would like to sink into the ground when you realize that you have produced this legacy code yourself.

Static code analyzers start with the first development and help you to write a lot of clean code. They don't necessarily help you to write better program logics, so you can still nest the business logic so uselessly and implement it difficult to understand. But hey, there are other tools like Performance Profiler (Blackfire etc.) that you can throw at this problem.

I can only recommend tools such as PHPStan, rector, Psalm etc. to anyone, in addition to the tools such as PHP-CS-Fixer or PHPMD, which have hopefully been used for years. To analyze code, refactor it, and most importantly, learn. Quasi as pair programming with a tool and not with another developer. Or as a code review before the actual code review.

Disclaimer: Roland Golla made the above-mentioned edition available to me free of charge, for which I thank him very much. I've lost sight of print products for a long time when it comes to programming or topics on the web. But once again it was a wonderful experience to have paper in hand while reading. I will not make a subscription now, but if I should ever travel by train or something again, I will look for such magazines at the station kiosk. Otherwise, I can recommend his YouTube channel "Never Code Alone", which I follow regularly. His videos are mainly about testing, refactoring and general topics about being a developer.

]]>
FLoCculated https://www.insomniaonline.de/en/flocculated Sun, 18 Apr 2021 21:33:52 +0200 https://www.insomniaonline.de/en/flocculated

I haven't seen a message from all browsers besides Chrome that want to integrate Google's cookie “replacement” FLoC to track user behavior. But just to really make sure that your own website does not participate in the whole thing, you should prevent the whole thing with a Permissions Policy. Since there is currently only the OptOut using the HTTP response header, you have to put a stop to the whole thing either directly via the server configuration, the htaccess file or by setting the headers using TypoScript:

config {
    additionalHeaders {
		10.header = Permissions-Policy: interest-cohort=()
    }
}

Of course, please adjust the order in the additionalHeaders array, I'm assuming that there are a few more headers such as content security policy etc.

]]>
2021-2 https://www.insomniaonline.de/en/2021-2 Sun, 10 Jan 2021 21:02:35 +0100 https://www.insomniaonline.de/en/2021-2

In the future I would collect the best and most useful articles/websites collect in a list to hold on the one side my list of read articles small and maybe it helps someone on the other side. If anyone even reads my blog. Which I am not assuming.

So let’s start:

  • Xdebug or actually the sponsoring page from Derick, who is the maintainer and inventor of the best debug tool for PHP. Go! Support! Because also developer want to earn money.
  • TYPO3 Rector: actually I wanted to use my vacation for a lot of learning and looking about things over the holidays, but sometimes it happens different. I will use it for the next refactoring/migration and will report about it.
  • Laragon: I am a strong advocate of DDEV for a server environment for local development with TYPO3. Laragon apparently wants to be something like that. Unfortunately I haven’t seen it yet, because I’m more than satisfied with DDEV.
  • A nice “Everything was better (different) before” article about OpenSource development: The Golden Age of Open Source is Over
]]>
Everything must leave https://www.insomniaonline.de/en/everything-must-leave Tue, 05 Jan 2021 22:52:12 +0100 https://www.insomniaonline.de/en/everything-must-leave

In the last year which is not allowed to be called by name, I had so many plans and really achieved only a little bit of it. Because I'm doing something wrong (or different) than everyone else who was also in the home office and felt had have always leisure time or at least were so deeply relaxed, that I have started with meditation in the later summer to get to the same level. The meditation I've given up fast because that is a thing that just doesn't work for me. Apparently you have to believe in it just like with homeopathy, and that's just not what my brain is made for.

I didn't get into blogging as I had planned. Just write texts. For me. And put them on the Internet. For whatever reason. Because that's how it was done in the early times of the Internet. Where the internet wasn't quite as broken as it is today.

Maybe I'll even publish a blogroll here soon, because it there is it still there! The little blogosphere and also the tech bloggers. But I will start with a selection of articles and websites that I saved in Pocket last year and forgot. Of the almost 300 entries I will left these here, maybe one or the other will find something that will help them.

Web design

TYPO3

DevOps

PHP

Programming in general

]]>
Speed is everything https://www.insomniaonline.de/en/speed-is-everything Sun, 30 Aug 2020 19:22:33 +0200 https://www.insomniaonline.de/en/speed-is-everything

There are investigations for everything. Also for how the loading time of a website affects the possible bounce rate of the visitors. And it's hard to believe, but the bottom line is that the longer it takes a website to load, the higher the chance that the visitor will close the tab. Incredible.

So you should do everything possible to ensure that a website is delivered and, above all, displayed as quickly as possible. Apart from the fact that you should make sure that elements in the visible area are rendered first and certainly not flip back and forth while loading, another factor that can be easily influenced is keeping the number and the size of the required resources like stylesheets and JavaScript as small as possible.

The AssetCollector has been integrated with TYPO3 10.3. With this, scripts and stylesheets in Fluid files can be added to the rendering process with the ViewHelpers f:asset.script and f:asset.css. They behave similar to the renderAssetsForRequest already added in 8.6, with which you could render the corresponding code via the two Fluid sections HeaderAssets and FooterAssets.

The key difference is that, as the name suggests, the AssetCollector first collects the stylesheets and scripts and then only includes them once in the rendering. This means that I can reference the same JavaScript file in various Fluid files with the same name, which I need for example for a slider, but which is then only stored once in the document using a script tag at the end of the document.

Another advantage is that in this way you can ensure that only required resources are sent to the browser and not a JavaScript plugin for an accordion, which is not rendered on the page. Of course, this negates the concept that you always send the same resources to the browser so that it no longer requests them on the second page because it then takes them from its cache.

But with the simultaneous use of HTTP/2, which ensures that the resources for rendering the website are delivered to the browser before it even knows that it needs them, a speed advantage is still achieved in conjunction with the small data size and is especially noticeable in a faster rendering of the page. It is not at all bad that the resources are not integrated into the concatenation or compression process of TYPO3, as you were used to when you integrated your resources using TypoScript.

And so you have already made a few more visitors to your website happier.
And yes, I know, I have unfortunately not yet activated HTTP/2 on this page. It's not me. I'm sorry.

 

]]>
How can you only live without a shell? https://www.insomniaonline.de/en/how-can-you-only-live-without-a-shell Fri, 22 Nov 2019 22:46:00 +0100 https://www.insomniaonline.de/en/how-can-you-only-live-without-a-shell

Hello, my name is Stephan, I'm in the beginning of my fourties and I'm developing under Windows.This is how I would introduce myself to the anonymous developers. After twelve years with macOS I must occupationally get along with Windows since middle of this year. What is going well now, because Windows isn't more bad than macOS or Linux. And the other are not better. Only different.
You realize, I'm in the phase of denial.

But honestly, what do I really need? An IDE (PhpStorm) and DDEV as configuration software for Docker. And a shell.
And the last one is missing under Windows. cmd.exe and the Windows PowerShell can't belong to iTerm2 with Oh My Zsh. And also after several months I'm crying after my shell under macOS. I have by now found a replacement with ConEmu and Oh My Posh but a PowerShell really does not feel so good in comparison to zsh. But there is also the Quake mode with ConEmu.

]]>