h2
Legacy Codebase: A Love Story
h2
What have I learned so far in my job?
h2
What did I learn as IT specialist for system integration?
h2
Timeout Problems: Web Server + PHP
h2
Understand your Timeouts.
h2
PHP: Code Quality with Custom Tooling Extensions
h2
Prepare your PHP Code for Static Analysis
h2
What did I learn as IT specialist for application development?
h2
Generics in PHP via PHPDocs
h2
❤️ Simple PHP Code Parser
h2
How to write readable code?
h2
Modern PHPDoc Annotations
h2
1.0 PhpStorm & auto-generate PHPDoc blocks
h2
1.1 Return $this|static|self
h2
1.2 New (and not that new) Array Syntax
h2
1.3 Dynamic Autocompletion (+ data from your database) via deep-assoc-completion
h2
1.4 Immutability Check via Static Code Analyses (via psalm)
h2
1.5 Generics in PHP via Static Code Analyses
h2
Arrayy: A Quick Overview of map(), filter(), and reduce()
h3
Should we write code that everybody can read?
h3
Why do we write unreadable code?
h3
Type variables via @template
h3
– You never stop learning…
h3
– Try to write code every day. (but set yourself a LIMIT)
h3
– Think in modules and packages…
h3
– Open-Source-Software
h3
– Use GitHub and learn from the best.
h3
– Automate your tests.
h3
– Deployment is also important.
h3
– Understanding concepts is more important than implementing them.
h3
– Solving problems also means understanding customers.
h3
– Solving problems also means understanding processes.
h3
– Spread code across multiple files.
h3
– Readability comes first!
h3
– Good naming is one of the most difficult tasks in programming.
h3
– Save on comments (at least inline)…
h3
– Consistency in a project is more important than personal preferences!
h3
– A uniform code style has a positive effect on quality!
h3
– Use functional principles & object-oriented concepts.
h3
– Please do not use global variables!
h3
– Learn to use your tools properly!
h3
– Exceptions === Exceptions
h3
– Source code should be searchable [Ctrl + F] …
h3
– Program for your use case!
h3
– KISS – Keep it simple, stupid.
h3
– DRY – Don’t Reap Yourself.
h3
– The will to learn and understand something new is more important than previous knowledge.
h3
– Read good books and magazines.
h3
– Follow other programmers on Twitter / GitHub / dev.to / YouTube / Medium / …
h3
– Listen to podcasts & subscribe to RSS feeds / newsletters & watch videos, for example from web con
h3
– Attend Meetup’s & web conferences and talk to other developers.
h3
– Post answers at quora.com || stackoverflow.com || in forums || your blog…
h3
– Don’t stay at work for so long every day; otherwise nobody will be waiting for you at home!
h3
1. Custom PHP-CS-Fixer
h3
2. Custom PHPStan Extension
h3
– You only learn as much as you want to learn.
h3
– Unix & command line <3
h3
– Read the official documentation.
h3
– Always make a backup (never use “sudo” drunken).
h3
– Be honest with customers, employees and yourself.
h3
– Ask questions if you don’t understand something.
h3
– Think about what you are doing (not only at work).
h3
– Use Google correctly …
h3
Here is what helped me mostly while working with old existing code.
h4
Analyzing: Here are some things that helped my analyzing software problems in our codebase.
h4
Fixing: Here are some tricks for fixing existing code more easily.
h4
Preventing: Here are some hints how you can prevent some bugs.
h4
1. Write code with IDE autocompletion support.
h4
2. Magic in Code is bad for the long run!
h4
3. Break the spell on Magic Code …
h4
4. Try to not use strings for the code.
h4
5. Automate stuff via git hook and check it via CI server.
h4
6. Use array shapes (or collections) if you need to return an array, please.