Live data from Hacker News

Talks that changed the way I think about programming

opowell.com

41–50 of 103 posts

Re: Talks that changed the way I think about programming

#42
post #27

These talks are a little skewed to the game/high performance programming side of the art, but still very interesting in general. Of the ones I've already seen I really like Mike Acton's talk. Since this has become such a nice thread some additions I'd add: * Sandi Metz going through the Gilded Rose or "All the small things" https://www.youtube.com/watch?v=8bZh5LMaSmE I already subscribed to her programming style and…

> I don't think it's practical, but it's the sort of thing that some person someday will incorporate in some more comfortable way in a new language or platform as a revolutionary feature.

As mentioned below, this can be used in languages like Agda and Idris; they also give you proof search, which tries to automatically fill in the holes from available definitions. This works well for 'proof objects' (the name given to values which only exist to satisfy the type checker), but requires caution for values with 'computational content' (those values which can effect the resulting computation).

Pretty much all Haskell code (except the really wacky astronautical stuff) has computational content, so there are fewer "obvious" obligations to fill in than would appear in a proof (in fact, due to laziness and lack of totality, we can safely use 'undefined' for all proof objects, since they'll never be pattern-matched!).

For example, if our function needs to return a list (e.g. if we're writing a function like map, filter, iterate, replicate, cycle, etc.), a proof search will immediately give us the empty list '[]', which is correctly typed but probably wrong.

For Haskell, tools like djinn can get you a little hole-filling automation, and I think that Emacs modes like ghc-mod and intero support calling out to djinn (I can't test this, as I can't get either to work on NixOS :( ).

For a little more work, you could write properties for QuickCheck (/SmallCheck/LazySmallCheck/etc.) to constrain the behaviour, which would allow trivial solutions like the empty list to be ruled out automatically. If you're a TDD disciple, then you already wrote these properties, so this part would actually be free (as long as the automation tooling exists).

At that point you're basically doing inductive functional programming, so tools like IGOR2 or MagicHaskeller might be useful to plug in as well.

Re: Talks that changed the way I think about programming

#43

I suspect a lot of these video are the most powerful when you encounter them at exactly the time you happen to be wrestling with those same ideas yourself. Every time I design software, I'm think back to Gary Bernhardt's "Boundaries" talk¹ and his practical, concrete suggestions for writing testable code. But I've never met anybody else who seemed as impressed as I was by the idea. ¹: https://www.destroyallsoftware.c…

Yup, that talk is gold. He's started producing screencasts again, and live streaming some on twitch. https://m.twitch.tv/gary_bernhardt/videos/all

Re: Talks that changed the way I think about programming

#44
When I was consulting full time, I happened to run into this video at exactly the right time. I shed two toxic clients and a few weeks later negotiated the largest contract I ever had to that point (and honestly, since).

Mike Monteiro: "F* you, pay me" - https://www.youtube.com/watch?v=jVkLVRt6c1U

Re: Talks that changed the way I think about programming

#45
post #38

He mentioned a lie of: Code should be designed around a model of the world but I didn't hear any reason why not to? The Key/Value pair being the only reason, but besides that being a optimization / preoptimization in high performance applications, is there any reason to not design code around a model of the world? Seems to me it makes things easier to think about.

I can't (won't) watch YouTube at work, but don't two of the lies contradict? If code is not more important than data, doesn't it make sense to model the code around that data? Or am I conflating data in lie #3 with "the world" in lie #2?

Re: Talks that changed the way I think about programming

#46
post #38

He mentioned a lie of: Code should be designed around a model of the world but I didn't hear any reason why not to? The Key/Value pair being the only reason, but besides that being a optimization / preoptimization in high performance applications, is there any reason to not design code around a model of the world? Seems to me it makes things easier to think about.

I am trying to make a game that follows Mike Acton ideas.

Basically: When you try too hard to fit the real world into code, you end with OOP.

It has one great advantage: it is easy to translate real world into "computer".

but one great big distvantage: a computer is a computer, not real world, OOP translates to complexity (think "Architecture Astronauts", and spaghetti of pointers/references/virtual/inheritance) and things done in a way that harms performance (not a problem for smaller problems, but if your problem is not small...)

His idea is that you should instead fit the world into your DATA, not your code, think about what data your program needs from the real world (do you really need all tiny details for example?), what is your inputs and outputs, and THEN you code to make that work, you code around your data structures, file formats, etc... not the other way around.

Re: Talks that changed the way I think about programming

#47
post #38

He mentioned a lie of: Code should be designed around a model of the world but I didn't hear any reason why not to? The Key/Value pair being the only reason, but besides that being a optimization / preoptimization in high performance applications, is there any reason to not design code around a model of the world? Seems to me it makes things easier to think about.

Apologies, haven't watched the video, but there are some pitfalls when designing around a 'model of the world', especially in OO.

I think Wizards and Warriors by Eric Lippert is a perfect illustration of how our initial assumptions and models aren't often the right ones (although it's not so much about data in this case) https://ericlippert.com/2015/04/27/wizards-and-warriors-part...

Re: Talks that changed the way I think about programming

#48
post #6
post #2

> Iterating over a two dimensional array by row is much faster than by column. Another fun fact is staggering array accesses is faster then linear acesses.

I wonder if this is language or even compiler dependent. Are there things that transpose memory organization? I for one always get confused which index is the row and which is the column when coding. Every damn time I've done a 2D iteration in the last 15+ years. Is it [col][row] or [row][col] ... I imagine it depends.

>Are there things that transpose memory organization?

Not exactly what you asked, but if you look at most subroutines in linear algebra libraries like LAPACK, they tend to have extra arguments so you can tell if your inputs are already transposed and/or conjugate in order to have more efficient memory access.

Re: Talks that changed the way I think about programming

#49
post #14

The theological second half of this is bizarre - I've never heard of this being considered a "problem", heaven (in the Christian tradition) is not a hall of fame that one nominates figures for. And the Mormon tradition of proxy-baptising people who are dead and never showed any sign of adherence to their tenets is highly questionable.

Did you just criticize a religion for not making sense?
Post reply on HN