Nah, design patterns are mostly communication tools.
When you name something "factory", when some doc mentions "dependency injection", when you import a "register", when you talk with a colleague about a "decodator", if you know the name, you already know what it does, and what the API will probably look like.
I say probably, because we don't have a format definition of all design patterns, nor are they all recognized as such. For for the ones that are and we do, we don't all agree. Not to mention you must adapt them to problems and languages.
So sure, when you code and you encounter a problem, you may use a design pattern. But you don't explicitly do so. Just like a chess master doesn't chose a move by thinking "I'm going to use x", they just decide on it, and also adapt it to the situation.
I never think about design patterns when I code, only when I name the code, I write the doc, and talk about it. When I communicate.
If you read a book about design patterns, they will make no sense to you. You will probably misuse them. But if you look at real life source codes from other devs, or yours again and again, you realize some problems come back often, and a lot of people use similar solutions. Then you look it up: bingo, it has a name.
That's how it works, not the other way around. It's formalization of real life, not theory to apply.
> Just like a chess master doesn't chose a move by thinking "I'm going to use x", they just decide on it, and also adapt it to the situation.
This is an interesting analogy maybe someone who knows more about chess can correct me, but don’t chess masters have elaborate memorized openings and end games where they do decide to use “the indian defense” then go on autopilot until someone deviates from the common lines?
The idea is that they won't tell themself, "I'm going to use the indian defense".
Just like I won't tell myself "I'm going to apply the strategy pattern here".
We just see the situation, and if it calls from a solution from the banks of solutions we have encountered in the past, we see if it fits, we try to apply it if it does (tailoring may be necessary).
Then the commentator later may say "oh, he decided to use Y". But that's for the benefits of the people watching.
if you consider the idea source -- Alexander's A Pattern Language -- the notion of a pattern is a more useful than that; it is both a communication tool, as well as the realization that the problem (in his case, buildings) can be subdivided into smaller parts, and at a certain level, these parts fall into common repeating forms (patterns). You can thus mostly initialize the design by simply composing patterns together.
The key that typically gets lost in GoF pattern discussions is that it doesn't end there. Once the patterns are decided, you need to account for the non-standard details of the problem at hand -- e.g. the house is partly on a hill. The hill raises the height of the door. The door had a relationship with the window -- it's no longer aligned, and will have to be modified to fit. With the shift of the window, the mirrors need to change.. and with the mirrors, the door. Eventually these changes will stabilize, producing an equilibrium (TB: he declares that equilibrium to be "beauty", and a feature that everyone can innately detect, though they may not know how to reach it... this corresponds strongly to "code smell" or "elegance" in programming)
So the elements of the home starts as patterns, but they're also in a fluid state, and the effects of reality will trigger a feedback loop, creating continuous design reflows, until the whole thing reaches an equilibrium (and you can now build the house).
He then goes on to note that the home exists in a continuously fluid state (as it's used and changed by inhabitants), constantly deviating from that equilibrium, and being brought back into that state. So the most beautiful homes are those not designed into a harmonious state, but maintained in a harmonious state -- I particularly like the correspondence to programming here.
Yes, but even after the opening lines are exhausted, a huge part of expert chess play is just intuition and choosing which moves “look right”, rather than conscious thought and calculation (though that too has its place).
It's also because the britanic banking system decided that, on the safety / usability balance, they would choose usability.
Banking in britanic banking system is way easier than anywhere else. I remember when I was a student, they sent a bus to the university, so we could just hop in, arrive at the bank, and open an account as an immigrant in 15 minutes.
Try to do that in France, you would get your card, what, next month at best?
It was only a matter of time before the criminals realize the door was unlocked and feast on them.
In fact, I'm expecting Australia to be next, for the very same reasons.
Have you tried to do any paper work in Australia ? It's. So. Simple. Seriously, for a french, it's a video game on easy mode, and you never leave the tutorial.
But there is trust everywhere.
They are either going down, or make the system harder to work with.
The important part is that you are able to look up/personally verify that you are contacting the correct people. If I lose my card I can still look up the right number on my banks website. Because you cannot confidently identify a caller it is better for the customer to reach out using more easily verified information.
Well yeah.. but again, the number could also be in the footer of the banks website.
People usually get scammed when they have the card with them... when they lose the card, they're the one actively looking for a phone number, and not presented with one from a scammer.
- "Sir, I'm calling you because I found your card, I called your bank, and they gave me your number. They told me you should report the card as lost in case it's been used fraudulently with the phone number that is written at the back of the card"
- "Can you send me back the card?"
- "I'm in a train, I won't be able to do that for a while. You should really call"
Good thing there are no data leaks or compromises! /s
That my bank insists on using essentially now public information now to verify (and refuses to use anything else, even after being repeatedly asked!) is also infuriating. Last 4 of SSN and DOB? Really?
Well, the point isn't that my bank wouldn't "leak" my details - I certainly don't trust them that far. So it's absolutely possible for a random person to get my phone number from the bank. But if a random person were to phone me and tell me that my bank gave them my phone number to be helpful, I'd be calling that out as a lie.
If someone spoofs the banks number on caller ID (trivial), knows all your security question answers, the bank you bank with, and your number - very few people are NOT going to fall for some kind of attack there correct?
How could they figure out the internal account number without hacking into the bank in the first place? I’m fairly certain there’s no way to derive the account number from a debit card number or any of the info you mentioned.
Additionally, bank account ‘internal’ account numbers are pasted on every check that goes out and any ACH transfers also include that information, so it’s not like they are hard to cross reference with any of the other major breaches.
SSN, dob, which banks people use (and other financial institutions), which loans they have with whom, etc. also got leaked for pretty much every US adult with the equifax hack.
If my bank has blocked fraudulent transactions for a card I've lost, I'm not in much hurry to respond. They've already blocked it, and I don't have the card to use anyway.
TL;DR: the author has working code for a CPython 3.9 implementation that gets rid of the GIL, works with most C extensions (albeit requiring to compile them again), and with better perfs _including_ for single threaded programs.
The report is worth read, very clear, professional, and humble, which for such a complex achievement, is quite a thing by itself.
They recently added a systematic scan, compare and report routine to all your pictures.
They forces you to tie your phone to an Apple account just to use it. My android phone doesn't have an account, or even an email linked to it.
Apple now has an entire mesh network of BT devices constantly looking up each others, even if some of them are not connected to internet.
The microphone on the Apple device is always on, to answer to hey siri.
Finally, you can't install a real alternative browser on iOS, so no real privacy addons.
They make big claims about privacy nobody can check because everything is closed source. So you have to just trust them.
"But apple doesn't have an ad business"
Oh but they do. And they don't have to play by their own rules in the app store, and have the right to track users, gather device informations, location, etc. Fun thing is, they start the list of information they collect (https://www.apple.com/legal/privacy/data/en/apple-advertisin...) by stating "Apple-delivered advertising helps people discover apps, products, and services while respecting user privacy".
I don't think they are any better, just different. And better at PR.
Blindly doing anything without first having tried to understand what the pros/cons are and in which contexts the advise applies and where it doesn’t is crazy.