So I finally listened to you faggots and checked out Rust. Lemme run y'all through what happened while I was reading through the docs...
>"Hello world!" Seems pretty standard, dunno what the deal is with the bang after the print statement, but whatever... >So there are these things called macros Ah, so that's what the bangs are for! That's actually a pretty neat idea, though I don't think a function call is exactly the biggest of slowdowns >Structs, tuples, and enums Yeah, I'm a Java dev at heart, so I don't really know much about structs, and the enums look different, but I know tuples and I can learn about structs. They honestly can't be that bad. I wonder where the classes documentation is... >There are no classes Okay what. I mean, structs kinda serve the same purpose. I don't really want to do bastardized class creation a la javascript. How do you even extend and implement a hierarchy? >You have to jump through your own asshole to implement class hierarchy *Closes documentation and cancels pacman from installing the compiler* Congrats! Your "language of the future" has taken one step forward and two steps back! If I'm going to learn something that compiles down to machine code, I'm gonna learn C++. At least that has actual an object oriented paradigm that doesn't smoke copious amounts of meth. It even has the side effect of being an employable skill! Good job Mozilla, you made yet another pants on head retarded language.
So what should I be using for default implementations of classes? I could extend abstract classes in C++ or implement interfaces in Java to allow for different blocks of code to accomplish one thing (see: databases and using an SQL server or Flatfile or SQLite or a relational database). Why would a modern programming language actively try to prevent me from doing that?
Levi Ward
>So what should I be using for default implementations of classes A trait.
Jace Foster
C++ fag here. Please don't bring your horrid Java style of writing programs to our language. There is a telltale sign that a Java programmer has visited your C++ codebase: everything is a class and the new keyword gets spammed everywhere, sometimes without an accompanying delete. The Java programmer will not learn what a smart pointer is, nor will they learn about stack allocation. They will not learn when it is appropriate to pass something by reference and when it should be passed by value. They will always use a class, even when a procedure/function would be more appropriate. Everything is a pointer, even if it's only an 8 byte POD type.
Rust actually has some useful features, and not having to maintain C source compatibility has led it to being more fun than C++ in some senses. In others, it's a pain in the ass, but the language is young and still changing. Structs are a good thing. They're the same kind of shit you get in C, but with uniform function call syntax to avoid lots of nested parentheses in function composition.
And yes, functions are how you should be thinking about everything. You don't have to go full monad and trying to figure out how to make everything immutable just because, but you should recognize that fundamentally, rather than being some make believe world full of objects talking to each other, everything in a program is just a series of data transformations. The basic unit of abstraction, which transforms data from one form to another, is the function.
Justin Morgan
Hey, thanks for the information! Everything I read basically boiled down to "You don't need hierarchies, even if you do" so it seemed like a worthless endeavor to try and learn a language that can't do everything I want it to do. If its actively being worked on, then I'll check back in about six months time and see how things are moving along.
Also, I read the Wikipedia article on ECS. I thought that was the standard video game development pattern? What would be another way to go about doing something similar without creating an ECS pattern?
Carson White
I like the way your write.
Caleb Perry
Yes, it definitely is. Not having subclasses means bashing it into one type by either a custom enum or tons of Option fields which, contrary to what Rust fags will tell you, does not make your code better, but makes it much worse.
William Diaz
>Bashing it into one type C does not have inheritance at all and this is not standard practice. Stop thinking like a Java programmer. You were taught bad practices.
Thomas Mitchell
>There are no classes
classes suck dick. oop sucks dick, for the most part.
you can have abstraction without classes. and you can do it without having EVERYTHING be a hierarchy. Its ok to have functions that just do things. Its ok to have objects that dont need a metric ton of boilerplate to instantiate. It's ok to write procedural code.
I don't even fucking write rust, but Java can fuck your brain up so bad, you just walk around like a damn zombie mumbling 'design patterns' everywhere you go.
Caleb Cruz
>Please don't bring your horrid Java style of writing programs to our language Wasn't planning on it. I understand the reasons for using a struct as a POD type instead of a class (in fact, this is one of the things I really dislike about Java). I don't know enough about pointers and references to know how to use them intelligently (I am a Java brainlet, you know...), so I'm content leaving it to the segfault pros.
I wanted to learn Rust because, from what I've heard, it compiles down to machine code safely, without forcing the dev to use pointers and references like a m̶a̶d̶ ̶s̶c̶i̶e̶n̶t̶i̶s̶t̶ C dev.
Adrian Nelson
>C does not have inheritance at all Hence why C++ exists...
Brandon Foster
>classes suck dick. oop sucks dick, for the most part. Yeah, that must be why everyone has moved on to OOP over the last 15 years... >I don't even fucking write rust, but Java can fuck your brain up so bad, you just walk around like a damn zombie mumbling 'design patterns' everywhere you go. Pic related
Hunter Johnson
I've written programs in every programming language under the sun. Stop being so euphoric. Look how html5ever handles nodes
now imagine a subset of each required common fields and functions, welcome to hell. Yes you can hack your way around it, but it will never be better than a sane use of OOP.
Nice monopoly OOP's got there. It's not 2001 anymore, java is for cucks. The only reason its still around is because all the enterprise shit is already Java or .NET Even android devs are switching to Kotlin because Java is a fucking nightmare.
Gavin Wilson
>lists a bunch of the top tech companies >lists nothing but OOP languages they use >Somehow OOP is bad 2/10, maybe next time?
Joseph Peterson
>walmart - js / node walmart has 200 java job offers on indeed and 100 javascript ones >twitter - golang, java twitter's go codebase size is probably like 10% of the size of their java/scala codebase >facebook - python, hack / php, erlang, c++ they use java just as much as they use python, php/hack and c++ >digital ocean - golang 6 job offers for go, 5 for java+scala >bitbucket - golang atlassian has 51 offers for java/scala and 37 offers for go
>Even android devs are switching to Kotlin because Java is a fucking nightmare. but Kotlin is still OOP
Gabriel Lewis
Unfortunately, Rust is not a beginner language. In my experience, I've seen people with decades of experience in Java struggling in Rust. I have been working with C++, JS and python and it took me 6-7 months to really grasp Rust. And yet I have issues with the simplest of the things.
My understanding is that Rust is geared towards experienced programmers. It's a really nice language. However, unless you have undergone the pain and suffering of C++, you will never be able to appreciate Rust, because it would feel as if Rust imposes unnecessary hindrance to your workflow.
Juan James
>you faggots Nobody here actually use this crap these threads are made by trolls and shills.
Landon White
>I have issues with the simplest of things This seems like a negative for the language overall. Why would I want to be hindered at every turn by a new language that no jobs exist for? I understand that it does some stuff better than C/C++, but come on...
Ethan Russell
I am hindered because I am very used to OOP style program designing. However Rust really makes up for it with its standard project/package management system.
Jaxon Green
I see what you're saying, it just seems weird to me that someone would make a language designed to be the best in its class (hue) but not allow for the paradigm that the industry has been using for the last 15 years.
Adrian Brooks
>I can't learn anything that isn't OOP op is a faggot Traits are interfaces except a million times more ergonomic, you're just retarded
Hunter Thompson
Java is readable and sane. No idea why anyone would use fucking Kotlin.
Mason Rodriguez
>OOP babby needs classes or else he is lost Use C like the big boys
Noah Robinson
No point using C when you could use C++.
Kayden Mitchell
Object Oriented programming is a meme used to sell books.
Have fun fucking yourself and your performance over with garbage ideas like inheritance and encapsulation.
Samuel Nelson
>encapsulation >costing anything
Kayden Watson
Kotlin has some nice little things here and there, but in the end of the day Java is perfectly fine if you have actual deadlines. These minor quality of life improvements matter a lot only to autistic nitpickers who likes to feel like a programmer but doesn't actually write anything serious. Of course things like extension functions, range expressions, string templates, companion objects etc. are all very nice to have, but they're not essential. So yeah, "Java a shit, Kotlin is great" is bullshit. Same with the language features that C# has and Java doesn't, but that point is kinda moot now anyway since Kotlin is even nicer than C#.
it's a meme that powers the software that in turn powers the modern world. you can shit on """enterprise"" all you want, but that doesn't change the fact that there's over 9000 bazillion lines of hardcore oop code running in finance and banking in this very moment