Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mrgriffin
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
31.
▲
by
mrgriffin
7y ago
Not OP but I think hurt is correct. My understanding is that if you're passing return values directly into functions then there's nowhere to annotate the types of those values, but many (most?) people are perfectly okay with that
32.
▲
by
mrgriffin
7y ago
Like many things in life, it depends. I quite like type inference when it's clear from context what the type will be, e.g.: var xs = new List<Int>(); for (var x in xs) { ... } I'm pretty happy for it when the type &
33.
▲
by
mrgriffin
7y ago
FWIW I read > Why bother protesting you imperfect hypocrite? As a thing that people are saying to the hypothetical Greenpeace protester, not a thing that GP is directing at you.
34.
▲
by
mrgriffin
7y ago
Thanks for this! My NixOs build of Firefox was apparently built without support for studies, but your link worked fine.
35.
▲
by
mrgriffin
8y ago
I downloaded an extension to spoof my user agent this morning, haven't tried doing much yet, but messages certainly seem to work and that's 99% of what I do anyway. I don't know why I couldn't have be treated to a "
36.
▲
by
mrgriffin
8y ago
For GCD? I would find those names very misleading since semantically the order of the arguments to GCD is irrelevant (even if in the implementation you typically mod by b there's no reason you couldn't mod by a).
37.
▲
by
mrgriffin
8y ago
> 3. I need clarification. Are you saying that a major version >= 1 of a dependency you rely upon in production returns a sorted list, but then a new bugfix version now outputs an unsorted list? Not OP, but I believe they are saying t
38.
▲
by
mrgriffin
8y ago
I'd think the problem with bumping the version number if you're remaining compatible is that it signals to the end-user that you're not compatible. i.e. when I start using 2.x the constraints I'll put in my list of libra
39.
▲
by
mrgriffin
8y ago
If you allow shadowing then surely the local definition of the name will take precedence over the new name introduced in the stdlib (or wherever), and thus the program will keep behaving how it did before the new builtin was introduced. I t
40.
▲
by
mrgriffin
8y ago
I agree that modifying Chicken's output like you would handwritten C code would be an exercise in madness. But it's possible to design a language to have a nice transpilation story, for example PureScript deliberately puts restri
41.
▲
by
mrgriffin
8y ago
Oh God! I had forgotten how much frustration was in my old Python team until I checked the docs and discovered that you can make pip "install" your local copy of one repo as the dependency for another. The poor developer who promp
42.
▲
by
mrgriffin
8y ago
My problem with polyrepos is that often organizations end up splitting things too finely, and now I'm unable to make a single commit to introduce a feature because my changes have to live across several repositories. Which makes code r
43.
▲
by
mrgriffin
8y ago
One of my favorite features of Haskell is that I can use where to write the auxiliary function definitions after the code that use them, but keep them scoped inside of a single function. A relatively bad example here: https://wik
44.
▲
by
mrgriffin
8y ago
As a vegan with coeliac disease I am very grateful that the fad somehow decided to pair these things together. I got very sick some years ago when I moved from a vegetarian diet to a vegan one and discovered that most specifically-marked-fo
45.
▲
by
mrgriffin
8y ago
I might be misremembering, but isn't overloading on immutability what C++ does with the const keyword on member functions? e.g. struct Foo { A bar(); // If the instance is non-const. A bar() const; /&#x
46.
▲
by
mrgriffin
8y ago
Skimresources is probably an affiliate link thing (although they also try to sell your data to power targeted advertising), see: https://skimlinks.com/ Source: I used to work there.
47.
▲
by
mrgriffin
9y ago
I disagree that this is a good style in general. If I commit to returning an ArrayList then it's not backwards compatible if I want to change to a different concrete List. My experience has been that if you return a concrete class the
48.
▲
by
mrgriffin
9y ago
That's true, and in the event that you're actually using __COUNTER__ for something you could build something similar out of #include with a header that increments an internal number. // COUNTER.h #if !defined(COUNT
49.
▲
by
mrgriffin
9y ago
Yeah, it's a weird one! I discovered the idea while building my own toy unit test library, but I never got around to finishing it. The biggest downside is that (as far as I know) it's impossible to get this approach to coordinate
50.
▲
by
mrgriffin
9y ago
The author tried using __COUNTER__ and a static array of function pointers, and narrowly missed a workable idea—a static linked list! Forward declarations pun definitions, and can be used roughly as follows: struct Element { int va
51.
▲
by
mrgriffin
9y ago
> Cpython has non-moving GC so this is not an issue. I believe the GP was referring to PyPy. From https://morepypy.blogspot.co.uk/2009/10/gc-improvements.html > The hash field is not necessarily there; it is
52.
▲
by
mrgriffin
9y ago
How about Requests? https://github.com/requests/requests/search?utf8=%E2%9C%93&q...
53.
▲
by
mrgriffin
9y ago
This one hundred times. I once had a reviewer who took this even further, asking for changes in code that were unrelated to my changeset but appeared in the diff. e.g. I add a parameter Y and get a comment like "parameter X should supp
54.
▲
by
mrgriffin
9y ago
We're pretty conservative with the things we add, it's 95% correcting comments/documentation and the other 5% minor (behavior-preserving) transformations. We work in Python, so those transformations are things like using `col
55.
▲
by
mrgriffin
9y ago
Similar to dmoy our code review workflow supports making a (small) change while reviewing. We use GitHub PRs, and the edit function combined with choosing a commit message like "!fixup <original commit message>" and `git re
56.
▲
by
mrgriffin
9y ago
I mostly agree, with one exception: the author prefers "sucessfully -> successfully" to "You misspelled ‘successfully.’". We have a lot of these kinds of comments at work and I find both equally frustrating. I wish
57.
▲
by
mrgriffin
9y ago
I find this behavior surprising: >>> d = {0: "int"} >>> d[False] = "bool" >>> d {0: 'bool'} >>> nan = float('nan') >>> d[nan] = 0 >>&