That makes sense.
That makes sense.
You make some great points. Using smaller functions and breaking up your code in readable bits makes a huge difference and you will likely never need comments if you do it right 👍🏻
I understand what you’re saying and I mostly agree, but those few instances where a line of code is only slightly different and the comment is the same, can really be confusing.
It’s not that deep. It looks nice, and is easy to understand.
Yes- exactly, they make comments wrong. But comments aren’t always a waste of time, like in legacy code, or just in general code that isn’t gonna change (mathematical equations too)
Fair. I guess in this case, it’s a manner of gauging who you’re working with. I’d much rather answer a question once in a while than over-comment (since refactors often make comments worthless and they’re so easy to miss…), but if it’s a regular occurrence, yeah it would get on my nerves. Read the fuckin name of the function! Or better yet go check out what the function does!
I mean, boolean short circuit is a super idiomatic pattern in Javascript
Yeah. I advocate for self explanatory code, but I definitely don’t frown upon comments. Comments are super useful but soooo overused. I have coworkers that aren’t that great that would definitely comment on the most basic if statements. That’s why we have to push self explanatory code, because some beginners think they need to say:
//prints to the console
console.log("hello world");
I think by my logic, comments are kind of an advanced level concept, lol. Like you shouldn’t really start using comments often until you’re writing some pretty complex code, or using a giant codebase.
It’s a silly asset dump that has incredible depth!
Most of the stuff here can be avoided by using quotes for strings…
Yeah but Haskell is mostly used by mathematicians…
People hate hearing that they are bad coders 😂
You and the other guy are saying to focus on writing code with less indentation and using smaller methods, and you both got downvoted.
I fully agree, small methods all the way, and when that’s not possible it’s time to refactor into possibility!
But it’s not a markup language… It’s for data serialisation…
Badass or stupid and incompetent? Take your pick lol
For me it just depends on what I expect. They’re all relatively the same thing. As long as the status code is appropriate (403), it doesn’t matter whether it’s JSON or plaintext. Ideally the API would respect and handle the request header, and return plaintext if you request plaintext.
I agree with your point, but our algorithms are not deterministic and I doubt they ever will be again. Perhaps they could use a set of tags to create a deterministic result for a certain “genre” of results.
I mean of course that would be nice, but that’s just not realistic. You can’t store that info in a link without it being monstrous.
Why do you say they couldn’t cache the results and instead of re-fetching everything just use the cache results?
They could cache the results you receive on your last visit of the home page which would fix this
Doesn’t sound like it’s an otherwise great show then. that’s not what the question asked lol
I hear ya. As always, it’s a balance between having functions that are too long, and many too small functions. Matter of team preferences too.