Lemmy: Bestiverse
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
RSS BotMB to Lobste.rsEnglish · 3 hours ago

If I hear "design pattern" one more time, I'll go mad

purplesyringa.moe

external-link
message-square
0
fedilink
2
external-link

If I hear "design pattern" one more time, I'll go mad

purplesyringa.moe

RSS BotMB to Lobste.rsEnglish · 3 hours ago
message-square
0
fedilink
Here, read the intro of the Wikipedia page for Command pattern with me: In object-oriented programming, the command pattern is a behavioral design pattern in which an object is used to encapsulate all information needed to perform an action or trigger an event at a later time. You know what I call this? A function. This information includes the method name, the object that owns the method and values for the method parameters. Here’s your command: const command = () => object.method(arg1, arg2); // or in PHP, or in Rust, or in C++... Every time I hear about a design pattern I don’t recognize, I get afraid that I’m missing some crucial idea, and then I Google it and find out that I’ve been unknowingly using it since I started programming. Yeah, bro, I used the data store pattern earlier today (a variable).

Comments

alert-triangle
You must log in or register to comment.

Lobste.rs

lobsters

Subscribe from Remote Instance

You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !lobsters@lemmy.bestiver.se
lock
Community locked: only moderators can create posts. You can still comment on posts.

RSS Feed of lobste.rs

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 25 users / day
  • 118 users / week
  • 377 users / month
  • 1.28K users / 6 months
  • 2 local subscribers
  • 251 subscribers
  • 7.52K Posts
  • 373 Comments
  • Modlog
  • mods:
  • patrick
    cake
  • RSS Bot
  • BE: 0.19.5
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org