[ home / overboard ] [ soy / qa / mtv / dem ] [ int / pol ] [ a / asp / biz / fit / k / r9k / sude / tech / tv / v / x ] [ q / news / chive / rules / pass / bans ] [ wiki / booru / irc ]

A banner for soyjak.party

/tech/ - Soyence and Technology

Download more RAM for your Mac here
Catalog
Email
Subject
Comment
File
Password (For file deletion.)

File: submit to go.png 📥︎ (3.78 MB, 1536x1024) ImgOps

 â„–10391[Quote]

Why is Go so perfect?

 â„–10414[Quote]

File: 1743199030148.png 📥︎ (135.38 KB, 1883x1529) ImgOps

>>10391 (OP)

 â„–10459[Quote]

>>10414
Read the docs nigger.

>Appending to a slice where len==cap will grow the slice. sliceD is already grown by the append that creates it, which returns a slice with len=3, cap=3+n where n>0 (this is an implementation detail of the runtime). A subsequent append of one item to sliceD can fit in sliceD's backing memory without growing, so you end up aliasing that array in slices E and F.


>In your first example, sliceA starts with lencap3 and only first grows when you append to it to make sliceB and sliceC.


>But this is all scholastic. You shouldn't be relying on or trying to anticipate whether the runtime will grow a slice when it appends. Correct code will be correct whether or not the slice grows.

 â„–10607[Quote]

>>10459
Thank you slopgpt

 â„–10757[Quote]

File: gophers10th.jpg 📥︎ (44.31 KB, 339x399) ImgOps

>>10414
>filters webraisinters who don't understand memory
Damn, Go really is perfect.

 â„–10779[Quote]

>>10414
These are the people trying to argue about languages. Remember that.

 â„–10996[Quote]

>>10757
Why should I have to worry about memory in a memory managed language? Oh wait because Go is trash.

 â„–11001[Quote]

>>10779
You mean normal people?

 â„–11128[Quote]

File: Screenshot From 2025-04-25….png 📥︎ (364.6 KB, 2618x1306) ImgOps

>>10414
They somehow made it worse than C++. Impressive.

 â„–11129[Quote]

>>11128
Maybe C++ isn't bad after all. The constant bitching and moaning about Rust and C++ by go monkeys and their """techfluencers""" has been nothing short of a disaster.
Anti-intellectualism is being celebrated now because we let gotards touch computers.

 â„–11331[Quote]

>>10391 (OP)
It's made by and for people who have actual jobs in real life, for people who don't like masturbating over their programming language, who are not pseudointellectuals that think twisted language features are better than a simple for.

 â„–11347[Quote]

>>10996
>he thinks that just because you have a garbage collector it means you have to be completely oblivious as to how memory works
>>11128
>he thinks nobody will notice he wrote his own implementation of append() and then hid the code
if you want to be this retarded and contrived, nothing is stopping you from writing your own append() that works the way you want it to in Go either.



[Return][Catalog][Go to top][Post a Reply]
Delete Post [ ]
[ home / overboard ] [ soy / qa / mtv / dem ] [ int / pol ] [ a / asp / biz / fit / k / r9k / sude / tech / tv / v / x ] [ q / news / chive / rules / pass / bans ] [ wiki / booru / irc ]