Interesting how much has changed since 2015. Apple's M chips have made RISC is a clear yes now. Rust has a pretty fancy type system. Not Haskell-fancy but still. Functional programming is pretty much an expected feature now.
What's worked in Computer Science: 1999 vs. 2015 (2015)
131–140 of 155 posts
Re: What's worked in Computer Science: 1999 vs. 2015 (2015)
#132Earlier quoted context omitted.
Java records are object-oriented construct
OOP is about bundling state and behaviour into units that hide their internal mechanisms by some kind of interface. Records can have no state - compared to regular classes - so they are an anti-OOP feature.
Re: What's worked in Computer Science: 1999 vs. 2015 (2015)
#133I'd say that " pure Functional programming" has become a no. But "Functional programming approach" has been subsumed into existing programming languages, e.g. records in Java. You get most of the benefit of FP while keeping all of the other good stuf from an imperative language.
Aren't these just C structs?
> You get most of the benefit of FP
FP = Functions. Same output for the same input. No capability to interfere with (or to be interfered with) other functions.
Re: What's worked in Computer Science: 1999 vs. 2015 (2015)
#134I'd say that " pure Functional programming" has become a no. But "Functional programming approach" has been subsumed into existing programming languages, e.g. records in Java. You get most of the benefit of FP while keeping all of the other good stuf from an imperative language.
> e.g. records in Java Aren't these just C structs? > You get most of the benefit of FP FP = Functions. Same output for the same input. No capability to interfere with (or to be interfered with) other functions.
Are C structs guaranteed to be immutable at compile-time?
Re: What's worked in Computer Science: 1999 vs. 2015 (2015)
#135Earlier quoted context omitted.
I haven’t used Java in many years, but TypeScript’s structural types give it a different flavor than I remember from Java. Unlike in Java, most of the types I define aren’t classes or interfaces. It’s just data that has an expected shape. Check out the design of Zod, for example. I have a bunch of Zod types for the validation of incoming JSON messages. This automatically generates the corresponding TypeScript types t…
In functional programming, a type is just a function that returns a list of possible values. It’s not a class.
Re: What's worked in Computer Science: 1999 vs. 2015 (2015)
#136Earlier quoted context omitted.
I haven’t used Java in many years, but TypeScript’s structural types give it a different flavor than I remember from Java. Unlike in Java, most of the types I define aren’t classes or interfaces. It’s just data that has an expected shape. Check out the design of Zod, for example. I have a bunch of Zod types for the validation of incoming JSON messages. This automatically generates the corresponding TypeScript types t…
In functional programming, a type is just a function that returns a list of possible values. It’s not a class.
Its literally not; there may be a language which does this or something close (actually, I’ve seen narrow, purpose-focussed relational languages where this is the case, and all types are enumerable), but it's definitely not generally the case in functional languages.
Re: What's worked in Computer Science: 1999 vs. 2015 (2015)
#137Earlier quoted context omitted.
> Functional programming means functions are first class citizens and can be constructed on the fly. FP is much more than this one language feature.
Yes, the field of FP is much more, but the core of FP is that. A language doesn't become non-FP simply because it has some imperative abilities, or logic programming builtin, etc.
You need expression orientation, immutability by default, persistent collections in the standard library, some way to handle monadic code, etc…
Re: What's worked in Computer Science: 1999 vs. 2015 (2015)
#138Earlier quoted context omitted.
OOP is about bundling state and behaviour into units that hide their internal mechanisms by some kind of interface. Records can have no state - compared to regular classes - so they are an anti-OOP feature.
I would say OOP revolves around the concept of modeling real-world entities or concepts as objects in code. Records encapsulate data fields within an object, providing a way to model real-world entities.
Re: What's worked in Computer Science: 1999 vs. 2015 (2015)
#139> Fancy type systems We are taking steps to this direction. By adding optional typing to dynamic languages Python and JavaScript/TypeScript. And then type checker tools and local programming style guides are making using these maybe less optional, and more mandatory.
IMO the day python types become mandatory there will be a fork. It would be such a total betrayal of it's reason for existing that we would have to invent another untyped or duck-typed language again.
Presumably, a Python with "mandatory" type hints would still allow you to cheat in those same ways.
Re: What's worked in Computer Science: 1999 vs. 2015 (2015)
#140Earlier quoted context omitted.
For me the primary purpose of TypeScript is to give my editor information about interfaces so I don’t have to do the menial back and forth of accidentally making a typo in a function name, object param, etc. I find myself using less type hints in Python because the story for REPL driven development is so much better than JavaScript, and that takes most of the pain away.
Giving the editors hints in this case is very expensive.
It’s so much easier to sit down to an unfamiliar codebase, or to participate in a team of more than three or four serious contributors, when typescript is there to guide you.
I never would have guessed that that would be the benefit that won me over, but it absolutely has, all it took was a two year / six people project to completely sell me on typescript.