Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ajanuary
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
50 ms
·
451.
▲
by
ajanuary
13y ago
I don't like to think about type checking as unit tests because they approach the problem from a fundamentally different direction, and I worry conflating them could lead to writing the sort of bad unit tests people are talking about h
452.
▲
by
ajanuary
13y ago
That suggests to me they're missing tests that check the data held in the objects. There might be some worth in checking the structure of an object (including attached functions) as it leaves a public api, especially in a language like
453.
▲
by
ajanuary
13y ago
Saved a ton of time letting a compiler catch things instead of writing tests. Types should never mean writing less tests :/
454.
▲
by
ajanuary
13y ago
I normally see a form of it from people that don't like early returns. But if you try to do that with code that explicitly passes pack errors, you end up having to twist the code to avoid early returns. I guess this form pushes all the
455.
▲
by
ajanuary
13y ago
I've been working with Ivy which does dependency management for Java. It's got a similar split: an ivy.xml file for specifying what it depends on, and an ivysettings.xml file for specifying what repositories to look in for those d
456.
▲
by
ajanuary
13y ago
Gary Bernhardt has a screencast [1] on DAS that proposes the opposite architecture of functional core, imperative shell. [1] https://www.destroyallsoftware.com/screencasts/catalog/funct...
457.
▲
by
ajanuary
13y ago
http://www.tumblr.com/docs/en/nsfw says "Blog indexed by Tumblr search: No" for adult blogs, which implies even switching off safe mode won't show adult content.
458.
▲
by
ajanuary
13y ago
I'd say the order of declarations isn't part of the scoping rules. The scoping rules are used for name resolution. In my example, both i's belong to the same scope, so the name resolution says "oh, that first i is the on
459.
▲
by
ajanuary
13y ago
In a lexically scoped language I would assume that the scoping follows the lexical representation of the code. In a lexically scoped language the variables belong to the containing lexical scope. That that lexical scope can be a f
460.
▲
by
ajanuary
13y ago
The semantics of ICollection<T>.Count and IList<T>.Count are well defined and known to you at the time your write your extension method. You don't know the semantics of a method of an arbitrary type you've been passed
461.
▲
by
ajanuary
13y ago
SO is a community, Discourse is a platform.
462.
▲
by
ajanuary
13y ago
I've been wondering if feeds would be more discoverable if browsers integrated it with bookmarks. Bookmarking a page with an RSS feed becomes a 'live bookmark' that acts like a bookmark folder with unread counts. But there&#x
463.
▲
by
ajanuary
13y ago
There are a bunch of plugins to do that. It seems to me like a behaviour that's better left to a plugin.
464.
▲
by
ajanuary
13y ago
Back also has the advantage that most browsers will return you to exactly where in the page you'd scrolled to.
465.
▲
by
ajanuary
13y ago
Seems like you can take advantage of the fact that a) footnotes come after the links in the body to them and b) footnotes start with 'f' https://gist.github.com/aJanuary/6021827
466.
▲
by
ajanuary
13y ago
Very anal, but it seems like the title should be rendered as "Light Table", not "LightTable".
467.
▲
by
ajanuary
13y ago
If it's that confusing, rename the parameter. public void addCD(String cdTitle, String cdAuthor, int numTracks, int durationInMinutes)
468.
▲
by
ajanuary
13y ago
Those sorts of things are useful, but mainly on API edges. They also tend to get outdated pretty quickly in code with even moderate churn. It would be interesting to be able to link assertions in a method doc with a test, so that the doc ex
469.
▲
by
ajanuary
13y ago
even if previous attempts are documented, their reason for removal is often abbreviated in the commit message: "wasn't fast enough"/"didn't work as expected". If we're instructing people to wr
470.
▲
by
ajanuary
13y ago
Worse than that, it can get out of step with the method signature. A lot of tools I've seen will take the doc comment as an authority over the method signature, even if they don't match up. Javadoc-style for documenting method beh
471.
▲
by
ajanuary
13y ago
tbh I don't think either are particularly intuitive in a "can guess it" sense. Both are intuitive in a "oh, that's what it's called, I can remember that now" sense.
472.
▲
by
ajanuary
13y ago
Or do: private static int CompareKVPByCount(KeyValuePair<string, int> a, KeyValuePair<string, int> b) { return a.Value.Compare(b.Value); } Or even: kvpList.Sort(kvp => kvp.Value) But that would probably be st
473.
▲
by
ajanuary
13y ago
s.Split(' ').GroupBy(x => x).OrderByDescending(x => x.Count()).Select(x => x.Key).Take(10).ToList(); I'd say 13 characters isn't really a huge differentiator. They're both using exactly the same alg
474.
▲
by
ajanuary
13y ago
The first projection isn't needed, which would eliminate the creation of 10 objects.
475.
▲
by
ajanuary
13y ago
I've seen stories both from people who continually got pestered (like myself) and from people who didn't (such as yourself). I dunno why though.
476.
▲
by
ajanuary
13y ago
Attitude. One of the big advantages that seems to be touted for text protocols is easy to use manually by humans, and with that can come a desire to make it forgiving of human error. You can have simple text protocols and complex binary pro
477.
▲
by
ajanuary
13y ago
Will the desktop version have the ability to use functions from third party libraries? We have a bunch of complicated maths in a java library. At the moment I've got a jruby wrapper around it and using the jruby repl, but it would be a
478.
▲
by
ajanuary
13y ago
I'd argue the big thing that made HTML so easy to play with was permissiveness, not the lack of explicit compilation. Perl doesn't tend to have an explicit compilation step. You could write a HTML compiler to be as permissive as H
479.
▲
by
ajanuary
13y ago
You do then have to wrap values in lambdas if you want to pass them in.
480.
▲
by
ajanuary
13y ago
The problem C# has is that wrapping every iteration result in a container would make iteration ever more expensive than it currently is. The Option type in Rust is incredibly cheap compared to the equivalent struct or class in C#.
More ›