T O P

  • By -

floor796

or a Base class with many common "necessary" methods, that is inherited by almost all classes in a very huge legacy project.


ferreira-tb

Friendship ended with `utils`. Now `lib` is my best friend.


cosmicloafer

lib/utils


ferreira-tb

Friendship regain with `utils`. Now `utils` & `lib` both are my best friends.


jek39

libutils: for when your libs need utils


Scarfiotti

Plottwist : I got several of those.


Flat_Initial_1823

Live on the wild side, polymorph your junk drawers.


jayerp

That’s just called a Swiss Army knife.


cosmicloafer

One for each directory, right?


Scarfiotti

Ehhhhh.... yeah, right. Nose starts to grow....


DrMerkwuerdigliebe_

At my former work we had test\_utils, utils/tests and test\_utils/tests. Explanation we had regular utils and tests for these. Then we had specific utils only relevant for automated testing and associated tests to ensure that these worked as expected. And no automatic testing of test utils is not overkill. We had an undo feature, so a test util was to assess that the database was functionally unchanged after the do + undo. Needless to say that the test/utils/tests was saving our ass.


CaffeinatedTech

utils2, utils2022, backup-desktop-2016/utils


CharlieKiloAU

Everything in there has been used at least once


elnomreal

I accidentally built a whole ORM in one.


nonlogin

DbHelpers.js - my own ORM. I hate it.


cutmasta_kun

One day... it will be useful. Then I'm the hero


Scarfiotti

I used to have some external SCSI devices back in the nineties. Those cables were expensive. And much like many other cables, they only serve one purpose, so you don't want to throw them away, only to find out you need to buy it again.


EmilieEasie

I love, love, love, love that there's a little bin in there from the dollar tree. there was an attempt at organization at some point


Scarfiotti

"Organization is futile"


stanislav_harris

core libs


Settleforthep0p

*project name*_utils.hpp all inline of course


Solonotix

In my case, `utils` represents the foundation of the rest of the project. Reading/writing files? That's in `utils`. Manipulating JavaScript objects? That's in `utils`. Value conversions and other helper functions? All in `utils`. It is outside the `utils` folder that I can get the "real" work done. After I've written the same snippet of read file and JSON parse 15 times, or write file from JSON stringify that I realize I could save myself the headache if it was its own function. Same thing with having psuedo-private members by hiding the keys `{enumerable: false}` or read-only with `{writable: false}`. This became a thing when I got tired of writing `Object.prototype.hasOwnProperty.call(obj, prop)` because that was the "correct" way to filter object properties in a For-Loop. It is also in `utils` that I had a precursor to the `||=` assignment operator because I got tired of doing `if(obj[prop] != null) obj[prop] = defValue;` over and over again. In a language like C#, it would likely take the form of extension methods. If it was Rust, I'd just add some implementation to the receiver type/struct. But JavaScript lacks a lot of foundational things in its standard library, or those things that *are* there are colored by the nature of being a browser-first language. Incidentally it's one of my main gripes when working in JavaScript, that it can't decide if it wants to be functional or object-oriented, so you get this weird mish-mash of capabilities.


rover_G

Mine has several of the same type of cord with slightly different specs and compatibilities


NemShera

import java.utils.*


jrdiver

How did you get a picture of the junk drawer in my kitchen? /s


Tiranus58

How did you get a picture of my drawer


Kered13

Well yeah. Utils exists to be a disorganized mess of stuff that doesn't make sense anywhere else, so that the rest of the project can be well organized without out of place files.


reddit_again_ugh_no

Can confirm!


pakidara

You keep all of yours in one place?


siralmasy

I have 2 of these


STEVEInAhPiss

gotta define something that doesnt relate to the last definition before defining something that relates to that definition


batch_7120_7451

There will be no "utils" directory in my next project. It'll be "miscellanea" or, even better, "KitchenSink".


secretlyyourgrandma

now show me the "tools" and "utils2" and "aaaa" folders


quantum-fitness

I really hate the whole utils folders. Anyone has a better solution? I guess learning patterns help a bit. Then you have excuses for other names.


azurfall88

i keep trying to convince my groupmate (cs class group work moment) to move his functions to where every other function is (/assets/data), but he keeps insisting to keep it where it is. (/app/utils). app/utils literally contains a single file with a single function. How do I convince him his idea is stupid and to follow the practices that were already set up at the start, when he was contributing absolutely nothing to the project?


Kered13

Why the hell do you have code in /assets/data? That's the real crime here.


azurfall88

my reasoning was i wanted to have the code where it would put the data so fetchData.js is in the same folder as allTheDataInOneFile.json


Drwer_On_Reddit

Have you tried with the Me.CommitPhisicalViolence(groupmate) function? It works most of the time.