Live data from Hacker News

Ask HN: What made you change your mind about a programming language/paradigm?

news.ycombinator.com

11–20 of 401 posts

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#12

The lack of secure composability in almost all existing languages. You cannot import untrusted code and run it in a sandbox. Unless you are completely functional, you cannot restrict the effects of your own code either. The solution to this seems to be the object capability (key) security paradigm, where you combine authority and designation (say, the right to open a specific file, a path combined with an access righ…

Spectre is another mode of interference, and perhaps one which means we're going to have to give up altogether on running untrusted code without at least a process boundary.

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#13
Long term job and total comp prospects. Having done tacked on FP in Node.js (Fantasy Land, Sanctuary, Ramda) and Scala (scalaz, cats) for quite some time and now programming in "proper" FP languages like PureScript and Haskell daily, I absolutely love life as a programmer.

However, having a decent sized family with deep roots, wanting to do college for my children as a sole earner, not living near a tech-hub of any sort, I come away with this wish list -- and I have to sustain for 20 to 30 years. ~150k TC, remote, FP languages, for the net 20 to 30 years. Seems like a tall order. We could add up all the FP Scala, FP JS, Clojure, Rust, Haskell, PureScript, Elm, OCaml, ML, etc gigs and it would be a sliver compared to the prospects of just picking the same list with just any of the other top 10 languages.

I could hop into a remote Node.js/Scala gig and slowly sell them on FP, but having done this for the past few years it gets a bit draining to fight over small FP items when you are ready to do so much more.

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#14
1) This talk made me realize that changing a paradigm is not just about changing a language. It is a way of changing the way you approach all problems and solutions. Even in real life.

Keep Ruby Weird 2018 - Closing Keynote by Avdi Grimm https://www.youtube.com/watch?v=UJnsXUVsr7w

2) And this talk made me very interested about Elixir

Elixir: The only Sane Choice in an Insane World - Brian Cardarella https://www.youtube.com/watch?v=gom6nEvtl3U

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#15
I was struggling with Mathematica in grad school (it's bread and butter for theoretical physicists, since it is particularly good at symbolic math, and good enough for ancillary numerics, plotting, etc). My previous programming experience included C/C++, Python (numpy/scipy), Matlab/Scilab/Octave, and somehow, getting Mathematica to do things seemed like pulling teeth.

Incidentally, around the same time, I was exploring lambda calculus and "Learn You a Haskell" [1] for fun. Suddenly, at some point, several things about the declarative paradigm just clicked, and within a space of a few days, I went from struggling against Mathematica and hating the experience, to appreciating it's elegance and enjoying getting things done with it! For functional programming in Mathematica, see [2, 3] and the fact that it gives you access to the expression tree in a structured manner means that some really cool stuff becomes really easy!

Later, I learned that Mathematica's computation model is based on pattern matching and term rewriting. I don't know enough computing theory to disambiguate functional/rewriting/declarative, but I find it very satisfying to write code in roughly that style -- it feels clean and understandable. See Yann Esposito's write-up [4] for a fantastic illustration of this.

[1]: http://learnyouahaskell.com/

[2]: https://reference.wolfram.com/language/guide/FunctionalProgr...

[3]: https://mathematica.stackexchange.com/questions/163992/what-...

[4]: See Section 3.1 (you don't actually have to know any Haskell to get value from this example): http://yannesposito.com/Scratch/en/blog/Haskell-the-Hard-Way...

In that illustration, Yann takes a simple problem with an obvious procedural solution, and proceeds to rewrite it step-by-step in ten versions, each time making it slightly more modular. The modularity and flexibility of the later versions is breathtaking in its simplicity!

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#16
Every once in a while I search for something I need in Python and find that it only exists in Python 3, but I'm not quite convinced it's worth the effort to transition from 2.

However... I've just learned about Python 3's f-strings and they gave me a big smile, and probably the final push I needed :)

(Yes, I do know that sounds silly and there are probably much better reasons to transition to Python 3 ¯\_(ツ)_/¯ )

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#17
Working with that crappy thing for few months. At some moment the crappy disappears and it may even becomes actually cool.

Alternatively, working with that cool thing for few months on something complex. At some moment the cool disappears and it may even becomes actually crappy.

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#18

The lack of secure composability in almost all existing languages. You cannot import untrusted code and run it in a sandbox. Unless you are completely functional, you cannot restrict the effects of your own code either. The solution to this seems to be the object capability (key) security paradigm, where you combine authority and designation (say, the right to open a specific file, a path combined with an access righ…

The JavaScript Realms API adds secure object capabilities https://github.com/tc39/proposal-realms/blob/master/README.m...

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#19
Kotlin's non-null type checks seemed nice, but I didn't start appreciating them until I had to debug a NPE being thrown 100 frames down a stack-trace in an entirely unsuspected piece of code in a legacy Java app.I had to release new debug code to production just to figure out where the hell it was happening.

Just having the type system making 'this could be null' and 'this is assured to never be null' explicit would've saved me hours.

Also, playing with Erlang made me really appreciate the actor model of concurrency.

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#20
post #11

Using TypeScript for about 2 hours made me wonder why anyone would write JavaScript ever again. This was several years ago, when TypeScript wasn't nearly as good as it is now.

What's the correct way to use typescript when you're directly working with the Dom, and using minimal jQuery? It seems to really not like it if you're explicitly asking for things you know you have in your document, but it reports an error.
Post reply on HN