Clean Ps2 Controller

0 views
Skip to first unread message

Etienne Levic

unread,
Aug 3, 2024, 5:54:10 PM8/3/24
to plougrillnawon

Picturing sweaty, warm hands going ham on a controller isn't pleasant, but chances are, your gaming controller could use a touch up. As we enter another year, this is an awesome opportunity to examine the state of your peripheral.

Note: While we don't recommend them, if you do choose to use sprays or any other cleaning and disinfecting products on your equipment, please carefully read all labels to ensure safe and correct use for both your belongings and your own health.

So, me and my friends were playing last night while eating some snacks, and, as a result of my lack of attention, the controllers got all greasy. I tried using a napkin to clean it, but it still feels kinda greasy.

I think this is a valid question. Been there myself with controllers and keyboards and T.V. remotes. They are electronic, and you don't want to get water into the buttons, etc. So a wet soapy rag seems to be a bad idea.

What I do personally is wipe it clean with a paper towel, then I take a wash cloth, get it wet and soapy(with dish detergent), and wring it out really well BEFORE wiping my controllers. You will still have enough water and dish detergent to get the grease off, no problem. Then dry again with paper towel.

some lemon juice will probably be all you need. any non-destructive degreaser (ethanol, citric acid, vinegar, ... ) will help you out. Just make sure your application cloth is damp, not soaked, so not to destroy any electronics inside.

Gaming is a good way to pass time during this period of social isolation. (Um, the new Animal Crossing, anybody?) But just think of all the times you've touched your face while gaming, and snacking on a bag of chips, and petting your little furry friend. Yeah, it's about time you clean the damn thing.

Full disclosure: It's not as simple as it seems. Nintendo, Xbox, and Stadia all warn against using any liquids or chemicals on these controllers; all they recommend is a dry wipe. (PlayStation doesn't have an official cleaning guide, but it's safe to assume that it'd issue similar precautions.)

If you want a full disinfection of your video game controller, then you'll have to bend the rules a little and use a bit of liquid at your own peril. Do make sure you are very, very careful with that, though.

Turn off your controller, and remove all cords and accessories. This is key to minimizing the risk of breaking your darling controller, so make sure you're not just putting it in sleep mode. If you have a Nintendo Switch, remove the game cartridge and the two joy-cons before proceeding.

Use a Q-tip or a dry toothbrush to remove debris and crumbs from the casing and buttons. Clean the surface area between different buttons and parts, as well as the button and parts themselves. Don't forget the charging port and the space under the joysticks.

Use a cloth to give it a more comprehensive wipe. Now that you've taken care of the detail, give the controller a nice wipe front and back. This is your chance to take care of any surface that you have not already cleaned.

Optional: Gently mix dish soap and water. Use your common-sense judgement to determine the ratio. Try to avoid foaming the mix when you're mixing it. Skip this step if you're using a disinfectant wipe.

Optional: Repeat steps 3 and 4 using a damp Q-tip and damp cloth, or a disinfectant wipe. Again, Nintendo, Xbox, and Stadia do not recommend using any type of liquid. Make sure you're exercising caution.

I'll admit it. I'm not a fan of callback filters in Rails. It's one of those things, like spring and turbolinks, that I remove when I encounter them. I mean no offense to the people that wrote those things. I'm sure they have their places, but I am suspicious of anything that saves me a few imperceptible seconds here and there yet winds up costing a very tangible hour every few months because of some hidden detail. Once bitten, twice shy.

The most obvious problem with callback filters is how unobvious they are. If you are debugging, you have to know of and remember about their existence even though you will never encounter it; you can't simply trace through code line by line because they do their business out-of-band. That requires you and your classes to have knowledge of how unrelated classes behave, sometimes they are not even in the inheritance tree. One could argue this is antithetical to the the single responsibility and encapsulation principles of object oriented design, but let's not go there.

However, "Set this variable before these five methods," is not a valid use-case. It's lazy, inconsiderate, and not doing anything that can't be done better some other way. If your mantra is I clean up code by hiding it in a callback then you are violating the Principle of Least Astonishment (POLA) and let's do go there. It's sweeping a mess under the rug, which is not really "cleaning up."

For the past three years, I have been substituting callbacks and class variables with memoization to clean up code and improve readability while also adhering to both POLA and DRY. It works in controllers very well, but in models just as nicely. It's one of those tools, like Tell Don't Ask, that really improved my code quality once I adopted it.

I'm not going to make this into a tutorial and go through it step-by-step. Instead, let's cut to the chase, shall we? This version replaces the callback with @article memoized into an article method.

The benefits will come when someone tries to debug this class. But it will really start to show as this class grows. Let's say you need to add a non-RESTful action to "approve" an article. That might look something like this:

I didn't need to edit the method array in callback definition because there isn't one. If you have to maintain a piece of code so another piece can run, that violates a core principle of Rails, Convention Over Configuration.

Depending on the complexity of the controller, I might also memoize article_params into an parms method. If you are running through the params hash for filtering and sorting calling require, permit, and merge is redundant and therefore inefficient. "Repeating Yourself" doesn't just mean typing the same thing over and over, it also means doing the same thing over and over. Memoizing means that those methods are only called once.

Recently, I've been studying Clean Architecture and I have some doubts. I want to make a REST API that adheres to this architecture. To do that, I define my entities, use-cases, etc. For each endpoint, I use a different controller that calls for a use-case. My problem is that for all examples of controllers that I have seen, they use the request object of their respective framework as argument for the controller. For instance, the Request object of ExpressJS.

Don't introduce additional complexity with a mapper. At the very edge of the application, something has to depend on the framework. You controller can take the request object, convert it to whatever data structure the use-case needs, and pass it along. As the software evolves, if the logic in the controller ever becomes more complicated (e.g., the controller needs to do more work after conversion, but before calling the use-case), you can extract that into a separate object that now represents your controller, and what was left behind (the original controller) is now a gateway to the framework, or perhaps just some glue code.

Think of the Clean Architecture as more of an ideal to strive to, rather then something you need to setup exactly right from the beginning. It sort of gives you a mental framework for thinking about how to structure your software and control the coupling as the codebase evolves.

At the very beginning, you don't have enough information to make all the right decisions. You can make some generalized educated guesses, or some problem-specific assumptions if you're particularly familiar with the problem domain, but there are going to be things that are architecturally relevant, that you're only going to learn over time, as you work on your code and as you release and get feedback - your understanding of the problem (and how it should be represented in code) will improve, you'll start to figure out what the different axes of change are (SRP), what aspect are stable/volatile, what parts of your codebase change most often, etc.

This is why Agile is against the "Big Design Up Front" philosophy, and favors instead some (reasonable amount) of design at the start, followed by a bunch of short iterations where you get to redesign aspect of your codebase in response to what you've learned.

The problem is, if you design too much too early, you'll come up with a bunch of abstractions that are wrong for what your application actually needs to do, and you won't know it until later when they get in your way. Abstractions1 are hard to change because they encode our assumptions, and everything else depends on them. This is also why we have heuristics like YAGNI, and the Rule of Three - both of these essentially tell you to wait a bit longer to see if your assumptions check out.

1 Abstractions are often interfaces and abstract classes, but they don't have to be - they can be concrete classes, data structures, mechanisms that rely on a naming convention, etc. An abstraction is just something that captures certain key aspects of some thing, allowing those that use that abstraction to not worry about the details that are irrelevant. A wrong abstraction is one that misidentifies which aspects are essential vs which are irrelevant in a given context.

So with that in mind, don't try to solve all the problems at once, and don't expect that you'll never have to redesign anything; the idea is to steer the design towards something that's more stable (based around a set of abstractions that don't change often) and something that better serves the needs of your application (including making certain aspects of it easier to change).

c80f0f1006
Reply all
Reply to author
Forward
0 new messages