our biggest client prefers data as Jason so we swapped half of our database to that
the app I work with currently stores json as the only column in a sql table and it hurts me so very much. like watching someone pick up a screwdriver and try to bash a nail in with the handle.
Piling on to this, part of what makes MAM great is that you get bonus points for seeding even if no one is downloading. Just keep your torrents running indefinitely and it won’t be long before you have free VIP forever, a 10:1 ration and still end up with more points than you could possibly give away
This is the kind of pointless comment I see in my codebase all the time. Best I can tell, a couple of my coworkers like to plan out their code using comments, then backfill in the actual executable code. That’s fine, but they leave the comments in when they add no value.
` public static LocalDate parseEndDateFromString(String dateString) {
<span style="color:#323232;"> try {
</span><span style="color:#323232;">
</span><span style="color:#323232;"> String[] split = dateString.split("-");
</span><span style="color:#323232;">
</span><span style="color:#323232;"> //In order to get the last day of the desired month, we go to the first day of the next month, account for rollover, then subtract one day
</span><span style="color:#323232;">
</span><span style="color:#323232;"> int month = Integer.parseInt(split[0]) == 12 ? 1 : Integer.parseInt(split[0]) + 1;
</span><span style="color:#323232;">
</span><span style="color:#323232;"> return LocalDate.of(Integer.parseInt(split[1]), month, 1).minusDays(1);
</span><span style="color:#323232;">
</span><span style="color:#323232;"> } catch (Exception e) {
</span><span style="color:#323232;">
</span><span style="color:#323232;"> throw new RuntimeException("Invalid date format - must be MM-YYYY");
</span><span style="color:#323232;">
</span><span style="color:#323232;"> }
</span><span style="color:#323232;">
</span><span style="color:#323232;">}`
</span>
Stuff like this, otoh, is where comments are useful. The required format is obvious from the error message, the param and return from the method signature, the only part that requires a comment is the fiddly logic of accounting for the edge case where month == 12 and the rationale behind how we determine the last day of the month. As a rule, comments are for why something is being done, if it’s not obvious, and for magic numbers. Code should tell you what code does.
edit: can anyone spot the bug that I introduced with that parseEndDateFromString() method?
anyone who wants to leave can go. Hell, I’m responsible for two of the lost users because when i first came over here I misunderstood how this works and made a new account on each instance. what’s up @reverendsteveii and @reverendsteveii?
burnout paradise. I’ll just put on a podcast and drive around. Sometimes I’m seeking out races, or new best times on roads. Sometimes I’m just driving around more or less obeying traffic laws like a reasonable citizen.
The issue is the filter that we’re using to avoid multiple encoding attacks de-escapes everything via multiple rounds, then tries to pass it to the next layer of filtering with the de-escaped request body as a json string. Your absolutely right that this is a silly way of doing it, but sometimes we have to live with decisions that were made before we were onboarded to a project. In this particular case, I pushed to improve the filters but all our PO heard was “spend development time weakening security” and at the end of the day they decide what to do and we do it.
I work on a Web app and we recently decided that we’re just not gonna support double quotes in free text fields because oh holy balls what a thing it is to try to deal with those in a way that doesn’t open you up to multiple encoding vulnerabilities.