Extremely Defensive PHP - Marco Pivetta - PHPSW: Coding Practices, June 2015

  Рет қаралды 19,636

PHP South West UK

PHP South West UK

Күн бұрын

Пікірлер: 15
@programster_uk
@programster_uk 7 жыл бұрын
I was so pleased when I found this video. You have clearly explained in just 30 minutes what I have always struggled to put into words. Now I can just point them here instead.
@user-hu1jr6fb9k
@user-hu1jr6fb9k 4 жыл бұрын
13:49 why is $transferDate beeing cloned while $amount is not?
@MarcoPivetta
@MarcoPivetta 3 жыл бұрын
Forgot to say it there, but Money is already an immutable (at least common implementations in the wild)
@iancroasdell
@iancroasdell 6 жыл бұрын
Defensive driving is like defensive coding ... great stuff
@TheMarkokene
@TheMarkokene 7 жыл бұрын
Did he start with "Prolly" ?
@jamesfurey
@jamesfurey 7 жыл бұрын
Great talk! Thank you. :)
@dennismatveyev7548
@dennismatveyev7548 7 жыл бұрын
copy paste is better than extend? Explain! Copy paste leads to violating DRY.
@shaunfreeman6056
@shaunfreeman6056 7 жыл бұрын
Dennis Matveyev how about using traits, that's like a reusable copy/paste and does violate D.R.Y
@dennismatveyev7548
@dennismatveyev7548 7 жыл бұрын
I have used traits and have seen it described as language-assisted copy and paste, but it is correct that it does not violate DRY, since it has one source copy and every other class just refers to it from afar, like a pointer
@MarcoPivetta
@MarcoPivetta 6 жыл бұрын
DRY is about not repeating concepts, not about not repeating implementation: if you have the concept of "discount" twice in your system, that's obviously going to be a problem if they run out of sync, but repeating implementation details that are not part of the public API is OK and endorsed. Copy-paste is still better than a bad abstraction, and no, traits are to be avoided as well (explained in a newer version of this talk).
@loupax
@loupax 6 жыл бұрын
Interfaces are used to share design concepts Classes are used to share features Traits are used to share code When DRY mixes those up it causes more problems than it solves IMHO
@MarcoPivetta
@MarcoPivetta 6 жыл бұрын
@@loupax and where would you share code? To me, most (if not all) traits can and should be replaced by external collaborators or pure standalone functions. Sharing the code leads to a lot of scope sharing bugs, and difficult to isolate code, which is also hard to test. EDIT: I just noticed that this is the very first version of this talk of mine. In newer versions, I clearly state that traits should not be used.
Aggressive PHP Quality Assurance in 2019 | Marco Pivetta
59:00
International PHP Conference
Рет қаралды 12 М.
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
Doctrine Best Practices [eng] / Marco Pivetta
46:32
fwdays
Рет қаралды 8 М.
All Rust features explained
21:30
Let's Get Rusty
Рет қаралды 338 М.
RailsConf 2015 - Nothing is Something
35:53
Confreaks
Рет қаралды 30 М.
5 deadly Rust anti-patterns to avoid
13:25
Let's Get Rusty
Рет қаралды 40 М.
DrupalCon Amsterdam 2014: Models & Service Layers; Hemoglobin & Hobgoblins
56:06
From Helpers to Middleware [eng] / Marco Pivetta
45:05
fwdays
Рет қаралды 7 М.
Valhalla - Java's Epic Refactor
52:07
Java
Рет қаралды 83 М.
🚀  TDD, Where Did It All Go Wrong (Ian Cooper)
1:03:55
DevTernity Conference
Рет қаралды 575 М.
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41