Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Twisol
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
81 ms
·
781.
▲
by
Twisol
7y ago
Clarity is primary; good abstractions allow you to achieve it. The fact that bad abstractions harm clarity is something we agree on very strongly.
782.
▲
by
Twisol
7y ago
> Bad abstractions and models make it much harder to understand code, though. True! The point I'm trying to make is more that code clarity is important and worth striving for, regardless of the means you use to achieve it. Clarity
783.
▲
by
Twisol
7y ago
> Here's a question I like to ask: do you spend most of your time making your code look "nice"? If so, I recommend not focusing on it so much. [...] It's better to focus hard on the core problems you're trying to
784.
▲
by
Twisol
7y ago
I've been fascinated by concurrent constraint programming (CCP) for a few years now, but it's hard to find source code for any of the system from back then. My reference for most of this topic is Vijay Saraswat's monograph of
785.
▲
by
Twisol
7y ago
You're right that it's hard. However, I think you're missing one significant point that, at least to some extent, justifies the hardness: computability. Systems like Prolog are based on the idea of "proof search": g
786.
▲
by
Twisol
7y ago
My usual approach tends to interleave the two approaches. Brain dump, then distill, then reconstitute in a more crystalline form. Repeat as necessary.
787.
▲
by
Twisol
7y ago
You could go the next step for symmetry and make _both_ operands quoted functions, at which point you're just working in a lazy language. :D
788.
▲
by
Twisol
7y ago
Language choice I can perhaps agree with, but from what I've read, the biggest factor with Erlang is much more its runtime environment. BEAM + OTP is a very impressive piece of kit.
789.
▲
by
Twisol
7y ago
Often, even functional languages have something similar, whether it's call/cc or something more cutting-edge like algebraic effects. All of these essentially augment the execution environment in various interesting ways, and are
790.
▲
by
Twisol
7y ago
This is fascinating in its own right, of course, but I was indeed referring to a literal finite lookup table, by appeal to the finitude of the 9x9 problem class only. You give a useful strategy for compacting the size of the lookup table th
791.
▲
by
Twisol
7y ago
Sure. NP-completeness is utterly a matter of theory, I make no claims otherwise. SAT solving is such a powerful tool precisely because you can do so well on "small" (and often "average") solutions that it's an attra
792.
▲
by
Twisol
7y ago
Sudoku is only NP-complete if you generalize to arbitrary NxN boards. The standard 9x9 Sudoku gives a finite class of problem instances, so you could pre-generate a finite lookup table and get an O(1) algorithm on that class. It sounds like
793.
▲
by
Twisol
7y ago
I agree, but my point was slightly different. There are legimate points to be made -- if not agreed with -- concerning the benefits of immutability, of single-ownership patterns, of equational reasoning, etc. which are central to the modern
794.
▲
by
Twisol
7y ago
Several languages on either side of the OOP vs. FP divide include both solutions to the problem -- for example, open subtyping vs. sealed case classes in Scala, and traits vs. sum types in Rust. There's more to both OOP and FP than the
795.
▲
by
Twisol
7y ago
I think the name “cached value” is a red herring, as far as the mindset being described is considered. “Derived value” might be closer to the mark; the values are pure functions of other things, and to change the derived value you must chan
796.
▲
by
Twisol
7y ago
Right — any batch professing program can be thought of as a pure function of its inputs, but internally it is likely to be constructed as a series of smaller programs. The constants of a lower-level program are the mutable and cached state
797.
▲
by
Twisol
7y ago
> So what does that tell you about his own view on the matter? That he is a humble person. This jibes with all anecdata I've ever heard about his character. Occam's Razor and all that. Many people who have a Ph.D. prefer not to
798.
▲
by
Twisol
7y ago
Although, one interesting aspect of the trade-off here is that a programmer who manually monomorphizes only has to do so once(^) -- their effort is reused across multiple compilation runs -- whereas the compiler normally has to monomorphize
799.
▲
by
Twisol
7y ago
The value of unit tests when creating software is perhaps debatable, but I find their greatest value to be in maintaining software. If you lock in your expectations of a software component, when it's time to make changes (due to shif
800.
▲
by
Twisol
7y ago
The flip-flop operator, I think: https://nithinbekal.com/posts/ruby-flip-flop/
801.
▲
by
Twisol
7y ago
Yes, I agree! I merely think you overvalue C++ in this case. There's lots of C/C++ code that most people can't understand either -- and not for lack of knowing the language. Apropos of nothing, I found Peter Naur's "
802.
▲
by
Twisol
7y ago
> If nobody understands the software (or the tools the software depends on, including the build chain), then when someone other than the original magician has to fix something, you're stuck. Speaking from experience, this is indepen
803.
▲
by
Twisol
7y ago
I think the problem statement wants the lexicographically least string of those obtainable by deleting characters .
804.
▲
by
Twisol
7y ago
I've just recently started using the `e` (edit) command in `git add -p`. It takes a little bit to get used to writing "correct" patches, but it's super powerful and I'm using it surprisingly often now.
805.
▲
by
Twisol
7y ago
Right, but SQL databases aren't the only kind of database. I gather that the guy in the original anecdote was referring to a relational database specifically, but not all databases are relational. The filesystem is a perfectly good hie
806.
▲
by
Twisol
7y ago
For those of us who don’t work with medical image data, can you share why he was incorrect? I realize that relational databases are not the right box to fit certain kinds of data into, but you have to put your data somewhere that allows i
807.
▲
by
Twisol
7y ago
I can vouch for this wholeheartedly! However, be aware that these are all ad-hoc in some fascinating yet depressing ways. I can't help but mention a few names and fun facts... > 16-bit color encoding I think the xterm-256 escape c
808.
▲
by
Twisol
7y ago
Huh. I would've expected it to be `odd filter`, not `filter odd`.
809.
▲
by
Twisol
7y ago
Agreed. Some functional languages (like F#) have a pipelining operator |> that gives the same syntactic impression: list |> map (1+) |> filter odd |> sum
810.
▲
by
Twisol
7y ago
I think that can be solved without bringing objects into the mix -- functions are usually grouped up into modules of some kind, so leading with `Foo.` (or `foo::` in C++, etc.) still provides a useful level of scoping that can aid autocompl
More ›