Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
kilink
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
31.
▲
by
kilink
11y ago
I like Clojure quite a bit more than Java, but some of these are unfair if you are comparing against modern Java. For instance, the sorting example can be simplified: Comparator<User> userOrdering = Comparator.comparing(User::is
32.
▲
by
kilink
11y ago
Too bad you can't just call functional interfaces in Java 8, or you could just do something like this: BiFunction<BigDecimal, BigDecimal, BigDecimal> add = BigDecimal::add; add(x, y); Unfortunately you have to do: add.apply(x, y)
33.
▲
by
kilink
11y ago
Isn't that what Python Wheels are for though? http://pythonwheels.com/
34.
▲
by
kilink
11y ago
CompletableFuture implements Future, so the get method is an implementation of Future.get [1]. Anyway, the major difference is that Future.get throws 2 checked exceptions, InterruptedException and ExecutionException, while CompletableFuture
35.
▲
by
kilink
11y ago
Smalltalk.
36.
▲
by
kilink
11y ago
Also, if you look at the Javadocs for some of the creation methods, they explicitly state that they are for Java 6 and earlier, and that modern code should just use the constructor with the diamond syntax. http://docs.guava-libra
37.
▲
by
kilink
11y ago
I realize he mentions Lombok, but he specifically bemoans the extra boilerplate with writing builders and data classes, but does not mention the @Data or @Builder annotations...
38.
▲
by
kilink
11y ago
> First: constructor calling is not readable because Java misses named parameters. It's fine when there are 2-3 dependencies, but not more. If you have more than 2-3 dependencies, it might be time to refactor things, as your class m
39.
▲
by
kilink
11y ago
I'm also not a fan of passing Optionals into methods. Most of the time it's easier and cleaner just to write an additional method without that optional parameter.
40.
▲
by
kilink
11y ago
I'm surprised he didn't mention AutoValue [1] or Lombok (using @Data and @Builder) in his section about data objects and builders. I prefer AutoValue, but both approaches cut down on a lot of the boilerplate (and they also generat
41.
▲
by
kilink
11y ago
I think the Map interface should have been composed of two interfaces, ReadableMap and WriteableMap. Then APIs could return ReadableMap, which would lack the mutator methods altogether.
42.
▲
by
kilink
12y ago
Are you not able to use C extensions for some reason? Both the stdlib json module and the msgpack-python implementation have C acceleration modules (with pure Python as a fallback). I haven't benchmarked either though.
43.
▲
by
kilink
12y ago
I understand the code from the article is contrived, but I feel it serves as a bad example. Presumably you would write unit tests for such code in any language, regardless of type safety. Such tests would catch errors like this. > Tests
44.
▲
by
kilink
12y ago
I think the way he described it is pretty accurate. Default keyword arguments are only evaluated once at function definition, so supplying a mutable default keyword argument can cause issues. Your example is pretty contrived and doesn'
45.
▲
by
kilink
13y ago
Yeah, the map builtin is essentially itertools.imap in python 3.
46.
▲
by
kilink
13y ago
A minor quibble, but in Python 3 you can print in a lambda because print is no longer a keyword.
47.
▲
by
kilink
13y ago
In high school we had a similar class that required us to use Mavis Beacon (or some similar typing application) and report our words per minute. I thought this a waste of time and annoying, so I wrote a program to simulate the keystrokes an
48.
▲
by
kilink
13y ago
Boto doesn't support Python 3 yet. That's a pretty big one if you're using AWS.
49.
▲
by
kilink
13y ago
I love his hash table solution to level0! I would never have spent much time optimizing such a trivial challenge as level0, but after seeing the leaderboards with such ridiculous scores, curiosity got the best of me, and I had to figure out
50.
▲
by
kilink
13y ago
In what way does ZODB depend on Zope? It has a dependency on zope.interface, which is pretty minimal, and seems to be widely used outside of the Zope Community (e.g., Twisted).
51.
▲
by
kilink
13y ago
Godzilla monsters
52.
▲
by
kilink
13y ago
I'd have to agree with pekk's reply in general about trusting what you've written to the filesystem. That being said, it's easy to securely unpickle builtin or whitelisted types: 1. Use a cPickle.Unpickler instance, and
53.
▲
by
kilink
13y ago
A problem I've found with testing Twilio using Ngrok is the latency; occasionally connections will get closed by Twilio by timing out before they even hit my machine.
54.
▲
by
kilink
15y ago
In our particular case we would need somewhere between 50 or more accounts, so it's just not feasible. Having it as part of the charge API would be ideal. Glad to hear you're considering adding it as a feature.
55.
▲
by
kilink
15y ago
Any plans for supporting a DBA (doing business as) field as part of the API? Having only one identity associated with the Stripe account wouldn't cut it for us.
56.
▲
by
kilink
15y ago
Maybe it's lesser known outside of the Zope community, but buildout is essentially virtualenv + pip: http://www.buildout.org/
57.
▲
Skype Support Forum: You must buy a new computer
(forum.skype.com)
2 points
by
kilink
15y ago
|
1 comments