HNHacker News
TopNewBestAskShowJobs

kpmah

509 karma · joined September 20, 2013

http://kevinmahoney.co.uk
submissionscomments
kpmah··on Programming Language Rankings: June 2016
Rust is a very useful and pragmatic language, and probably the best one in its niche. I don't think you have much to worry about. As things stand right now, it's not going anywhere.
kpmah··on Ask HN: Freelancer? Seeking freelancer? (June 2016)
SEEKING WORK: Remote (UK citizen, in Belgium currently)

8 years experience. I like a lot of different languages, but I've mainly worked with Ruby and Python.

http://kevinmahoney.co.uk

kpmah··on Research into the reasons for procrastination and how to stop
Something I've noticed with my own procrastination is that it often has a strong emotional component. For example, I'll often procrastinate with anything to do with taxes because, even though I know I HAVE to pay it on an intellectual level, it's emotionally difficult for me to part with money.

Often when I've rationally examined the underlying anxiety it becomes much easier to accomplish things.

kpmah··on Ask HN: Who wants to be hired? (April 2016)
Location: Belgium

Remote: Yes

Willing to relocate: Maybe Amsterdam next year

Technologies: Python, Ruby. Would love to work with something more functional.

CV: http://kevinmahoney.co.uk

Email: kevin@kevinmahoney.co.uk

kpmah··on Lamdu – towards a new programming experience
Perhaps also my effort which I like to pimp out on these threads occasionally: http://sediment.io
kpmah··on Tests vs. Types
Ok, I think you have me convinced. Haskell doesn't quite measure up here. One more point to Idris!
kpmah··on Tests vs. Types
In the case of error, assert and undefined, I wouldn't class them as exceptions but as unrecoverable errors, as discussed in the linked wiki page.

I wasn't aware of 'throw' and that certainly weakens my argument. You could maybe argue it is an escape hatch in the same vein as unsafePerformIO, but I don't know how it is viewed by the community.

You could argue I'm playing word games here, and I have some sympathy for that argument. What I wanted to get across is checked exceptions ala. Java (although they are too commonly bypassed in that example). Maybe moving it to the documentation section is a good compromise.

kpmah··on Tests vs. Types
(author here)

I don't even use Idris! I learnt it a couple of days ago for the purpose of this article.

If Idris looks good it's not my fault :)

kpmah··on Tests vs. Types
You're making an argument from your experience, so permit me to make an argument from mine: I've been using Python and Ruby professionally for about 10 years.

The most common error I make myself is typos, but those are often (but not always) fixed quickly. The most common mistake I see getting to production is not handling a return value or an exception because it was assumed it couldn't happen.

Types can help with both of these things, and tests less so - because often if you're making an assumption about the return value of a function, it's because you haven't considered the possibility and you don't write a test for it.

A dynamic language can certainly be good enough, but in my opinion never ideal.

kpmah··on Tests vs. Types
I deliberately ignore that :)

I don't think escape hatches added as a practical concern should count against the language, as long as they're used appropriately by the community. You can defeat Rust's guarantees by using an `unsafe` block, and you can defeat Python's memory safety by adding a C extension.

Like I say at the start, if I were going to be strict about this it would be a very short blog post!

kpmah··on Tests vs. Types
Could you expand on your issue with exceptions? In this article I'm using the distinction between exceptions and errors from https://wiki.haskell.org/Error_vs._Exception

You're right about the bottom input. I'll add it to the article.

kpmah··on Records: Python library for making raw SQL queries to Postgres databases
It still needs a bit of work, but I wrote a small library for Python to use SQL in the Yesql style: https://github.com/KMahoney/pyesql
kpmah··on Limitations of protocols in Swift
Don't trait objects (https://doc.rust-lang.org/stable/reference.html#trait-object...) solve this problem?
kpmah··on Shem: A Haskell-Derived Compile-to-JavaScript Lisp
You're right, it's not necessary, it's just a preference :)

Although it does 'flatten' the bindings. Defn a, Defn b… is the same as let a = … in let b = … in …

kpmah··on Shem: A Haskell-Derived Compile-to-JavaScript Lisp
The reason AST editors look a lot like lisp is because lisp pretty much is just an AST. There's no technical reason the AST can't be a more complicated structure than a list, and you can present the AST any way you want - you don't have to show parenthesis. You can use mathematical symbols, whitespace, images, fonts...

The problem is the further away you go from lists of symbols, the more complicated the AST is to edit and to present to the user, and the more complicated the interface is for the user. It's not an insurmountable problem though.

kpmah··on Shem: A Haskell-Derived Compile-to-JavaScript Lisp
It lets you do some nice things.

You can always get instant feedback (types, errors) because your code is always a valid AST. No ambiguous braces etc.

Also things like markdown comments and inline evaluation.

My attempt: http://sediment.io

kpmah··on Microservices – Demo Project in Python
Yes, it might make sense if you're Facebook or Amazon to do this stuff. For the rest of us, a single (reasonably optimised) database can scale up to thousands of hits per second. Probably more.

Also there's another downside to this approach: you lose the ability to do atomic transactions on the application's data.

kpmah··on Microservices – Demo Project in Python
Right, so you implement this multi-get for every service, you work around the GET URL length limit by using POST or something, you do this slow HTTP join in parallel with any other service data you need if possible, in your application code, and you get what a single SQL JOIN gives you.
kpmah··on Microservices – Demo Project in Python
Number 1 problem with microservices here:

https://github.com/umermansoor/microservices/blob/master/ser...

N+1 HTTP requests. Ouch. Wouldn't it be nice to be able to do a database join?

kpmah··on Several types of types in programming languages
The terminology we have around types is really messed up. What's most annoying is that 'static type system' and 'dynamic type system' are often seen as opposites of each other, but the 'type' in each of the names is a completely different concept.
kpmah··on Be Suspicious of Online Movie Ratings
https://en.wikipedia.org/wiki/Sampling_(statistics)
kpmah··on Be Suspicious of Online Movie Ratings
I love RT, but I think people misinterpret the percentage. It doesn't mean that the film was 95% 'good', it means there was a 95% chance you'd like the film and a 5% chance you'd dislike it based on a sampling of professional reviews.

Something to bear in mind is that a slight above mediocre film can have a 100% rating if it has wide appeal.

kpmah··on Flux is the new WndProc
Components drawing themselves is a side effect, and components returning markup are pure functions of their state.

One is a lot easier to unit test than the other, for example.

kpmah··on The sky's gone dark
Maybe filling our sky with junk will cancel out global warming? Yay humanity!
kpmah··on Hello, declarative world
It's a really interesting area, but I think anyone who wants to push for this style of programming would do well to investigate why Prolog never really took off in the 40 years it's been around. Of course, that could have nothing to do with its fundamental model.
kpmah··on Hello, declarative world
This looks like it's effectively Prolog, and the problems with this way of programming can be found in criticisms of that class of programming languages.

I haven't written a Prolog program of any complexity myself, but it seems a common complaint is that the programs can be hard to reason about and debug. Your solutions are always running on top of a unification algorithm.

kpmah··on Slipping Away: Jo Aubin Has Alzheimer's. He's 38
You're right. You have to update the probability with all the knowledge you have. Although I would say self diagnosis has a very, very high false positive rate, and if you know you're a hypochondriac that would make the probability drop, plus we don't even have a test for this that is 90% accurate. I'm not sure the difference is an order of magnitude :)

I think my point stands that it doesn't make sense to test for extremely rare diseases because of a self diagnosis.

kpmah··on Slipping Away: Jo Aubin Has Alzheimer's. He's 38
The incidence of dementia for those aged 30-64 is about 54 per 100000. If you have a test that is 90% accurate and someone tests positive, according to Bayes you have 0.5% chance of actually having it.

Testing like that seems pointless to me.

Working: (0.9 * 0.00054) / (0.9 * 0.00054 + 0.1 * 0.99946)

kpmah··on Slipping Away: Jo Aubin Has Alzheimer's. He's 38
Early onset Alzheimer's is extremely rare. Even if you perfectly showed all the symptoms on that list it's still unlikely you have Alzheimer's. Read up on Bayes' theorem ;)
kpmah··on Knuth and Plass line-breaking Revisited
Hyphenation is nice, but the Knuth/Plass line breaking really helps too, even with left justified text. The 'first fit' algorithms browsers tend to use can leave some ugly and confusing artefacts.
← PreviousPage 3 of 4Next →