[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 1782174515495955.png (363 KB, 629x640)
363 KB PNG
How the fuck did this heaping pile of shit ever take off? Every single line you write feels like scratching your nails on concrete. EVERYTHING has to be painfully retarded.
>forced snake case (compiler gives you a warning if you use pascal case)
for num in nums { } //this destroys the array nums

for i in 0..1 { println!("{}", i); } //prints out 0. just 0.

>println! is a macro for some reason (whatever that means), the syntax is fucking cancer
>no you can't print an array because it has no "view window" or whatever the fuck. you have to write
println!("{:?}, nums);
every time
>have to end each line with ; in 2026. Every new language has figured out how to remove these stupid shits. not rust.
>STOP! YOU CAN'T INDEX AN ARRAY WITH AN INT, BECAUSE INTS ARE SIGNED. YOU HAVE TO CAST THEM TO usize EVERY TIME, TO PREVENT NEGATIVE INDEXES FROM CRASHING.
>but you can still crash if your index is out of bounds, and casting a negative int to unsigned guarantees you're out of bounds.
>No implicit type casting. anywhere. enjoy slopping your code with "as usize" every other line
>no implicit self in "structs" (totally not classes btw) methods. enjoy writing "self.doshit" every other line
>no initializers. instead you have to rely on someone else's dogshit code to write a ::new() method (totally not an initializer btw). Oh but there's deinitializers!
>no inheritance. it's replaced with 'composition' which is just inheritance. but instead of accessing v.z, you have to write v.w.x.y.z!
>language has no data types built in. you have to import everything. even dictionaries.
>enjoy padding every file with 100 lines of imports like use std::collections::HashMap
>can't access a dictionary using an index. you have to use HashMap.insert or HashMap.get
>no built in min / max functions. enjoy importing those too.
>"Vector" (totally not an array, pls don't call it that)
>>
File: 1782792146694931.png (109 KB, 285x322)
109 KB PNG
>hmm... i32, i64, u8... I bet strings are called str!
>no lol, str is a useless type. literally impossible to work with. you have to convert it using
String::from(str);
:^)
>want to initialize a set? here you go bro:
let mut hash_set: HashSet<i64> = std::collections::HashSet::<i64>::new();
, have fun writing that every time
>Sorry chud, optionals are ENUMS because.. they just are ok??? You HAVE to use switch statements to unwrap optionals every time. It's the rustacean way!
>btw here's .unwrap() lol. don't use it ok? pls don't use it!!!
>want to reverse a linked list?
>1. don't
>2. read this 30 page whitepaper to figure out how
>want an object to live on the heap instead of stack? wrap it in a Box<>! this is totally not a class, PLEASE DON'T CALL IT THAT. no classes in this language btw, that's unsafe!
>>
>>109685376
Rust's real blessing is replacing segfaults with out of bounds errors.
>>
>>109685367
It is pretty annoyingly verbose, at least for what I tried to use it for (mainly advent of code regex exercises)
I'm sure there's use cases where it can be fun to write in
>>
File: calendar.png (3.16 MB, 9779x3472)
3.16 MB PNG
>>109685544
wrong
>>
>>109685633
all of this shit is unreadable
>>
>>109685392
Ada did this 30 years prior.
They should have taken Ada and Spark as a starting point, brought it up to date, improved the ergonomics, a bit less verbose, etc.
Called it Ada on Acid, (and Spark on Speed) and it would have been godly.
>>
File: calendar.jpg (3.92 MB, 7997x4450)
3.92 MB JPG
>>109685638
wrong
>>
>>109685643
literally all unreadable. you couldn't have used 128 instead of 0x80? good thing you're unemployed and you'll never touch a production codebase, imagine having to clean up after you.
>>
File: calendar_small.jpg (3.99 MB, 7907x5941)
3.99 MB JPG
>>109685648
wrong again
>you couldn't have used 128 instead of 0x80?
no
>>
>>109685376
Where is the problem with
let mut hash_set: HashSet<i64> = std::collections::HashSet::<i64>::new();
tho? I dont even think you have to type
: HashSet<i64>
because the compiler can resolve it from the statement anyways, but other than that, you define a hash_set mutable variable and you initialize it using the library function. You could write use std::collections if it bothers you that much
>>
>>109686455
>he took the bait
>>
>>109685633
>>109685651
>>109685643
>Advent of Unemployed
AI killed this cringefest kek.
>>
File: posteditagain.png (30 KB, 600x600)
30 KB PNG
>>109685367
Didn't we discuss this retard infested thread the other week?
>>
File: 524 stars.png (99 KB, 830x1105)
99 KB PNG
>>109687866
>>
>>109685642
>Ada did this 30 years prior.
The other way around. Ada literally got lifetimes inspired by Rust.

>Ada and Spark
Tell me you have never used Ada Spark for general software development without telling me you have never used Ada Spark for general software development.
>>
>>109685367
Rust is but a cog in a long chain of trying to make users into programmers, it's a continuation of visual basic's lineage.

But hopefully it will disintegrate like its own name implies.
>>
>>109685367
L/g/BT won't have mercy on your thread, OP
I hope you are ready
>>
I still want to learn it and become a data engineer
>>
>>109685367
>forced snake case
Different languages have different conventions that you should use.
>//this destroys the array nums
.as_ref
>prints out 0. just 0.
0..=1 is inclusive, 0..1 is exclusive (equivalent to int i = 0; i < 1; i++)
>println! is a macro
So? It still works fine.
>you can't print an array
You literally showed how to do it.
>have to end each line with ;
Based and C pilled.
>out of bounds
Just... write good code?
>No implicit type casting
Just cast it.
>no implicit self
Not unique to Rust.
>totally not classes btw
Gotta tard wrangle the OOP deniers into becoming OOP chads, anon.
>no initializers
You can literally write your own new method...
>no inheritance
Good.
>replaced with 'composition'
Good OOP devs already prefer composition in languages that have inheritance.
>no data types built in
It has primitives, strings, enums and structs.
>you have to import everything
ctrl+space -> enter -> gg
>can't access a dictionary using an index
*key
>HashMap.get
And what do you pass to the get method?
>Vector
The difference is that it's heavier. You can choose to use the actual array type.

TL;DR 0/10 bait, only clicked the thread because of Frieren
>>
>>109688698
>he took the bait
>>
File: 1703517767818152.png (231 KB, 480x480)
231 KB PNG
>>109688735
>>
>>109688967
>tranime
>retarded
pick two
>>
>>109685367
Is rust worth it to get into
>>
just make it in zig, then have AI convert it to crust

don't ask me how I came up with this gambit
>>
rust is a shit language and its popularity started as an outgrowth of terminally online tranime faggot functional programming homunculi subculture. now its usage is being supercharged by ai slop machines because you don't actually have to look at the eye-burning code.
>>
>>109685367
>//this destroys the array nums
Retarded codemonkey learns about linear logic for the first time



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.