Live data from Hacker News

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

news.ycombinator.com

1–10 of 401 posts

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

#2
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 right). There are only immutable globals. Sandboxing thus becomes only a matter of supplying the absolutely needed keys. This also enables the receiver to keep permissions apart like variables, thus preventing the https://en.wikipedia.org/wiki/Confused_deputy_problem (no ambient authority).

Even with languages that have security policies (Java, Tcl, ?), control is not fine grained, and other modes of interference are still possible: resource exhaustion for example. Most VMs/languages do not keep track of execution time, number of instructions or memory use. Those that do enable fascinating use cases: https://stackless.readthedocs.io/en/latest/library/stackless...

All of this seems to become extremely relevant, because sufficient security is a fundamental requirement for cooperation in a distributed world.

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

#3
Almost every time I experienced a shift like this in my thinking it was due to experiencing a problem I hadn't experienced until that point.

I discovered the value of compile time type checks when I worked on large codebases in dynamic languages where every change was stressful. In comparison having the compiler tell you that you missed a spot was life changing.

I discovered the value of immutable objects when I worked on my first codebase with lots of threading. Being able to know that this value most definitely didn't change out from under me made debugging certain problems much easier.

I discovered the value of lazy evaluation the first time I had to work with files that wouldn't fit in entirely in memory. Stream processing was the only way you could reasonably solve that problem.

Pretty much every paradigm shift or opinion change I've had was caused by encountering a problem I hadn't yet run into and finding a tool that made solving that problem practical instead of impractical.

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

#5
Our introductory programming course at university used ML and I didn't like it or get it. I already knew some C++, BASIC and Java and was mostly interested in real time graphics programming and the kind of examples used in the ML course were not interesting to me and I didn't see how it would help me tackle the kinds of programming tasks I was interested in.

I found recursion pretty unintuitive and didn't find the way it was taught in that course worked for me. At the time it mostly seemed like the approach was to point at the recursive implementation and say "look how intuitive it is!" while I completely failed to get it.

Many years later after extensive experience with C++ in the games industry I discovered F# and now with an appreciation of some of the problems caused by mutable state, particularly for parallel and concurrent code I was better prepared to appreciate the advantages of an ML style language. Years of dealing with large, complex and often verbose production code also made me really appreciate the terseness and lack of ceremony of F# and experience with both statically typed C++ code and some experience with dynamically typed Python made me appreciate F#'s combination of type safety with type inference to give the benefits of static typing without the verbosity (C++ has since got better about this).

I still struggle to think recursively and my brain naturally goes to non recursive solutions first but I can appreciate the elegance of recursive solutions now.

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

#6
Using it.

I try to learn a new platform every once in a while. The best way to learn is to do. So I pick a project from my list and try it out. That's how I learned I didn't like Meteor and Angular when they came out and were hyper hyped but I enjoy Go very much but only for certain things. Or how I learned I disliked PHP or loved working with Python, or that MongoDB is ok for some things and less so for others (or that Postgres is bliss). I used them for something and I find what is the problem those "tools" are best at solving and where they don't fit. Then some of them I keep using over and over again, and some I file under been-there-tried-that. What I really really try to do, is get peer-biased. Many times the internet hypes something for 5 minutes and dumps it later. Or ignores something for 5 years only to rediscover it and rave about it.

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

#7
Rich Hickey's "Value of Values"[0] is what finally sold me on the benefits of pure functional programming and immutable data structures. (It remains horrifying to continue working with MySQL in my day job, knowing that every UPDATE is potentially a destructive action with no history and no undo.)

[0]: https://www.youtube.com/watch?v=-6BsiVyC1kM

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

#8
Not what you’re asking for but related.

I’ve always found programming interesting. It’s possibly one of neatest ways to figure things out with computation. But early on I got the impression the profession was abusive - maybe inherently. I got fired from my first programming job for prioritizing finishing high school over a programming job. I dabbled after that and every project related to computers had this “natural” way of feeling like something I have to do “now” - even if it meant not sleeping. Then I saw the cs majors I knew in college doing the same. I heard about the industry being the same way. Not only that, most programming work was downright boring to the point of tedious. CRUD apps, basically everywhere. Nothing ever very original. Maybe it’s different now, but it sure doesn’t look like it’s progressed very far over the years.

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

#9
For a long time while my day jobs were centered in Python, C and C++, I was separately very interested in strict functional programming, particularly in Haskell and slightly less but somewhat in Scala. I taught myself enough to be roughly an “advanced intermediate” programmer in both languages just via tutorials and side projects.

In the time since, I’ve had a job working in a large Haskell codebase and a separate job in a large Scala codebase. I remember feeling a lot of pride and self-confidence when I passed difficult technical interviews hitting on pragmatic day-to-day issues in these languages despite having not had prior job experience with them.

After years of working in these languages, I’ve basically had a 180 degree flip in my opinion of them at least in terms of solving business problems.

I no longer have any desire to work in functional programming, and believe that many of the promises it makes in regards to type safety, encoding IO or side-effectful operations into the type system, automatic parallelism, fast compile times, etc., are mostly just fantasies achievable only in idealized settings, and that there are fundamental incongruencies between the types of mutable systems that customer-facing products represent and immutable design patterns that make the goals of software as a product development activity incompatible with functional programming.

Since my background is in mathematics, I had always loosely believed that programming languages are supposed to go in the direction of removing any mental burden placed on the programmer to know how to represent a concept inside the syntax of the language.

What I mean is, I had always thought for example that if a language requires me to know something about computer memory layouts or the data structure internals of say, floating point values, then it’s a failure of the language and it should instead present me with an abstraction that renders those memory details or data structure internals to be unnecessary in all possible situations.

In many ways I think functional programming and the idea of formal verification generally is a type of expression of this way of thinking.

But my 180 degree change of heart has made me feel based on my experiences that it’s really the opposite. In all situations, I will frequently need access to every layer of abstraction possibly all the way down to the actual chemistry or physics of hardware components, and at the very least I’ll need no abstractions wrapping memory layout or data structure internals.. I’ll always need to get outside of the abstraction and “do it myself” so to speak.

This has in turn led me back to C/C++, some assembly and direct llvm programming, and writing a lot of Python tools that expose more of these lower level concerns at the Python level.

In a sense, I feel now more like there are not really programming languages so much as there are specific pieces of software tightly coupled with specific pieces of hardware, and I may need to modify or subvert fixed rules or abstractions of any part of it. Then a programming language just ends up being whatever common pattern of stuff on the software side ends up being useful enough to get repeated from project to project, and I don’t think it’s an accident that C is such a ubiquitous language in this sense.

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

#10
I used to hate C and thought it was primitive, ugly, dangerous, tedious to write in and annoying to read. While writing a big project in it (https://github.com/RedisLabsModules/RediSearch/) , I've discovered the zen of C I guess. Instead of primitive I started seeing it as minimalist; I've found beauty in it; and of course the great power that comes with the great responsibility of managing your own memory. And working in and around the Redis codebase, I also learned to enjoy reading C. While I wouldn't choose it for most projects, I really enjoy C now.
Post reply on HN