21,281 karma · joined Nov 23, 2012 (14y ago) · 6,748 submissions
blog: https://rtpg.co
email: raphael at above domain
comment 10y ago · link · parent
I understand that you don't need much plumbing, but you're still following a pattern that you have used elsewhere when working on these.
The beauty is that there's usually exactly one way of doing it (so by definition it is the simplest way). But if you're coming from a language based around mutability and are just in front of an Haskell REPL, I don't think you find this very easily.
In my mind patterns are about agreed-upon architectures for dealing with common issues. Another example that comes to mind in typed FP languages are wrapper types to prevent misuse of values (wrapping user input, unwrapping via "escape" calls).
When you have a problem, usually you'll have one or two canonical solutions come to mind. Those are the patterns for me.
Though given how simple everything usually is, it involves a lot less boilerplate. Choosing the right type is still essential.
comment 10y ago · link · parent
The most universal one in functional programming is modelling mutating state. This is solved by placing the state in some container, and then building functions that take a state, and then return an updated state (maybe with a value). You can then build your program by chaining these state modifiers.
So instead of doing
stack = [1, 2, 3]
def pop_stack():
return stack.pop()
final_value = pop_stack()
# stack = [1, 2]
you do initial_stack = [3]
def pop(s):
return (s[-1], s[:-1])
popped_value, final_stack = pop(initial_stack)
# final_stack = [1, 2]
# initial_stack = [1, 2, 3]
You can then write programs like the following: def push(s, val):
return ((), s + [val])
def add(s):
x, s1 = pop(s)
y, s2 = pop(s1)
return push(s2, x+y)
This seems sillier in python, but is essential to doing "real work" in immutable languages. Languages like Haskell offer syntactic tools to make the chaining be more natural, in particular.comment 10y ago · link · parent
When the plot is about Home and Bart, the other two play counterpoint. But the opposite is true. Homer just ends up getting the main role so often that we assume that to be the default state of the universe.
comment 10y ago · link · parent
Many many many many organisations target these kinds of communities to try and help them. People are often suspicious of the help, because there are also many many many organisations that try to exploit them! Misleading terms, much higher hidden fees, etc, etc. Many have almost no access to high-quality services, just misleading ones.
Tackling this trust issue is essential to any success. In particular, I think that a 1099-style service like Uber is a bad fit for building trust. Though there are other ways to help someone apart from 'make them your employees'.
comment 10y ago · link · parent
Higher transfer rates, faster resolution. Only do "real" bitcoin transactions a couple times a day between players. Basically how all other high-frequency markets work.
comment 10y ago · link · parent
You can contrast Google's "the web as apps" with, say, Apple + Safari's more "web as documents + prettiness" approaches.
With at least 2 major implementations, even if Google doesn't want to do something, if Apple + Moz + MSFT does something, it's still possible to get it into the standard.
You can try getting into the standard without a single implementation but that's probably difficult without a vote of confidence from stakeholders
comment 10y ago · link · parent
http://rtpg.co/files/carmack-plan.epub
For those interested in the script, here's that:
https://gist.github.com/rtpg/4eb757c2c71ab20946bbd8156cd0533...
comment 10y ago · link · parent
"Oh, to catch the thief we are going to stop 100000 people" sounds absurd, after all.
Of course you can use the clue to exclude a bunch of people, but were you going to go around arresting random people on the street without this? Of course not, so why do it after.
comment 10y ago · link · parent
Phone numbers are much harder to change , so if some annoying person gets a hold of it suddenly they can harass me across networks. This is a thing that actually happens! A big reason why I don't like telegram (even if everything else is awesome).
I'm cool with my account being linked to a phone number, but I'd rather avoid giving the phone number to people I want to talk to (instead handing out a network-specific username)
comment 10y ago · link · parent
Most musical notation is meant for non-beginners, right? And a lot of the beginner confusion is from features that are useful for advanced users. So there's a tradeoff.
There might, of course, be changes to be had. But a lot of beginner confusion is because the higher-level abstractions are needed.
A good example in mathematical notation is order of operations. Why not just do left to right? Or just going with Polish Notation?
Standard order of operations work well for people working with large formula, because they allow you to write many common things without many parentheses. But mandatory parentheses + left-to-right only would be easier for beginners.
comment 10y ago · link · parent
Though someone's saying that dragging the ion turns it into the eject symbol, which I hadn't noticed until now but is more reasonable.
comment 10y ago · link · parent
I think Apple was good at keeping things consistent across apps, but the chosen metaphors were sometimes just as confusing (if worse) than the blessed windows one.
Not that it matters, everything is learned behaviour anyways. Consistency is already a great achievement.
comment 10y ago · link · parent
Of course you can refactor to reduce dependency scope at a code level(the essence of functional programming), but if in order to do X you need to access W, Y, and Z, then I don't see how code changes will affect this deeper truth.
4439.
The Two Minute Guide to Simple E-Books(rtpg.co ↗)
1 points · by rtpg · 10y ago · discuss
comment 10y ago · link · parent
The page is a bit obtuse, honestly I might have misunderstood a part of it.