Java is an amazing language better than rust disclaimer let me preface this by saying my favorite language is has that I write toy languages for fun I am a PL nerd so my opinion is valid also the title is like 20% bait Jesus wrote this article it's from two it's from 001 um I do like that by saying I am a PL nerd my opinion is valid I mean really okay so so just to kind of set the scene before we go go into this article I'm going to tell you a little bit of background
about my myself uh I started off by doing Java Java 1.5 is where I got my education and this is actually how I uh became a software engineer was via Java I learned how to do some basic game programming in Java I used to build applets for the web that could drive around little things and that's how I learned my physics homework was by applying physics to a little JavaScript or Java application that I made yes Java not JavaScript Java application that I made way back in the day um I did not quite understand uh
Java uh but I still did it and I was pretty good at it and that's how I did it and so there you go that's my life and so Java always holds this warm spot in my heart now as far for as rust goes is that rust was my first introduction to a hendley Milner system and when I did it I thought man this is so good I absolutely love it and I did rust so hardcore for multiple years and then I realized that I don't really like rust that as much as I thought I
did I really like the type system but I also realized that structural typing is really nice too it's just super easy so you're saying your Java biased or rust biased I think I'm neither biased I don't think I really like Java but Java holds like a nice place in my heart just because I have like fond nostalgic viewpoints but I remember how much classes and and all the boilerplate I had to do and then rust doesn't hold nearly as fond of a place in my heart it's not as fond if that makes sense my secret
was always that I liked coding in Java in some sort of masochistic way everything is dead simple and everything is so over boast you can never forget what anything is it is like sitting down and playing a relaxing card game game of stardew Valley it flows so easily the feeling of Mastery is so easy to attain this is actually a really great observation sort of the one thing that makes Java hard is that you can abstract via inheritance and often when you get just enough abstraction of iio plus inheritance like just enough right like when
you hit that real like when you hit like Shad level clean coating where everything has like multiple levels of inheritance followed by multiple levels of inversion of control all at the same time time it's it's it's a genuine mess I've done it it's a mess yes it is a mess it's genuinely a mess and so when you mix those two things together it just gets it just gets so difficult and I've been there so can I agree with this yes it's very easy to understand what is happening in the thing you're looking at but its
own levels of abstraction can make it also very very difficult coding and rust is like playing chess and League at the same time okay I already love this article this article the fact that we just compared stardew Valley for Java and chess and League at the same time this is so good it is the same mental exertion and the same insufferable people yelling at you on the internet oh my gosh oh my the man the man is stuck in bronze hell is what I'm hearing rust is being stuck in bronze hell in League um the
semantics are cool I love how it borrows stuff from functional languages but I can I tell you a secret Java gets 75% of the way there with 10% the complexity rust is Elo hell rust is ELO hell okay air handling is definitely better than rust absolutely it's definitely better than rust but it is closer than most think the way erors get buried and propagated up the call stack can be confusing in complex programs it can be missed this is true I mean one thing that people forget about air handling and rust is that everybody uh
just just goes like this like they just hit question marks everywhere because it's so it's so dirt simple right it's just like Ah that's your problem you hand it and then you do that through your entire application and what ends up happening oh for those that don't okay we got a lot of question marks what the hell is these question marks so in Rust a question mark simply means it's the same thing as doing this uh try whatever your statements are catch uh with e return e right it's like the same thing that's what a
question mark effectively does is it's like catching your error at this point and then returning the error back out so it's like it's it's very it's it's like a very small way it's returning the fun it's it's returning at one level yeah Zig has the same thing with try right Zig has the exact same thing this is not this is not a critique of just rust alone this is also a critique as errors as values generally speaking and so what ends up happening is that you have a program that's 16 lines deep and 15 of
those 16 lines go like this question question question question question and then you Topline one up in Maine handles an error that's like a Json decoding error and you're just like and you have to like go all the way through your program and try to figure out how to properly do the thing you're supposed to do and I've seen this a lot I've seen this a decent amount of times and I myself have programmed this a decent amount of times and so that's the downfall of errors as values for anyone that's wondering but once you've
gone through that you typically write SS's values a bit better and you try to handle them as quickly as possible as opposed to just simply the convenience of the question mark operator that's why I've never had problem with goes if air equals nil is because as I've handled errors long enough what I realize is that you can't handle most errors with just a simple question mark or a simple try you actually need to have like there's like a lot you have to do you have to really think about this whole process pattern matching is better
in Rust but it is closer than most think Java records Java switch statements optional streams they're all basically makeup for the ois oop penis oenis of the language and are all plenty straightforward all the concurrent data structures in Java are much nicer to use than rust okay that's a fact of life Java's uh Java's concurrent hashmap is the greatest thing that has ever existed fight me on that one fight me on that one JavaScript concurrent hashmap is so good and concurrent list is so good hashmap good structure no fight why never used it oh my
gosh it is it is like the deao standard concurrent hashmap is how we made our livelihood concurrent hashmap is one of the best ever Cube thank you for that tier three you never even had to do that baby come on Cube you're getting into a YouTube video for that one thank you very much um learning rust is hard it could not be the language apcs is taught in uh the first skill Gap is the borrow Checker then lifetimes then async then macros and then you put async plus uh lifetimes together and then then it just
then it just then you have you know you have lifetimes in your TR and then just right uh the smallest first skill Gap the borrow Checker was about 10 times harder than learning uh about class uh Java classes for the first time about 3.5 harder uh harder than grocking monads I don't know if that's true I'd have to think about that I don't know I spent two hours the problem is is that one reason why I have a hard time with that statement in general is that you can't AB test that statement meaning that I
learned Java and classes were hard to learn recursion was hard to learn there was a lot of things that were hard to learn when I first learned how to program then I spent effectively 15 years programming then I tried to learn rust was rust hard or easy to learn I didn't think rust was all that bad to learn like if you don't read anything and you just try to use rust it's actually really difficult if you read the Rust book for about two hours and you have some level of programming experience you'll realize that just
single-threaded rust with no lifetimes with just clone right is actually incredibly simple like it it is actually incredibly simple it's not hard because the borrow Checker in its basicness is really really really simple uh I refuse to believe uh people actually have issues with the borrow Checker you lost me at Reed yeah okay that's fair that's fair the problem with the Bor Checker is that the code is not movable it is clear it is not clear from the code that something has been moved out no it is very very clear uh that just means you
don't know what's happening with rust I think that the code is very very simple to see if something is is moved or not moved circular references are still hard circular references are virtually impossible you have to use like this double you have to do this like whole double uh index data structure thing and it's it's it's not simple uh that's where rust breaks down is once you have to do anything that's useful rust really gets hard are lifetimes part of the borrow Checker if so the borrow Checker is hard well no I mean yes no
yes no the you're absolutely right life are lifetimes part of the borrow Checker if so the borrow Checker is hard yes lifetimes are hard due to the borrow Checker that's what I would say that's part of the borrow Checker requirement yes uh tree and Russ took me forever yes that's exactly it is that once you leave the realm of just like like if you build a a CLI application in Rust that all it does is read some input look up some files parse out those files and then do something with them maybe do some Json
and all that it's actually an incredibly nice language but the moment you have to do something that's longer lived lifetimes maybe produce your own macros all that it becomes a very difficult language it's about understanding the consequences that arise simple Behavior can lead to complex Behavior yeah fair fair fair and factual I can still barely write complex uh async rust and if I see or have to write a macro that is like hair let's see that's like a hair above the simplest examples I quit the editor honestly this is such Fair critiquing I think that
this is really fair critiquing with which is that writing really complex acing stuff is very very hard and often you need to use macros like you know when you go like when people say oh using rust for a web app is simple you're like yeah you're right because all I do is I go there and I use like axom uh I use axom I look at axom and axom looks really really easy to use right it's just like ah you just go in here I have a little main statement I have like a little hello
world and it's like bada bing bada boom it's that simple but what goes into making this work is mindbending it is like absolutely mind-bending and yes they're even cheating right here sort of right they they've made it very very simple uh but I'm just saying that when someone says it is simple it's not that good okay so right now they arguments are the following uh that rust has a lot of mental overhead which I don't actually disagree with I think rust has a lot of mental overhead but I think the ease I think the thing
is is that there's two different types of mental overhead Java has a different type of mental overhead than rust Java so Java's mental overhead is proportional to the amount of abstraction so as as as as abstraction goes up overhead goes up right so it's like that maybe it's even nonlinear I have no idea maybe it's logarithmic or uh just like really small exponential I don't know it's hard to say whereas with rust it's more like features is what makes it confusing if you use uh just simple single-threaded clone rust it's easy if you use single-threaded
lifetimes it's not all that bad if you use async clone it's not all that bad if you use async you know clone lifetime things start to get difficult if you use async clone lifetime traits right like each one it's like this is actually pretty simple this is ah you know it's a little hard but you get it this is about this can get a little bit harder ouch and then it's just like it never actually reaches this point right and then we haven't got to macros right we haven't got to the final boss of Mac
macros right and when you get to macros you're actually like swirling in on yourself you're tearing your ACL at that point and notice that I drew absolutely no dicks it's crazy but a equals D all right I would say that uh I'd say the most cluster abstract class inheritance system designed in Java would not even approach the most complex rust design system I don't think he's wrong on that one I'm actually having a hard time trying to like argue against it like the thing is is that to be completely Fair a bunch of abstract inheritance
system design in Java makes me unhappy in a deep part of my soul right both both are true mess yes it it makes me 20% uh it makes me not 20% sorry I just read this the 20% pay it actually just makes me deeply unhappy in my soul and really complex rust is more just I get frustrated than I do get like deeply unhappy so I I I'm not sure which one I'd rather work in the problem I see about rust is the moment you change say one lifetime you have an entire application you have
to refactor and that's a real problem when it comes to these complex larger applications like you want to add a single reference to a string a stir like there goes all refactor refactor baby it's refactor time it's uncomfortable but not hard I would argue that it's hard rust is genuinely hard when you get to a a a real a real point at at some real point it goes from like like I said this is why I said like single threaded single-threaded clone and single threaded lifetimes they're really like not all that hard like yeah you
have to learn about lifetimes it's like it's not that big of a deal there's some things that could make it hard there's definitely like a small step function maybe in here but it's like okay it's still in the order of simple I would say simple but takes time but once you kind of start like applying the other things such as macros or uh traits and lifetimes and async and all that stuff it's like the step function just becomes increasingly larger right and it becomes super super difficult to really reason about whereas the Java way the
it's a runtime mess right these are different this is a compile time mess this is a runtime mess and maybe that's like a personality difference but a runtime mess the nice part about a runtime mess is you only need to understand a very small portion and you can kind of unfuck a a runtime mess but when you get into the compile time mess you can't really unfuck it cuz that's like that's what performance requires you can't unper performance that if you've seen performance-based rust it is really really hard it's really really hard it makes you
handle your concurrency UPF front rather than having everything is written which is nice yeah Fair I'd say fair it it makes you at least at least it makes you all possible issues are upfront and in your face yes oh yes there is there's yes I'm not I'm not uh dumb that uh Java definitely has some complex aspects to it I also hate the skill issue argument like how you know what the ultimate skill issue is you not knowing C well enough to make memory uh safe code forgety you're not going to complete Roller Coaster Tycoon
and writing some plain x86 assembly absolutely right like I mean it is true the skill issue argument does get a little bit annoying in the upper bounds I think that there's a lot to that that is absolutely correct that the upper bounds argument no longer becomes issues of just skill it's like experts arguing Who is the most expert and Roller Coaster Tycoon is a great example like there are people there's somebody that could write Roller Coaster Tycoon in assembly and you're not that person you're just not you're not that person how old is this article
my guess is that this article is six months old the whole point of the language is to be easy basically the go philosophy which I do like more than Java these days although it does not have functional stuff I want Go's functional nature is not all that great you can definitely use it but it's not as nice as rust but they do have ranges now you can r over objects and I think it's probably right but the abstraction level of the range in 1.22 is just really ugly and it doesn't feel very go and reading
it is just super difficult because it requires a function that returns a function that takes in a function so you got a function I'm a function plane a function disguise is another function right it's very difficult like the whole point of highle languages is to never encounter such skill issues it is to write working code AS F let's see fast and in a maintainable way naturally you would want this to be easy this is where Java gets it right in Rust gets it wrong and what I mean by that is that Java has always tried
to be one thing pretty much it's an application language it's an app L it tries to be an app Ling that's all it's trying to be go got this wrong to begin with because go tried to be a systems level programming language to begin with it's not a system level programming language it's not it's a it's like a networking web programming language where it's actually really good at right it's like it's it's it's actually really good at that Java got it right right away rust did not get it right right away like rust did not
get it right because rust unfortunately goes we're a system programming language okay this is true this is good I would agree with this we're also an application language maybe we're also a tool language okay we're all the things language and this is where rust really fails I think rust wins rust starts losing generally where I think and I think tools can be also in here as well I think you are right that someone says it rust is great for tools depends on the tools but potentially I think you're I think you're right understated take on
Rust I think just rust got it wrong and I don't think rust itself got it wrong I think the community got it wrong because once you touch those hindley Milner types oh my gosh I do agree Henley Milner types are so good oh my gosh I want them for everything and oh man if you can just use macros you can really make it useful for everything like for everything right and that's what's so hard that's the problem is rust can be good for everything o camel unfortunately functional programming will never take off in the mainstream
at least I don't think functional programming will ever take off and it's sad it really is sad cuz I think functional programming could be really cool and everyone that does functional programming really actually likes functional programming I just don't think it's going to take off I just don't now here are some cheap easy arguments more people know Java and more jobs need Java tooling is is better for Java and the ecosystem is more developed okay so I actually think that this statement right here is just fundamentally incorrect I do not think that the tooling Java
versus rust tooling is just not is just not the same right truly a Miss on this one this this actually was a really great argument in fact I would say that this was a perfect argument against rust up until this part skipped one this one is just a goof oh I skipped one okay all right let me here hold on let me read this sorry I skipped one I skipped one I skipped one it is so easy to write good Java with a few guidelines it dup duplicate one uh to 2x before abstraction no inheritance
unless you are sure which by the way that means you should just never do inheritance especially no more than one layer deep good good advice use optional over no absolutely do not get cute with your abstractions Java is so uh so easy people feel the need to make it hard doing oop gymnastics to build an elegant systems yeah I mean the exact same thing's true with JavaScript too right so that that critique I think is a great critique in the sense that you could make idental identical arguments in pretty much every language that's simple cuz
one of the Java javascript's biggest downfalls is the fact that you like can Curry into a class into like you can generate a class from a cur like you you've seen this right you've seen where people generate just the craziest code and it all has to do with the fact that you can do it in JavaScript and the same thing with Java you can go pretty deep with Java even though you shouldn't I love curring curring is great but curring is also the devil curring is absolutely great during uh writing absolutely awful for debugging cuz
discovering where some of your things got curried at can be such a nightmare like curring is great to write though curring is great we can all agree curring is just absolutely fantastic right now some cheap easy arguments more let's see hold on more people know Java and more jobs need Java this is a great argument tooling is uh better for Java and the ecosystem is more developed ecosystem may be more developed Fair T link not there the fact that I don't know how to set up my Vim in to be able to run Java is
example we don't know it's just awful it's just honestly it's just awful I absolutely love Jeet brain's idea Jeet brains is also fantastic and no amount of loser Lua neovim don't come after me I use neovim for C Zig and other low-level languages uh config for rust will match ID support let's see okay um also if the prime is reading this Luis sucks don't add me it's it is never enjoyable to write imagine liking the language I I used to code roblock hacks when I was 9 years old what is this who did this to
me who did this to me who actually did this to me this is so this is so much BS first off Lua is not a bad language okay okay don't even try that with me you it's hard to create a mess with Lua like you can in JavaScript okay so as far as an embeddable Dynamic language Lua is fantastic and I do okay I agree I agree that you can never Neo will never be as great as idea okay idea is lit or or uh jet brains is is a multi bajoran dollar company that has
what 10020 developers working on it fulltime but I will say I'm going to say something that's actually really uh impressive I did get my name spell right let's go let's go let's go oh yeah baby oh I feel so good I feel so good right now I was I'm no longer in shambles I'm back in okay we're back in I'm going to admit maybe I just don't know rust enough I think if you think the tooling is better I I I'm just so I think I think what I I read here is that he's mistaking
the word tooling for idea and I do agree jet brains is great jet brains is unimaginably a great IDE if I were to not use neovim I would use Jeet Rings okay absolutely uh I I I I I typically am in the neovim is greater than intellig which is greater than vs code kind of Camp that's typically where I'm at uh if I had the right uh if I had yes cargo is greater than Gradle hands down unironically fully absolutely if I had to use something for zig I would likely choose neovim as I am
now if I had to do something for rust I'd probably just choose neovim if I had if I had to debug a 2 million line project when it comes to when it comes to rust I would probably choose intell and try to debug that because at least I'd get really great support for debugging right why don't you let's see why don't you use jet brains then because I generally don't have any I just don't I don't like I don't have any reason to use jet brains right you can use cotlin as Gradle replacement now okay
that still doesn't sound great to me um okay if I'm going to admit it maybe I just don't know rust enough but I promise I have coded more rust than most of you have and I probably know it better than the average self-proclaimed rust Enthusiast and yet if I had to write a big grug business logic project you would see me reaching for Java before rust I'm having a hard time with with this one I don't know I don't know if I'd choose Java like I I really don't think I could choose Java ethically okay
cuz I CU you know what it doesn't matter that sure sure Java's learning curve is like that okay sure it's easier Russ learning curve is like you know that okay I get it you would never do that but could I ethically choose Java right could I inflict the pain of Java for years to come on somebody or should I inflate the pain of blue hair and lifetimes on somebody okay which one do I choose if I had to choose it's it's it's a hard choice but I feel like I'd have to choose the blue hair
in lifetimes over the Java okay the correct answer is to use go well that's not the option we don't have the option here okay that's not we don't have the option getting paid for easy stuff is what Java is Java stuff yeah Elixir please I've never done Elixir so I can't actually say that that Elixir is is great I know Ryan Winchester's in shambles right now the final thing about Russ that is not even particularly elegant is nice to look at really isn't there like a ton of symbols in hll APL bqn UI UA is
nice to look at when I want to puzzle I write in those languages because I admire the mathematical abstraction rust is marred with the compiler marred with low-level BS that makes it ugly that does not make it satisfying in this way if you love language design or the beauty in programming languages rust is not even good at that it's not beautiful it is not as useful as people Proclaim and it occupies such a small use case that the language is mid I don't find Rust ugly uh even when I do systems programming like lowle stuff
I want to manage my own me let's see I just want to manage my own memory I do not want to beg the compiler to let me write code I just want to allocate stuff and put it into there C is fine for this I'll try Zig later I think Zig is actually an absolutely fantastic systems level language again I've been saying this for a little bit now that I've actually used it a little bit I will say that the one thing that's amazing about Zig is that it has null protection which is good but
you can interrupt really easily with code and then you can say hey this thing can be null like you just have all these ways to make things nice and it it's simple but I will say that zigg fundamentally is I think Zig is more ugly overall than rust I just don't think Zig is that pretty of a language I find it like there's things I hate Zig is fine it's not ugly I there's things that I just hate about it right uh like I hate the fact I know this is such a trivial thing to
hate but I hate the fact that I have to surround my booing logic with with parentheses I know hey we're talking about ugly beauty is in the eye of the beholder here okay this is eye of the beholder okay you can't you you can't judge me don't judge me I love that give me all the parentheses I can I would say that this is fantastic being able to do slices treating C pointers or like C arrays with a length is just beautiful and then being able to instead of doing pointer arithmetic slicing into it to
let it do the own uh pointer arithmetic beautiful like I I do think that that is beautiful uh I think capture groups are interesting right so for those that don't know what capture groups are um this right here is a nulli meaning that this thing could be null it might be null you don't know if it's null and so if you do this you then have to capture it and capture like I like the concept of capture groups yeah I know I'm on your team capture groups are great uh ipis uh but I don't know
if I like the looks of them right again this is me I'm just saying this is me this is beauty okay this is beauty just let me have my own Beauty here okay anything else that I don't like about it I don't know if there's anything else that I really don't like about I think everything else is pretty much just fine uh I don't like the fact that if you go like this like you can't like you have to use a constant or you have to use a variable or you have to explicitly assign it
to the underscore like sometimes I just want to like underscore a variable cuz I know I'm going to use it in a little bit like I find that just annoying I find that the fact that they treat warnings as errors can be sometimes frustrating you know what I mean uh I'm not saying rust is always bad it has a small but limited number of use cases again I think uh systems level if you're worried about that but I think Zig is winning in the systems department and I think tools and I'd be surprised if go
doesn't win in the tool department but maybe maybe I could be I could be proved wrong I'm glad to be proved wrong it's just all comes down to to convenience and how large you can make a project because you know the problem is is that a lot of us are arguing whether or not rust is good or bad or these things are good and bad and it goes down to um us making judgments about languages that are made in a project of 2,000 lines or less like right now I'm at 4,000 lines of Zig and
I'm starting to say okay this is what I'm seeing about Zig and I like the way it scales right in Cloud rust is good uh for faster than go yes but the thing is is that you're not writing faster than go go rust like I hate to tell you this you're not doing it you're not doing it well you're not going to do it well right yes rust is good for uh code predictability and safety this is much this is much more reasonable of an argument right you're not that guy pal you're not that guy
like I hate to tell you this but you just did an arc mutex on a hashmap okay you're not the guy you're Arc mutex in your hashmap sorry bud sorry for example I wrote a bot that helped buy things rather quickly in 2020 to 2021 provided I was a to do the sum of the captas I needed I needed it to be performant robust and the scope wait hold on is he admitting is hold on are we admitting to buying graphics cards faster than everybody else is he is he admitting to being a scalper are
we admitting to scalping scalper admitted here boo this man okay police get the police on here okay maybe he's not talking about that maybe maybe he's not buying that let's just pretend that whatever's going on he's actually just buying anime waifu pillows okay he could just be a crypt Miner he's just buying hey he's just buying anime waifu pillows okay provided I was awake to do some of the captas I needed it to be performant robust and the scope was just uh simple enough even though it was async where I knew I would not need
a lot of code but a mediocre amount it occupied the space just before the complexity curve went uh as Asm totic the other the other use case is for writing toy languages it does super well uh and it's best let's see at its best it feels like using a CNC mill to machine a precise gear like sorry I don't touch grass honestly I don't even know what that means like I don't I don't know what that means honestly both times you need an injection mold and some plastic but most times you need an inject y
again I it's hard for me to understand this but yeah shop lingo not get me p ps check out Buzz implementation I did in Java I have not found a similar solution in Java anywhere on the internet it shows the power of modern Java it's actually shockingly uh Rusty right except for you can't do a range I'd love to see a range instead of a an integer yeah so this is just stream this thing map to object entry set stream I'm not sure what uh these these must be like your uh what's it called your
PR I I don't know what a predicate engine integer is but I assume it just means that if these two things equal then yeah I mean this just seems again this is kind of like that whole Java thing you know how Java is just so effing confusing yeah it takes an in returns a pool yeah that makes sense okay it takes an INT and it returns a pool but still like there's just this is just so very Java like you have to know all the Java things to really get this this makes sense right filter
you have an entry you get the key you test the X coming into it you're closing over the X right here right uh you map the G value you reduce a string Con cat uh or else one of these values of X okay I think I see what's happening this makes sense so you take all of your predicates which is going to be this you're going to filter over all of them which could which is going to produce a set of zero or more you're then going to map over those and get the uh value
out of the entry meaning you're going to get Fizz or Buzz you're going to concat all those strings so it makes literally like fizz Buzz with no separator and then if if it's empty or there's no or yeah the iterator itself is empty then you'll simply do the string value of x then at the end of that you just join all of those with an with a space which by the way it should be a new line okay for for Fizz buzzing correctly it should be a new line procedural is just so much easier and
faster generally speaking Yeah I I agree I agree with that I think that this is there's a lot of mental overhead here I think this actually highlights one of the points that I've disliked generally about a lot of modern programming is that I'm not sure if this is actually any easier than procedural I don't think this is any easier to read like I I really I mean I think it's really easy to mutate I think that if you wanted to add another like another another monatic operation on top of your sweet map right these are
monads right do I even understand monads do I even understand monads that you're able to abstract and like add in say you could add one to it you could do something very easy to it agreed but I find that it's also just really there's a lot of thought that you have to think you have to walk through each step just more right it looks like the Builder pattern I'm a newbie it looks like the Builder pattern yeah that that's a good way to think of it it's kind of like a builder pattern in a in
a sense one could argue that a that uh iterator operations is kind of like a builder pattern why do we use classes for interview coding I don't know it's a let's say or a builder pattern of functions it's just a good way to think about it function calls are expensive we just don't care anymore because modern CPUs are fast that's fair I mean generally speaking you should not be caring about your function uh about the amount of function calls you're making generally speaking that's just probably not going to be your level of programming now there
is some people who are doing real programming that actually have to be concerned about function calls I've been there once by accident uh when I was doing a supercomputer research project uh I found that a getter one of my Getters was slowing down the supercomputers like a ability to execute like 100x because I had this getter everywhere and it was old Java before they optimized Getters so the uh the optimized getter was not being being executed and it would actually just actually do a function call to get out of value and it was doing that
constant time like all the time and it was littered throughout the program and so when you're making literally a thousand extra function calls on every iteration you're making trillions of iterations it makes a huge difference so I literally just made it public instantaneous like 100x speed up and this was again Java 1.5 so this is a long time ago right this is a this is a long long time ago can Java inline function calls I'm sure can it this Point that's like a classic optimization for an interpreted language and Java in some sense is an
interpreted language yeah modern jvm should take care of those cases absolutely modern jvm does all that but back then that was not a thing I work in scientific Computing with HBC we deal with a lot of this good programming and abstraction tend to be very expensive yes it does it's very very expensive if you're doing something that requires a lot of execution but most of us don't do something that's executing super super fast right like even my uh even even like my game engine that runs at it runs at like what 15x realtime speed 100x
real time speed some outstanding amount of real-time speed uh Improvement even that I doing I'm doing things I intentionally know are very very inappropriate like one thing that I'm doing that's just just absolutely ridiculous is that my game State object I never deallocate uh a list item I just keep adding to the list and when I do update I call through the entire list and if any of them are dead I I just skip it like it is intentionally bad absolutely intentionally bad but this thing still runs vastly faster I do want to improve this
I have an idea effectively what I'm going to do is I'm going to turn this from a tower list creep list projectile list and I want to do just a a simple comp time um what's it called pool uh turn it into a pool where if two values are if it's dead dead then I will be able to say okay this thing is dead and so I'll have a function call that's expected via comp time called dead and if it can be called as dead that it will be called as dead I think it's a
pretty good idea do you just describe pooling I literally just describe pooling yeah that's why I said I'm going to do it as a pooling right it's just an object Pooler built in uh Zig and I now feel able to write that code whereas if you would have asked me a month ago to write that code I couldn't do it Colin D nuts absolutely and by the way I did see this comments uh where are you I know his prime ignores any of my comments with Colin no I am not ignoring your comment I'm reading
your comment and then ignoring it because you can cotlin these nuts all right well let's go back to this article on how's crowd strike doing oh my gosh it's going way up PS please write your applications and go instead of java otherwise you might get brainwashed by ARX Java if this happens no cure can be found okay I like this guy again this guy's absolutely dude this guy's absolutely absolutely based absolutely based uh RX Java is a curse RX itself is generally a curse go over java absolutely code girl absolutely I generally agree with the
statement I think that most things aren't that complicated and your type system does not need to be as complicated as you think it should be I real talk I think most of you don't write complicated enough code I know I mean I know I know you want your code to be complicated enough to need uh a hendley Milner system it just doesn't most of the time you write really simple code you have like a buffer you have some data you have like five objects you have a couple function calls that go out to a remote
server and have some sort of database that you're putting stuff into right like it's it's it's really not that complicated and what I mean by that is that even this thing right here which actually has an entire system that is designed for like Huffman and coding and testing and doing all this stuff and all of this good stuff even this as simple and or as as as much as it is this stuff is dirt simple to do and I don't need a fancy type system I really don't need a fancy type system and this thing
this Huffman is actually doing a bite writer that could write at different bite widths right The Stride is programmable and even this is simple to do right I think a lot of people overestimate that they need complicated types but I will say this I will say this that if you're using go this could be a this could actually be a great short if you want to defeat go all you have to do is create an array of an integer and then a string go type system defeated you want to defeat python all you have to
do create a for Loop you want to defeat JavaScript just use react it's a good one by the way very happy about it I'm very I'm very happy about that I'm very happy about it not funny dude it's but it's so correct defeating go with a a heterogeneous type list is just like the the the most awful thing in the universe tell me tell me that's not true by the way every time I make fun of JavaScript and react so many people's feelings get hurt and the reason why is that in short form content I
have a theory that in short form content the amount of people that watch shorts that are inexperienced versus experienced it vastly disproportionately goes into inexperience than it does experience people and so when you say something about react they go why you make fun of react and then they get really angry you know kind of makes sense I think it just generally makes sense uh what you call an overlab vend diagram yeah yeah based yeah free real estate absolutely free real estate I'm in here just crushing some good real estate here uh anyways uh but for
those that are saying I can just do an interface an interface array dude come on we all know that that sucks come on can we can we agree that that sucks runtime reflection is just super annoying no a list of interface no that's not life that's not life it's not good life it's not a good life okay is isn't that just a v box of Dy tee effectively that's vebox D interface is effectively that Zig does get one thing right about that is that it it does at least do compile time generation of functions which
is pretty cool void oh my gosh no no we will not do we will not do what what is this do I have this correctly that this is a a function that returns a void pointer that takes in a void pointer is this a pointer to a function that takes in a am I correct on that it's a pointer to a function that that returns a void pointer that takes in a void pointer or an any opeg as they call it in Zig that's how you do it any opeg I I missed the thing I
forgot you type my name what's the point nobody knows void pointer needs to do uh needs to to do in a fire wait what oh die in a fire uh void pointers don't need to die in a fire void pointers make perfect sense like sometimes you just have memory and you don't know what the hell it is you're just given a length a length plus a pointer like what's the problem with that I don't think that's a problem I honestly don't think that's a problem like sometimes you don't even need to know right like you
actually don't need to know what's in the memory isn't that just a point no no no a pointer is just uh an array like an address a fat pointer is a length and an address right I I like fat pointers fat pointers make perfect sense because then at least you know not only are you pointed here but you know how big that thing is like that's great avoid double star now that okay now that on the other hand that's bad your pointer is so fat dude damn you really think so who whoa it's not it
wasn't me saying that my pointer was fat okay hey hey I received a compliment and I ran with it okay I don't think you can come over here and tell me how to live my life okay you know why Karen cuz the name it's the fat pointer aen