Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
derriz
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
13 ms
·
181.
▲
by
derriz
1y ago
Typescript demonstrates that you can have a fully dynamic language but also provide a type system which can support as much (or as little) type checking as is appropriate or desired. I can take my chances in Typescript by just using '
182.
▲
by
derriz
1y ago
I don't get your point or what it has to do with the "pythonic" suggestion that you don't check early for incorrect state/arguments? Any language, including Python, which supports the concept of a class will allow y
183.
▲
by
derriz
1y ago
I've been using Python on and off for a few decades and agree. I don't know why you're being downvoted. I've authored tens of thousands of lines of Python code in that time - both for research tools and for "produc
184.
▲
by
derriz
1y ago
Well that’s a more specific criticism - that AWT sucked. I won’t defend Java GUIs from the period having worked on a 1990s Java AWT based GUI application. Although, SWT apps like eclipse were decent enough. I think in the context of the t
185.
▲
by
derriz
1y ago
> Both because it was a young language, and had all the problems of a young language like poor library support for just about everything, and because the hardware in 1997 wasn't ready to deliver on the hype. Outside of Perl’s CPAN,
186.
▲
by
derriz
1y ago
You are correct - my mistake.
187.
▲
by
derriz
1y ago
The geometric relationship between the note frequencies of a C major chord and a D major chord on the piano is not the same. The key of piece is responsible for some of its “feel”. So it’s not unreasonable that they have different “repres
188.
▲
by
derriz
1y ago
Unless you know about the internal implementation of std::map, then abusing the ordering function (which is expected be a total order according to the std::map documentation - i.e. capable of comparing any two elements of the key space) to
189.
▲
by
derriz
1y ago
I don’t understand the point of this article. There is no requirement stated regarding the properties of the ordering - in fact there is no code at all that depends on the traversing the map elements in a particular order. So you can pick
190.
▲
by
derriz
1y ago
I do not consider it safe. The float representation of 0.3 (e.g.) does not, when cast to double, represent 0.3 - in contrast the i32 representation of any number when cast to i64 represents the same number.
191.
▲
by
derriz
1y ago
This is a fairly obvious one? Although I've mainly encountered the effect with long to double conversion. On the other hand, floating point is the gift that never stops giving. A recent wtf I encountered was partly caused by the silen
192.
▲
by
derriz
1y ago
It only has type !, if the return type of the lexically enclosing function declaration has the same type as that of <expr>, otherwise it's illformed. For any expression NOT involving "return", I can write, for example:
193.
▲
by
derriz
1y ago
Sorry for the confusion - I meant to use ! and not (). "It's not, but not due to the return, it's because you're trying to return a Result from a function that returns an i32." That's exactly my point. "r
194.
▲
by
derriz
1y ago
See my comment above, your example only "just works" if the enclosing function has the appropriate return type (in this case none). So the syntactic element "return" is not just an expression - unlike other sub-expressio
195.
▲
by
derriz
1y ago
I'm responding here because so many replies are making the same point. In your particular example, let's put your example into a context. Is fn foo(option: Option<i32>) -> i32 { let y = match option { Some(x) =&
196.
▲
by
derriz
1y ago
That sounds superficially reasonable to me and I'm all for regularity in programming language semantics but on thinking about it further, I actually think it's a design flaw. It makes no more sense to me for "return <expr&
197.
▲
by
derriz
1y ago
Sorry. Yes you’re correct - I misread the parent comment.
198.
▲
by
derriz
1y ago
In this case, what has Ireland done to US citizens that this reciprocates? Ireland has a special deal for US citizens - no visa is required for visits up to 90 days - you just turn up and show your passport. I'm not convinced that thi
199.
▲
by
derriz
1y ago
That’s a design flaw of ASCII inherited by UNICODE not an argument against using indentation to portray hierarchy. I’m sure there are alternative UNICODE characters which render almost indistinguishable from “(“ also.
200.
▲
by
derriz
1y ago
We have a winner! Actually, I'd suggest a slight improvement: x*x = x^2
201.
▲
by
derriz
1y ago
Absolutely no counting is required at all so I think your joke falls a little flat. Our visual system has the ability to detect implied straight lines (and other simple geometric outlines) from very small clues. Therefore "seeing"
202.
▲
by
derriz
1y ago
Turned 90, maybe? eq: mul: a a pow: a 2
203.
▲
by
derriz
1y ago
Originally a scripting language - from what I recall. An alternative to Perl or Tcl.
204.
▲
by
derriz
1y ago
> Static typing lets you build very large rigid structures where types ensure constraints. However, these constraints get in the way of moving quickly. If you change a signature of a function, you have to first change every piece of code
205.
▲
by
derriz
1y ago
That makes sense. I still find hard to imagine saying something like "I live in Barbican" if I didn't live in _The_ Barbican. But going to "Barbican" if traveling by tube would be obvious.
206.
▲
by
derriz
1y ago
(Not very) interesting that the author of the piece refers to it as "Barbican" while I've never heard it referred to without the definite article - i.e. "The Barbican". Is there any significance to this?
207.
▲
by
derriz
1y ago
I see what you meant now but still see little scope for hydrogen to have a role in the energy sector. One reason for my skepticism is that I've been hearing optimistic predictions around hydrogen as an energy store for decades at this
208.
▲
by
derriz
1y ago
I don’t see the connection with my comment but hydrogen is irrelevant and contributes less than a rounding error to global electricity generation. The technical components for a hydrogen based energy market do exist but are simply unviable
209.
▲
by
derriz
1y ago
I wouldn't call it "a lot" when you put it into perspective. China has about 60GW of nuclear generation capacity - this is after 70 years of building their first nuclear plant. It has about 1600GW of wind and solar after abo
210.
▲
by
derriz
1y ago
You're including a bunch of different generation technologies which have vastly different operating characteristics which means they are not substitutes for each other. For example, nuclear takes days to start from cold and is really o
More ›