Podcast Lookup

#21 Statically-Dynamic Programming or Dynamically-Static Programming? And Death by 1000 Language Quirks

Happy Path Programming

  • February 26, 2021
  • 51 min
  • Season 1, episode 21
Episode page
About this episodeJames is a Dynamic Programming Language Denier but realizes only a part of his code is actually statically typed. And programming…

James is a Dynamic Programming Language Denier but realizes only a part of his code is actually statically typed. And programming languages so full of quirks that you have to hold the quick reference book in your teeth.

Discuss this episode: https://discord.gg/nPa76qF

Transcript

From the publisher

This transcript comes from the podcast’s own feed, shown as the publisher wrote it.

#21 Statically-Dynamic Programming or Dynamically-Static Programming? And Death by 1000 Language Quirks

00:00—
  1. Welcome to happy path programming. I'm Brew cycle. I'm James Ward. So you said, you had been listening to or talking to John to goes. It's just to talk. It was a talk that he gave watching. Yeah, yeah, yeah. It's called a three but he brought up a topic in there that kind of blew my mind.

  2. He you know, I've definitely drink the Kool-Aid of static typing and think really think think that everything should be statically. Typed you know the more static typing, the more compiler Even the better. But he couldn't offered a different perspective for me which was that there's a lot of times in static type systems.

  3. We actually are building something that then doesn't actually get validated until we run it against the system. So some examples of this are sequel. Is a great one, I really like writing. My SQL code in a statically typed language instead of writing SQL which is You know, fall on Dynamic and then, and then passing that SQL query over to the system that then runs it.

  4. I really like to use these libraries that give me static types that then compiled into the sequel but then get run because if you're talking to a database then sequel is the only language that the that it understands. So I've really enjoyed that experience but I'm also that Static programming bigoted. And so of course, I would like that experience. So what John was saying was that that I get some benefit of the static typing.

  5. When I do that, I can have some amount of validation but I actually get zero validation that the thing is actually going to work, until I actually run it because I don't know if that's SQL. Statement is actually valid that the one that has been created by the static types. I don't know if it's actually Valid until I actually run it against the database. And that's just one example of many different places, where we do this.

  6. And what John was saying is that he understands why people are so drawn to dynamically typed languages specifically for things that are mostly unable to be validated until runtime. Anyways, so this could be reading Jason, you know, taking a Json request and doing something with it, like, you.

  7. Don't know until you actually get that Jason if your code is valid and going to work sequel. Things like data scientist stuff with spark which again is just you really don't know if it's going to work until you run it and so it was interesting to see it from that perspective of like, oh I really think everything should be statically typed, but at the end of the day, I don't know if all this static typing that I'm doing is actually giving me much. The analogy that I would use is like pure Math versus applied math because yes, pure math when you prove something it's like yes this is a universal proof but there's only so much you can do with that and where as applied math, you're going, okay, we're going to see if this works or not and if it does yay, if it doesn't, we'll futz around with it, it's very kind of fungible changeable.

  8. I was having yesterday I Talk to Luciano Ramallah, who's the author of fluent Python and he's working on a second edition now and he made the comment he said statically typed languages prevent you from. How did you put it writing code that you know will work? But you know to jump through the Hoops in order to make it statically checked, it can just be really painful and the experience that I've had with Java, generics has been like that where you don't, you go.

  9. I know what I'm trying to do here but to get the generic signatures, right? Is often actually reminds me of of darn. What are the The regular expression. Oh yeah. It's like I I can do a certain number of things with regular expressions and I usually if it gets bigger than that, I break it into multiple ones so that I can understand each one, but there are people who can like, just go.

  10. Oh, just do a back this or, you know, for River and back references, and things like that. And it's just like the, I don't know, it feels like it's beyond my mental ability to do that. And it's the same with generics, maybe this is what I mean, I think you'll do With a sequel to people just come out with some SQL statement that I'm like, whoa, like I can't understand that and it's like, I mean, it's great that somebody can do that, but everybody's got to understand it. And and so Luciano is saying, you know, here's this piece of code now.

  11. I know I can get it to work and I have tests for it which are not static checks. Their there are other kinds of tests but a compiler that you know is requiring me to fit everything. Into that box. It won't let me do it and so I wonder. Yeah, where where is the proper place for that line?

  12. If you're going to say cuz my my experience with Java feels like it's just it's when they run when the language designers ran out of gas they go. Oh well we'll just make this Dynamic and you know you have to do a cast and you'll have to put in a ignore this warning on it. And so it's I mean it's possible to do it but the thing is it's kind of discouraging, you know, to It's like telling you now you're doing it wrong, but I'll let you yeah. And maybe it should be something like, no, we have this clear distinction where here's all the things that you can do statically.

  13. And we're going to do those awesomely. And then when you want to do something like this, here's a flag for you to set. And then if if you're having trouble with your code, maybe you should go look at those things first because that's, you know, a likely. I don't know. I bet it's a fascinating.

  14. I also realized that for so many years, I've been defending pythons Dynamic typing and and I didn't really know why it's just, hey, this works for me, but I think John to goes his observation, which is that, you know, sometimes if you're, if you're going to do stuff statically, you wanted all happen there. And you don't want to be going back and forth between the two. Oh, I've got the static checking, okay, and now I've got this Dynamic stuff with python.

  15. It's like, well, it's you're going to find out about it at runtime except for the optional, static typing stuff now. Yeah, yeah. I mean, actionscript 3 was interested in this respect because it allowed you to, at the class level. Say if you wanted something to be dynamic, I think at the function level to wasn't it.

  16. I think it's only on a cloud. I wasn't on class. Okay. Yeah, so if you, if you had a class that extends object then that became a dynamic class and and so you could, you know, do whatever you want to against that instances of that class, there was no static type checking on any calls or or property references on that class. But otherwise you are statically typed and it was really interesting because there were you know, did some X feel a little you would feel a little bad if you went into the dynamic land.

  17. But if you're interacting with the system that you can't validate anyway, it's like you've made a HTTP request to some service and you've gotten a response back like you can't actually validate that until you make that call. Anyways, So, making those kinds of things, Dynamic didn't feel that bad and actually made you a lot more productive because you're like, I don't have to like model this thing with no guarantees of until I run it that the way that I've modeled it is actually accurate to what the thing is.

  18. So you just make it Dynamic and, and you'd run it and, you know, I'm very and you do tests on it. Yeah, you know, was it? Like you would just go naturally this work, right? It's just a different kind. Kind of testing. Yeah, I wonder I mean this idea I think kind of crept into checked exceptions as well because that's, you know, a kind of a static checking and in the end it's like well the point of exceptions is recovery. Took me a long time to realize that and most things you can't recover from.

  19. You know, it's only if you're Crossing Audrey's your, your, you know, talking to an external system that might fail and then if it does fail, maybe you can just try it again. That's almost the extent of most recovery, you know. It's like, how much, how much else could you fix and everything else is basically programmer errors and so having checked exceptions to, you know, imposed on you for that very small situation. And using exceptions everywhere for that matter. Yeah.

  20. And it's taken so long for me to kind of get clear on it too. Yeah. It's I think it's a fundamental mindset of whether we can control everything. Yeah. Yeah. And I want to control everything. Sure. But anytime I talk to an external system that is That has a data model that I don't have.

  21. I can't control that, right? Like it is a piece of my system that is out of my control in terms of what, what's going to happen? Yeah. Even in functional programming. That's, you know, we've been been able to like, fit everything over here. It's like, okay, here's the pure math stuff that I have control over and then if I cross a boundary to the outside world outside world. Yeah.

  22. Or or even to well I guess a clock is the outside world. The passage of Of time any of that stuff? It's like well I don't know what's going to happen with that. That's that's where all the problems are. Yeah. So yeah with so in the example of when I'm working, when I'm writing like Scala code or cotton code against a service that I'm consuming data from, I think this is a good example, what I do is I have a basic idea of what the data model for that service is and so I try to model that that data in You my static types and the only way that I can actually validate if my my model that I've created is accurate is to actually call that service and test. Okay.

  23. Is the thing that I got back from that actually fit into my model or not it. So when I'm actually iterating on these types of things, the same thing is true for when I'm writing SQL statements, right? It's like, I'm constantly actually iterating in my development cycle to try to verify That my model matches the external model.

  24. And so, I'm already like running against the external system to do this validation and in, but I'm but I'm trying to get my statically type model to conformance with that with that external system and the dynamic typing model just says, Alright, you're already like running this thing to validate your model.

  25. Why don't you just run the thing? And validate that your think that your code actually works The thing actually runs that was my argument with python was that we still have to do tests. Yeah, these tests just happened to be there. Static tests happen to be, you know, at the python actually does have a compile phase but anyway, you know, it's like they're all tests to validate whether your system is okay? And to say that you can only have static tests. Might be too limiting for a practical system. Yeah.

  26. I don't know. Yeah. You if you're talking to an external system you need to have integration tests that validate that the things are actually going to work. And because that external system could change to. Yeah, that's a whole nother thing is, is what, how do you handle potential change?

  27. But even just to validate that as things are right now that they actually work, you should have integration tests and I write a lot of Gration, test site. Most of the code that I write ends up needing an integration test, because I'm actually talking to an external system and need to validate that. In some way, I've been using test containers. As I've talked about a bit on this podcast is a way to easily set up some external systems and validate them. So, test containers, take Docker containers and plug them into the testing cycle or your local development cycle. And so that if I need a postgres database with the schema, I can at least like bootstrap that as part of my test and run my integration tests against that and validate that it works, is part of my test.

  28. So it just creates a nice way to do those external validations, but my compiler is not telling me that my that my query is invalid or my schema mapping is invalid. It's not, it can't tell me that, right? There's no way. A for the static type system. Actually tell me that. I wonder if this isn't like an extension of gödel's incompleteness theorem where it's like basically there's only so I mean you can you can have a complete model of your system but there's always a boundary and an outside to that system. It can never Encompass everything. Yeah, earliest that's my that's my take on the incompleteness theorem and it's like oh, you know this feels kind of like that.

  29. Yeah. I had a just popped into my head. I had an insight about concurrency which was that All any concurrent system that's actually going to run faster than a regular system? Has to be has to have parallelism involved. Because if you think about even you know, because we have an async system, which is like for example in Python you're you're running, you know, a single task to run everything and it only makes sense if you're you know calling out to an external system which has its own processor.

  30. Yeah. But if it's if it's all packaged inside then you're going to have. I mean, unless you're using multiple processors within your machine and if you've got a single processor and you're running an async thing, it's going to cost more because of context retching. Yeah. That was Justice. I thought.

  31. Yeah. Yeah I like it. Mmm. Yeah, it's relates to something. I used to talk about a long time ago. Three active over start talking about reactive stuff. I said if you if you don't have anything to not block on then reactive has really almost no value for you. You need to be able to do things in parallel, essentially to relate to what you just said. And if you can't do things in parallel then let's not do you there.

  32. Yeah, if you don't if you don't have those other processors running. Yeah so I mean but reactive is really another form of concurrency, right? Yeah, it's a way to take advantage of concurrency for mostly IO things, right? You a lot of times in IO, you're waiting, sure and might as well do something else while the as well. Do something else other processors while Coming up with its data.

  33. Yeah, for something. Iowa is to respond, right? And if it's an internal system, then it doesn't make sense unless you have multiple cores in your CPU. That can be running these other tasks. Yeah, so yeah, yeah. Said that the dynamic static thing. It's, you know, I think John's framing really helped me. Understand a lot of the The pushback against trying to do everything statically and I get it. And I just wonder if we haven't really found a good kind of Middle Ground to this yet.

  34. So, with with, with protobuf. So I think, I think we're starting to see the ability to do this a little bit differently in a way that that may actually be a step. Forward into into making it. See, you can actually validate external systems at compile time, so, with Proto with Proto Buffs because now, your, are you making a distinction between Proto debuffs and grp see? Cuz I, yeah, because I think of pro debuffs is a mechanism to implement your PC.

  35. Yeah, so, let's talk first about part of us. So, okay. So with protobufs. There's the idea. What's that stand for again? You get interface description language. So it's like a, it's like a generic programming language. That gets compiled into specific programming languages. Yeah, so you're able to say and it's really, it's just interface. It's basically just interfaces.

  36. Yeah. And and then, when you compile it into say, C or python, or whatever, there's ideal compilers for basically everything, it, generates the actual code that you need to For the python to send and receive or whatever. Yeah and so the so the idea for GRCC and Proto Buffs is the protobuf description and then there's the Proto C compiler, that takes that that description, and then can generate many different languages, wrappers around that description.

  37. And so, so then gr PC is the And protocol that then uses Proto Buffs underneath the covers to, to actually communicate. But with, with grp see you have a server that says, I talk this protocol, you have a client then, then talks that protocol. And so you've got this agreed upon contract.

  38. That were you've generated both the server code, in the client code from a, from a shared IDL and So now you have an external system that you're talking to, right? But you can actually validate at compile time with static types that your communication is is correct your communication.

  39. You can actually validate a compile time that it's going to work with and is that because the ideal is generated as the shared idea, okay? Because you've shared a contract, the idea in this case, between the two, right? And so if I'm doing it in kotlin now, the cotton compiler is going to make sure that that generated you can access a property that doesn't exist, right?

  40. And so, I think that there's something interesting about bringing together this Dynamic static. It's not about bringing together Dynamic and static. Maybe it's about giving you the benefits of dynamic by sharing an ID, l In a way that you get the actual status of the value of static typing against that. And so, what, what I haven't really seen much of yet is taking this beyond beyond just using this shared ideal for for serialization and deserialization essentially. That's that's all that it's doing. That's all.

  41. So like when you on in grp see, I guess it's not. It just it just serialization. It's met. Its operations in serialization so we are PPC ads. The concept of you also defined your operations on because I'm making a RPC a remote procedure call the exact. Right? Yeah. Yeah. And so I guess you're not just getting serialization. You're getting the you're also able to to get the operations on the hideo.

  42. Verified static with static types. So But what I haven't seen yet is taking this Beyond operations and data to something like queries. Mmm, so queries are you know you can create a SQL query that does anything. And you don't know if that's valid until you actually run it against the the current set of data. See ya.

  43. So wonder if we can if we can take this to some other the shared ideal construct, two other areas that would allow us to have more static, static validation for things Beyond just operations and data. Yeah, but it doesn't test Behavior which is what you're talking about. Yeah. See maybe, that's maybe.

  44. That's our problem is expecting. Static type checking to validate Behavior. Hmm. Which it can't. Do ya? Yeah, it's true. Whereas if it's Dynamic I mean if I think see because an example of this would be lets say that. Let's say that I call a gr PC and point with with some data, I can validate that that my data structure was correct. I can validate that I'm calling the operation correctly but what I can't validate is that that I can expect a certain result to, to come out of that operation call. So for example, I have with some Services there, there can be weird behaviors, like, I call this endpoint, I give it some data, I create an object and then if I immediately after I create that thing, try to like, make a another call to, I don't know, do something else with that object. The system would be like I don't know about that object because of like, eventual consistency or whatever it may be some sort of State thing happening.

  45. So I've just like, hit like some kind of race condition and so that's absolutely something that is totally valid from the data and operation perspective. But from the behavior perspective, I've not been able to validate with my type system. Yeah the design by contract stuff is like an attempt to make that more reliable by saying okay validate.

  46. Conditions, do the thing check post conditions but it's still, you know, it within that function. Okay, that helps. But yeah, I think we're just trying to maybe we're trying to do something that we're looking at the problem wrong. We need to look at it as maybe the applied Math versus pure math saying.

  47. Okay yeah, here are things. We can validate and we should do that. But then there's this line we cross and then we're into this world of. We don't know if that model works, you know? And but but maybe just acknowledging it you know because because then it's like okay we only want to take our static type checking so far right and then we want to actually add a bunch of you know rather than saying we have to be able to statically type, check everything and then We'll fix all of our problems. Finding that line where we're going. You know, it's beat the now.

  48. It's beyond, it's making life a lot harder. And what we should really do is add a bunch of stuff in the dynamic area to to help us be able to validate our systems. Yeah. Yes. The John didn't go into and as much detail as I would have liked on how Scala 3 is addressing some of this to make it. It easier better, whatever.

  49. I think what I think there's a few pieces that are that are making it a little bit better and Scala 3 but I think, I think generally the core problem still exists. So I think GA DTS are are one of the ways that that makes it, at least easier to should probably spell that out. Yes. Yes.

  50. General Zhao, is it General? Algebraic data types. General Quest. I may be getting that wrong. I, I don't know much about Gaz tease, but it's a way to do type class. Derivation. Hmm. So you and I've been diving into type classes and lately and what what we as we've been working with type classes, we are writing the type classes that do a conversion from a My type A to a type B and we have to manually Implement that. And so what, what GA DT is enable type class derivation to do is to for the compiler, to create the type class for you. Hmm.

  51. So now you get the adapter from your type, so I think it's not really addressing the underlying problem of of I have to make I want to make this thing static and I don't know if it's actually going to work until I actually run it against the production system. I only it's actually dealing with that problem. What it's saying is we're just going to make it a lot easier for you to to do the static typing stuff and you're going to be able to generate these things and you're still going to have to validate them against your system or things could actually go wrong.

  52. You know, when you run this thing against a real system like we're not solving that problem but they are making it easier to deal with the static typing. Um, maybe overhead complexity that you as a developer would normally have to write to interact with those external systems. I like easier when applied to language features, yeah, make it easier for you. That's, that's music to my, my ears. Yeah.

  53. So an example of this is that in Scala to if you want to generate SQL statements from your static code or you want to generate Jason DC realizers from, from your static code, the way that this is typically done in Scala to is that you have to either as a developer, right? Those mappers manually or you use a macro to generate those, those wrappers for you.

  54. And so Escala three will be able to have the compiler, generate those rappers, but not via a macro, which can be a little Black Box, he's scary magical. And so now it's UT T is the the those generators become much more? Well formed and part of the like core Machinery of the language, but just to be clear scholar, three still does have some kind of macros. They're just easier to understand or something is that they've had, well, task.

  55. Josh threat for more details on this because he is a real expert on this. But my understanding is that they they, for backwards compatibility. They still have the basic macro system, which is taking strings essentially, and, and injecting them into the compile process and that's what macros are essentially doing for the most part. And so, so they still have that.

  56. But they've created some higher level abstractions, that accomplished a lot of the same things that Macros are doing, but they've done it in a way that is not. So, freeform scary. They've done it in a way where the compiler understands what's happening. The compiler is giving you the right places to hook in to the compile process and it's actually using Scala syntax, right? Yeah, okay.

  57. Which is much nicer than saying, oh, we're doing macros now. We're switching to a different language. Exactly, exactly. So there there has been away to use Scala syntax to write Scholar macros, but it was a bit of a hacky worker and so g, a, a t t is our one of the new ways that accomplishes the same thing as macros, but do it in a much safer way and in a so one of the key things that scholar 3 has really been founded on is trying to have a provably correct type system and it turns out when you macros you Louvre, Lose the ability to prove to prove that your static types are correct.

  58. And so the macros were off the table for being being able to be part of Link then dot calculus. Verifier of the static typing, but they needed some way to accomplish the same things. And so so they've created a number of higher level abstractions that give you the type soundness with Without having to drop down to macros. So another one is, we talked a little bit about you and I this week, which was the match types, which are another way to do compile time metaprogramming, but do it in a, in a type sound way.

  59. Hmm, yeah. So I think I think maybe there's a couple different Avenues of exploration that are happening here. You know, like, I think you've got this whole spectrum of what we can do, you can just be like, well I can't verify it. And so Dynamic typing is great and works for me or you can be like, the like me and be like, all right, I don't care if I can't verify it at compile time, I'm still going to use static typing and I would much rather write a flat map to do a join on a data set then.

  60. You do an actual SQL, join. Because I can never remember if I should do an inner join, an outer join a ever join. And, and so, when I write SQL, essentially, I do a flat map units and to me that just feel so much better. But, you know, I'm a, I'm a scholar program or not a sequel person and so said there, so there's that side of the spectrum. And then I think think there's the like shared ID lgr PC, which says all right, you know, maybe We can be, we can have the static types by sharing definition across our systems. So I think that's one approach and then I think on on this call of three side says all right.

  61. You know we're still not going to validate, be able to validate that this thing works until you actually run it, but maybe we can just make dealing with the static typing around this stuff easier with with gdts and some of the other scholar three features. I think I've finally come Kind of come to the conclusion that my issue with static typing.

  62. And I sure a lot of it had to do with Java was that you would go through all of this ceremony. And a lot of it because of the Java syntax was way more painful than it had to be so and then, you know, when you go to college and you go, oh, this isn't so bad, it's straightforward, it's understandable.

  63. I can read it and everything. But but in Java, there was all this kind of Sturm UND wrong around it and then you'd still have stuff that failing at runtime. And it's like, okay if I'm going to, you know, have Of stuff fail at runtime. Why did I have to put, you know, go through all this struggle to satisfy the compiler.

  64. And I think when I work with languages, where first of all, the syntax is a lot cleaner, like, like kotlin and then I can see it as. Oh, it's doing as much as possible for me, but it isn't putting me through all of that pain to make it fit. Its yeah, and I mean, sure there's still going to be failures at runtime but it's helping, it's helping, it's not arbitrarily.

  65. Forcing me to jump through a bunch of Loops. I don't have to repeat my. That was one of the things that I've come up, you know? I just realized with, with Java, it's like, oh yeah, with the new Vera syntax, so it's, you know, can do type inference. Once again, well, it works most of the time except a few cases where it doesn't.

  66. It was we were discussing this earlier. It's the pain of all of those special cases that you either have to remember or you just stumble across and go wait a minute. Why doesn't this work in this case? It's not it doesn't have that consistency. That makes it easy to move forward when you're programming. It's it's like Yeah, sure, lambdas are much, rather have lambdas in Java than not, but then, there are these special cases where they don't work, or they don't work the way. I would expect them to and then I have to go. Did I did I misunderstand this or oh no, it's a special case. And I have to deal with that special case. That's like at some point in.

  67. This is why I was calling it, The Java, the death of a Thousand Cuts. Yeah, it's like Of these little things build up and at some point you go yeah, it's nice to have these new features but they all have their little special case costs that I have to deal with. And I should either not use the new features at all, just be Java, programmer, old-style, Java programmer.

  68. And then if I bet if I start just adopting these new features one at a time and deal with all of their little special cases and the code that I write is going to look. Two people like why did you do that? Well, I had to but it doesn't, it's not obvious when you're reading the code as like, you know, at some point you should just say, oh, if we're going to start having new features like important new features, we should just switch to kotlin.

  69. Yeah. Yeah, yeah, I think when I go and go back and write Java, I feel those little cuts and, you know, just just one cut isn't so bad. It's like okay, well, I guess I'll deal with Primitives. Like I don't, I don't want to deal with Primitives and I'm so glad that in most modern languages.

  70. I don't have to deal with that. So just as like, one little cup but then and then another one comes, like, lack of type inference. And it's like, just a pain, really? I got Specify these types. And then yeah, just accumulates and accumulates to the point where now I have a hard time writing job.

  71. And I think I think it just is painful and I think that that now I'm very sensitive to all of those little blue cuts that that I get when I'm writing Java. Yeah, it is although my experience was that okay, it took me about, I don't know, a couple of weeks after going from the cotton book back to updating the John Java 8. Book.

  72. It took a couple of weeks before I kind of settled into it and kind of remember. Okay, this is the world I'm in and I'm not constantly going Earth Earth. Why is it you know, why didn't they do it? Right? And then, you know, and then it's okay. But I'm still aware that I had that transition and I'm also much more aware.

  73. I've had this with learning new languages. I'm aware of that the working on kotlin has influence the That I think about Java and I think I write better Java code. You know, it's like there are things where I'm going. Oh well yeah I should traditionally you know, I'm rewriting this code and I had some sort of private variable which doesn't really need to change and then had a method to expose the variable and you go well why not just make it final and then just have some you know it's like that's not the Java where well yeah maybe you maybe we experience more Or Cuts as we try to like shoehorn a paradigm into the language that it wasn't really meant for so where I experienced a lot of these little cuts when I go back to Java is around immutability and I'm you know totally try to make everything as immutable as possible as we talked about many times but when I try to do that in Java, oh you hurts like like the fact that there's no that

  74. it's not an expression oriented language makes it really hard to do immutable. Thanks. So I ended up in some of my Java code because if else isn't a, isn't an expression in Java, I ended up using the the it's a ternary ternary quaternary syntax which just looks terrible and gets really unwieldy. And, you know, I definitely feels like, okay, I'm pushing against what the language was designed for and I'm getting cut as a Result of that.

  75. And if I would just throw my hands up me like, okay, I'm not going to try to write Java code, like I write Colin or Scala code. Then I probably wouldn't get cut so much. I guess so. But they're still, I mean, you know, the benefits like like in this case, I'm looking at things, I'm going.

  76. Oh, well, this is really a messenger / data transfer object. I wasn't thinking about that when I was writing it, but now I look at it is, so I should make the fields final, initialize them, you know, in the Constructor and then it just, you know, and you see the benefits. Doing that and but but then somebody might come along and read it and go.

  77. Why aren't you using the standard Java idioms for this thing? You know we the bean we're not going to have properties because that's dumb I don't know why you know maybe they'll add them in Java what would it be Java 23 or something the next long-term release they finally go. Oh yeah we see from kotlin their Thirties are actually pretty useful thing to have so we'll put them in and then of course those will have the little compromises that they have to put in that you have to remember, I don't know.

  78. I'm just, I think my recommendation is stick with the Java that you have now until you're forced to move to the next long-term release don't change your code as much as you can but if you want to do anything beyond that change languages and go switch to kotlin. Yeah. I think to your point once you've once you've received enough of those little Cuts, it's a it's good motivation to move forward to a different more modern language. But how do you have all the baggage? Because because I think like you're saying like even if you do start adopting, the brand new features of java which there's some nice things there, you still, you still have a lot of sharp objects to get cut on because they've had to add these language features in at the cost of something. and, and so, even if you're trying to adopt a new Java stuff, It may just be easier to switch to.

  79. Oh, I think it is. I mean the the question is how is that? How do you convey that to the people who make that decision? You know, it's like we have all these little annoyances programmers are always complaining about things just suck it up and deal, you know. Just we don't want to change from java.

  80. It would it would cost too much and you're drinking. No, it actually would cost more. Not to that's going to be hard. I mean maybe Maybe some kind of studies or something would would do the trick, I don't know. But it's a good example. This is the, the Java stream API stuff because I want the functional stuff on all my Collections and in the world of java, it's great that they added that but it's painful to use because you have to transform your, you most of your code is dealing with non stream. Collections.

  81. So they have to transform into a stream. And then once you've transformed into the stream and do your operations, then you have to transform back into the like bass collection often times. You have to do that, like, collect and then collections to list or whatever it is. And, and it just like there's, you know, it's nice that they stream API exist, but there's a lot of cuts that you don't feel when you're doing the functional Transformations on Collections and Colin or Scala, right? It's another one of those things where it would, Been nice. Well, generics is the greatest example because when it's been added to an existing language, there's always that compromise that gets made.

  82. Yeah, yeah. With all of this, I have already found myself thinking, oh, I'm I'm gonna, you know, rewrite John Java 8 for Java 17 or whatever. I'm going to try and make it as, you know, none. I'd like that to be the last job. A book that I write, but I'm actually Rigged just to see oh you know how is this going to look different now that we have records and whatever their pattern matching is going to look like? And you know there's going to be compromises. Their it's not going to be like I mean you know because the switch statement, they added strings, woohoo. I mean I know people use strings a lot but it's like, it's not really a generic.

  83. So anyway, I am and the tver and all that kind of stuff and I am not going. Yeah, I would like that to be the end point. And you know, rewrite it somehow and do it right, quote unquote, right eye, I can't see myself, not doing that, just because I'm intrigued to now. But if you roll forward, the clock, let's say five years from now. What percentage of the Java Community, do you think we'll have adopted the new Java language features or switch to a new language?

  84. Judge or just stuck with another syntax that we have today, you know. yeah, I feel like the people who are interested in new features are gonna see that They're going to see the awkwardness of trying to adopt the Java way of doing it versus switching to kotlin. They might not have the power to get their company to switch. And so, I don't know.

  85. That's going to be a mess because there are going to be a lot of people who aren't interested in. You know, I'm a Java programmer program.java. This way. These new features. They take time to understand and acquire. It's a different way of thinking about the problem and there's all these. But I just don't To do it.

  86. And then there are the people who go. I can't, I have to and and those people maybe they'll end up just changing jobs. Yeah. 22. You know, somebody's running kotlin or Scala and then there's also there's percentages and then there's numbers because it's like you know, even if What do you say million?

  87. Java developers stick with the because that's still two million Java developers and maybe that's only, you know, 20% of the Java developers or whatever out there the rest of them move on. But that's still, you know, test still a lot of people I guess if you're Brian gets and the folks at Oracle, your maybe you may be, you know, that you're not going to keep 100% of the people on Java, but you're still potentially talking about millions of developers that are going.

  88. To move forward with you. And that's a I'm sure good motivation to keep innovating and and keep doing great things in the language. Oh, speaking of cuts. You told me a story about your your Pearl guide. Tell me that tell you. Tell the story about your Pearl guide. Yeah, so we were talking about cork Works in languages. Yes, which is very related to this concept of these little cuts.

  89. And and I was telling you about how Pearl. How long ago was this? Is this was 98 skydivers that over 20 years ago. Well, man, it is too old, man. I could have gray hair, so, so I was Pearl, has has so many quirks and I just can't keep all of them in my head. And so I was building an e-commerce systems in Perl and and because that's what you did back in 98, I tried doing it in C, so I got stuck So there's so many quirks in Pearl that I could not keep in my head, I had the O'Reilly Pearl quick reference book which was a tiny little.

  90. I don't know 3 by 5 in very thin book that was just you know the very minimal but it was enough where it would give you the quarks that you needed to be able to look up quickly. And and so as I was programming and in Perl and and encountering these quirks, Often. I needed that quick reference book so handy that I would literally put the book in my teeth and hold on to it with my teeth so that I could type and then quickly, you know, very quickly, pull up, pull up, the quick reference book out of my teeth and look at, look something up and then put it back in my teeth and keep typing. So it just was it just was, you know, that close at hand. I needed it so often.

  91. So now my maybe this is driven a lot of my goals and programming is to grab agitate towards things that don't have so many quirks and don't require a quick reference book that that hand. So, you don't have. Yeah, that it's the special cases, like, what you'd really like is this kind of consistent flow and I mean, that's what I always loved about.

  92. Python has like it just seemed really straightforward to me and that it wasn't going. Oh no, this is it's going to be, you know, different or special or whatever. I get give them. So Yeah so I guess I've gravitated away from the things that require me to hold a quick reference book in my teeth. Do you mean?

  93. Well I mean as far as I know you've never done that since Pearl. So I haven't done that since Pearl. But now with stackoverflow, I very often. You stack Overflow almost in the same way as holding that book in my teeth as do we all. But there are languages and technologies that I am much more stackoverflow Centric to then than others.

  94. Sure. So bash, oh God, I guess I haven't gravitated. Totally away from things that are very quirky because I've written a lot of bash lately. Oh, really hum and Bash, is one of those things where I am. I am on stack Overflow. Like every 30 seconds I have, you know, I've written bash shell scripts but it's never made sense to me as a It would be so nice because it's just right there. You don't have to get people to load anything or anyone Universal this of.

  95. Yeah, it's nice. And so what I end up doing is if I'm going to do anything more than just a few lines of bash, I go. Okay, I'm gonna use Python because it allows me to do everything I need to do and I don't have to learn this weird. Yeah, Arcane syntax which yeah, I just I've never internalized that Well I was surprised that we were able to do this topic for the entire time but one of the things I'd like to put out there is if people have topics.

  96. I mean there's no guarantee that will you know, cover them. But if they have topics that they'd like us to cover or people, they think we should interview, please put that on the the Discord Channel. And then we Can, you know, have more possible things to to look at? Yes, so yeah. And we do need to get some guests on. You need to send some emails after my discussion with Roman from jetbrains yesterday.

  97. Only we got to get him on. Oh, yeah. He's he's got he, but he might be beyond our our brain capacity to keep up with, but we can always ask him questions. I got to get somebody from Unison on mmm. Oh yeah, that would be interesting. Yeah, some of these topics that were fascinated with.

  98. We can use the podcast as an excuse to talk to interesting people. Well, that's what we do on every episode. Is we talk to interesting people? Yes, I find you a drink. Yeah, I find you interesting to. We should expand our Echo chamber though. Yes, he said, okay. All right. It was once again, it was fun.