42

"We want a perfect PHP dev"

... yea, and he will produce shitcode like

switch(true) {
case 1 < 2:
...
case $a == $b:
...
}

no thx

Comments
  • 3
    This is horrible. But I do use ot sometimes for checking the type of exceptions. Each case is then almost the same so less horrible and mor readable than ifstatements.
  • 4
    They should search for good devs who know PHP rather than good PHP devs. Because good PHP devs are not good for some reason.
  • 0
    People do this because PHP (and many other OOP languages) are missing a feature called "pattern matching" — so they abuse the switch statement to perform the task.
  • 1
    @taylan

    I think Java/C# do OOP better, Rust and Haskell do types better, and most C programmers will do optimizations and algorithms better.

    PHP is useful because you can quickly get to where you need to be in terms of web development.

    But you need discipline to structure your code, to create the right kinds of classes, tests and type checks.

    I wouldn't say that a dev who only knows PHP is always bad, but PHP is certainly not the best place to learn about those disciplines.
  • 1
    @Lahsen2016

    At this point I think it's safer to just kill yourself.
Add Comment