Live data from Hacker News

What was the last breakthrough in computer programming? (2019)

quora.com

71–80 of 226 posts

Re: What was the last breakthrough in computer programming? (2019)

#71
post #58

Earlier quoted context omitted.

Checkout Clojure spec for a very expressive way of defining data requirements. It allows you to use arbitrary functions to describe data requirements. That way you are not limited by static, compile-time only descriptions of data flowing through your program.

I used Clojure on a project while spec was still alpha/beta or something, so I never used it. It does sound interesting, but I'm skeptical. Even the way you described it- I'm still just writing a function to validate my data, aren't I? Is that truly any different than just calling `validateFoo()` at the top of my functions in any other language?

'Maybe Not' is a great talk on this subject matter. https://m.youtube .com/watch?v=YR5WdGrpoug

Re: What was the last breakthrough in computer programming? (2019)

#72
post #56

Earlier quoted context omitted.

Mmmh... these are not very convincing examples. Statically typed languages give you u8/i8 types of numbers. Maybe having a non empty string, or non empty list, type is useful now and then, but in practice, just have your code work just as well on both empty and non empty values, and you're good to go. I'm pretty happy with the languages we have today overall (Kotlin and Rust at the top, but C#, Swift, and Java get an…

Your comment kind of galvanizes my view that most of us suffer from Stockholm Syndrome with respect to our programming languages. As another commenter said, some statically typed languages give you unsigned numbers. Maybe most of them do. But definitely not some of the most popular ones. And out of the ones that do, they are often really unhelpful. C's unsigned numbers and implicit conversions are full of foot-guns.…

> We don't even need empty strings (or collections, really) if we have null.

This feels exactly backwards to me: I almost always want my sequence-like types to have a well-defined zero-length element, and I almost never want to allow a NULL value for a variable. NULL is so much worse than [] or ''. Think about concat(). When the trivial members of a type support most of the same behaviors as the nontrivial ones, that makes error checking so much easier.

Re: What was the last breakthrough in computer programming? (2019)

#73

Earlier quoted context omitted.

Can’t this be expressed as a library in Haskell or even F# though?

That style sounds like it's mutating variables when other variables change (that is, mutate). That doesn't sound like a good fit for Haskell...

Haskell is great at mutating variables. Reactive programming was even pioneered in it. It's just that the Monads that allow you to do this are somewhat like sticky tar - everything they touch becomes a part of them.

The traditional structure of Haskell programs is to build a pure functional 'core', and layer around that the 'sticky' parts of the code that need to interact with the outside world.

Re: What was the last breakthrough in computer programming? (2019)

#74
post #25

There isn't so much in languages features themselves, but in their implementations. GC can be largely pauseless for many practical purposes and a GC language can be within 2x-3x the performance of C-like languages. Also the amount/cost of memory has improved so that we can use immutable datastructures and functional style in many contexts, which definitely feels like a 'level-up'. Concurrency has been getting easier…

It's nice to read a positive comment like yours occasionally, because the vast majority of the time, I'm just disappointed in how bad our programming tools (including languages) are. It's become a meme in my office that I'm the guy constantly bitching about how stupid our languages are. This week I was back on my soap box about the fact that almost zero mainstream (statically typed) programming languages can even let…

It’d also be handy to put other limits on my numeric variables, for instance to automatically throw an exception if an angle delta goes out of the range -180 to 180, or whatever.

Re: What was the last breakthrough in computer programming? (2019)

#75
post #73

Earlier quoted context omitted.

That style sounds like it's mutating variables when other variables change (that is, mutate). That doesn't sound like a good fit for Haskell...

Haskell is great at mutating variables. Reactive programming was even pioneered in it. It's just that the Monads that allow you to do this are somewhat like sticky tar - everything they touch becomes a part of them. The traditional structure of Haskell programs is to build a pure functional 'core', and layer around that the 'sticky' parts of the code that need to interact with the outside world.

OK, but the "reactive" programming sounds like how you build the core. So I still question whether that style fits well with Haskell.

Re: What was the last breakthrough in computer programming? (2019)

#76
post #59

Earlier quoted context omitted.

>how often have you ever written a function that requested a string as input and actually wanted an empty string? To be fair, I do it quite often. Most of the strings I deal with in my code are coming from user input, and most of them are optional. They are usually just passed to/from a database. If the string has some internal meaning (like ULSs or file paths), it usually gets wrapped in an object anyway. If you're…

Let me ask you this, though. If your strings that come from user inputs are optional, doesn't that mean they could also just not be present (as in null)? Why do you need or want two different ways to express "nothing"? Are all of the text fields just funneled right into the database without checking/validating any of them? I've written a number of RESTy/CRUDy APIs and I can't count the number of "check that username…

The argument for disallowing nulls is much stronger than the argument for demanding a compiler-enforced non-empty string. I definitely support the ability to declare variables, including strings, as non-nullable. An empty string is simply analogous to the number 0. It doesn't really overlap in meaning with null. It's true it would be useful to occasionally disallow the number 0, but only very occasionally. The obvious example is division, but having a representation of +/- infinity alleviates some cases.

> I've written a number of RESTy/CRUDy APIs and I can't count the number of "check that username isn't empty" checks I've written over the years.

Paraphrasing: "I've written the same kind of method over and over throughout my career and have been unable to (or made no attempt to) abstract it away." I love strong type systems, but it doesn't sound like the type system is your problem here. The problem is that you're constantly re-implementing the same business logic.

Re: What was the last breakthrough in computer programming? (2019)

#77
post #47

It always feels like Alan Kay is wistfully talking about how there could have been an alternate future where he and his ilk would do programming and computer engineering the "right way" and somehow the world has lost it's path. He waxes eloquent about how he enabled the genius's at Xerox PARC to do deep work and how they changed the world. I find his talks inspiring but I also find it tone deaf that he doesn't unders…

>If Alan Kay really wants to see the worlds next ideas birthed into existence, why isn't he at the forefront of free and open source?

He was, he created Smalltalk, released the source code and made it as open as it can be. You can see the source of everything.

The only problem was very few people were interested on that. Most children were interested in just one thing: games(the best quality they could get). And adults wanted to run professional programs in their inexpensive machines.

He just could not understand why people choose other languages, like C, that were anathema for him, but let people extract all the juice of their cheap computers in order to create and play games and also serious programs that previously only run on mainframes.

As an academic with early access to "hundreds of thousand dollars per machine"(and not accounting for inflation), he was too isolated from the rest of the world to understand what happened later.

Re: What was the last breakthrough in computer programming? (2019)

#78
post #47

It always feels like Alan Kay is wistfully talking about how there could have been an alternate future where he and his ilk would do programming and computer engineering the "right way" and somehow the world has lost it's path. He waxes eloquent about how he enabled the genius's at Xerox PARC to do deep work and how they changed the world. I find his talks inspiring but I also find it tone deaf that he doesn't unders…

I really enjoyed this critique of AK, but you could really stuff docker and javascript into "portability" to include technologies that provide the same benefits to other focuses outside of application programming. Intermediate representations like LLVM and WASM, and even environments like Wine and Linux subsystem for Windows have felt like major paradigm shifts.

Re: What was the last breakthrough in computer programming? (2019)

#79
post #59

Earlier quoted context omitted.

>how often have you ever written a function that requested a string as input and actually wanted an empty string? To be fair, I do it quite often. Most of the strings I deal with in my code are coming from user input, and most of them are optional. They are usually just passed to/from a database. If the string has some internal meaning (like ULSs or file paths), it usually gets wrapped in an object anyway. If you're…

Let me ask you this, though. If your strings that come from user inputs are optional, doesn't that mean they could also just not be present (as in null)? Why do you need or want two different ways to express "nothing"? Are all of the text fields just funneled right into the database without checking/validating any of them? I've written a number of RESTy/CRUDy APIs and I can't count the number of "check that username…

I hear your dismay but you could easily build your own library of string validations which can extend however you want and can reuse it as much as you need.

Re: What was the last breakthrough in computer programming? (2019)

#80
post #67
post #25

Earlier quoted context omitted.

It's nice to read a positive comment like yours occasionally, because the vast majority of the time, I'm just disappointed in how bad our programming tools (including languages) are. It's become a meme in my office that I'm the guy constantly bitching about how stupid our languages are. This week I was back on my soap box about the fact that almost zero mainstream (statically typed) programming languages can even let…

I'm not so sure that I sympathize with your example. Why not a type for even numbers? Odd, prime, not-prime, etc? You really are asking for a type that is "valid data." Commendable, but not a static property of data. As a fun example, what is a valid email address? Once established as valid, how long will it stay that way? If invalid, how long until it can become valid? Do I think better typing can be a boon? Absolut…

Dependent typing can do that sort of thing. In fact, here's a stackoverflow answer that uses even numbers as an example of a dependent type: https://stackoverflow.com/questions/9338709/what-is-dependen...
Post reply on HN