The absolute state of Go

The absolute state of Go

Attached: 1544040876715.png (997x315, 37K)

Other urls found in this thread:

research.swtch.com/generic
twitter.com/SFWRedditVideos

Non code-monkey here, can you explain this please?

They reinvented the C preprocessor but non-standardized.

No because only us true 4channers will "get" it not /v/ crossboarders such as yourself.

basically just Go fuck yourself™

>if you didn't waste the best years of your life learning something that'll be useless in the world of Pajeet labour you must be from /v/

Attached: NO.gif (245x160, 1.33M)

>hey guys do I fit in on Jow Forums yet?

Attached: images-2.jpg (256x197, 13K)

Ok user, that programming degree will pay for itself any day now

Attached: 1512275715055.gif (190x190, 1.98M)

In real programming languages if you want something to be able to use multiple data types without writing the same code multiple times, for example if you want a list that can hold not only numbers but also words, you utilize "templates", where compiler will substitute the placeholder type with whatever you put in these brackets. This go programmer tried to emulate this by using external tools and using some unicode symbols that look like .

>programming degree
Bwahahaha

Attached: 1543793406204.gif (356x260, 3.44M)

*4channelers

/v/ crossboarder detected

Attached: 1541799946838.jpg (247x313, 14K)

>another Jow Forumsfag leaking over and shitposting.

Most programming languages have a feature known as generics, which allows you to write functions or data types that work for a variety of data types rather than only one. Here's an example in Java.
class Pair
{
public T first;
public T second;
}
So now you can have a Pair which has two Integers, or a Pair which has two Strings, and so on.

Go doesn't have generics. This user has tried to simulate generics by using the ᐸ and ᐳ characters because they resemble < and >, and just copypastes + finds/replaces to create as many different types as he wants. This is not good programming, because Go is not a good programming language.

Nice explanation.

>custom processor and special unicode characters

10/10 for the why I continue to use Go mental gymnastics performance.

Thanks user, simple enough for me to understand but not too simple

Thanks

How would you do this in Go elegantly, is this reddit cunt actually pretty smart for doing it his way or is he a dumb cunt?

>How would you do this in Go elegantly
You can't.

Attached: 1519507244728.png (1200x1400, 502K)

>How would you do this in Go elegantly
You don't

You can't really.
You can write out each data type separately, but that is time-consuming, difficult to amend later. OP does this basically.
In Go you have the type interface{}, which all data types can be converted to. You can use that for generic functions, but all pieces of data need to be explicitly converted back from interface{} to their "real" types for you to get any useful information out of them. This is error-prone and verbose.
The conclusion is - languages without generics really suck.

If it takes you more than an hour to learn Go you should be flipping burgers.

Judging by what people are saying in this thread I don't see the point in wasting an hour of my time on some meme-language

You usually don't need to. Generics are mostly useful for Java(Script) tier codemonkeys that rely on libraries implementing generic algorithms and data structures rather than implementing focused optimized DSAs for each use case, because they didn't pay attention to CS 101

You should only optimize where you have to. Remember the 80/20 rule.
Making bespoke data structures for every task is asinine.

what the hell is a function??

a piece of code

woah, like that gets done on computer?

And this is why websites are 20 MB of NPM libraries. It should take you less time to implement a DSA than to read the documentation for a library if you aren't a pajeet, AND it won't have weird bugs and edge case performance degradation as a bonus.

>handrolling all your own datastructures is not going to introduce more bugs than getting reliable, tested implementations from libraries

>muh scary Jow Forums

Yeah, I specifically excluded pajeets

>I only write babby projects for school

are you merely pretending to be retarded for (You)s or do you genuinely not know how type erasure works?

no, just obnoxious and dumb

>using a garbage-collected language for time-critical code
undergrads should be shot on sight

Nah, I write Go for Google.

yikers

If you need generics you shouldn't be using Go

>real programming languages
>achieving generics through glorified copy-paste

If you "need" generics then you haven't thought about the problem properly. Rob Pike, ken Thompson and Russ Cox are smarter than you.

If you need more than one data type you haven't thought about the problem properly.

>what is a real-time garbage collector
code monkeys should be shot on sight

>doesn't understand garbage collection or its impact on performance
i guess high-schoolers should be shot on sight too, since they missed you

If you "need" to program then you haven't thought about the problem properly. Gauss, Euler, kurt Gödel and Richard Feynman are smarter than you.

Lol ur retarded

Wait...
Go doesn't even have generics ??
Why would anyone use this crap ?

Not everyone programs with crutches.

>timing
>performance
pick one and only one

>yikers
>>>/reddit/

Generics arent that important for certain types of programs

oof

>not understanding the meaning of "time-critical"
shoot yourself on sight

Nice goalpost moving

He said time-critical in his original post you dumb faggot

Like trivial ones.

Go (baduk, igo) is a mind-bendingly complex game.

Go the programming language is bullshit.

Some people mistake productivity with sloc. Go makes them feel productive.

That means it's critical exactly when things happen, not what the total throughput is, you absolute summerfag who should have grown tired of shitposting as the novelty wore off months ago.

And what do you think happens when garbage collection occurs?

That's the point of an RT collector, predictable timing.

Look, I'm not saying all programs should use garbage collection, I'm especially not saying that all time-critical programs should use garbage collection. But the original statement implied that time-critical programs should never use garbage collection under penalty of being shot, which is utter bullshit.

>somewhere in the inner poos of India
>PAJEE PAJEE COMMM POoOO WHHIT US
>*brrrttr*
>*brprprpprprpr*
>*BRPOOOPSH*
>OOoOH PAJEE IZ A BIIG ONE VERY GUD
>**BEEP** **BEEP** **BEEP**
>OH NO EVERYONE PRETEND TO CALL CENTER
>....
>....
>....
>Garbage Collected!
>THAT WAaaAS TIME CCCRITICAL PAJEE

Attached: OOP_in_loo.jpg (624x351, 43K)

you fucking retard i knew you didn't know what garbage collection did to code
i hope you honestly kill yourself
t. original guy you replied to; all undergrads must hang

>predictable timing
so you still don't understand "time-critical"
just let the garbage collector collect your posts

BEEP BEEP BEEP BEEP

BISHHUUUUUUUUUUoOOOOWW

BAMBMMBMBMRRMBMHGGHUHUCRHRHRRR

Attached: pajeetistan.png (1920x1080, 3.66M)

>you fucking retard i knew you didn't know what garbage collection did to code
It does nothing to code. For data it primarily reclaims unreachable memory and secondarily compacts memory, improving locality, so depending on memory usage patterns you can even get better performance out of it. Not to mention memory safety and programmer productivity, which really do matter when you're employed and not a NEET LARPer.

thx i'll go tell my research advisor to scrap our project on embedded systems and restart in Go since you told me wow thx user sir... !

What do you think "time critical" means, then?

Where did I say you have to use GC, Go or any other language? I never said manual memory management doesn't have a place, all I'm saying that GC sometimes does have a place. For example if you find yourself doing manual dynamic memory allocation in an embedded application. Then you're better off using either static allocation or a RT GC.

>It does nothing to code.
>except all these things that interrupt the code from running

>>except all these things that interrupt the code from running
So do your interrupt lines and your RTOS, if you're using one, what's your point? These are things that you will likely be using in a real embedded job, nobody cares about your Arduino LED flasher.

So as long as you meet the timing requirements, what's the problem? If GC makes you fail them, by all means, use all static allocation, I'm not the one calling for people who choose one of two perfectly valid approaches to be shot.

>Where did I say you have to use GC, Go or any other language?
let me quote you
>so depending on memory usage patterns you can even get better performance out of it. Not to mention memory safety and programmer productivity, which really do matter when you're employed and not a NEET LARPer.
if that isn't you then stop replying to posts as if they were speaking to you

>let me quote you
There's nothing there about Go, and nothing about GC being the only valid approach to time-critical programming.

research.swtch.com/generic

From what I can see, Go developers have direct experience with the hairy problems that particular implmentations of generics bring to C++ & Java and do not want to replicate them in Go. If a patch/proposal came in that gave developers generics without huge penalties to either compile-time or run-time, then it would get added to the language. None have surfaced.

based pajeet poster

>without huge penalties to either compile-time
Why is this a problem? (If it's within reason compared to other compilers, of course)

If you don't want the increased compile time and binary size, all you have to do is simply not use generics.

>let me have an entire argument about how garbage collection is just fine in time-critical code
>and then tell you that i'm not saying it's the "only valid approach to time-critical programming"
really, i'm not joking: kill yourself.

>let's not give developers more options (in this general-purpose OOPajeet language) because if they use those options then they incur consequences
Ah, yes. THIS is who I want designing my programming language.

>that particular implmentations of generics bring to C++ & Java
Well those are about the worst examples they could possibly find, maybe if they checked out D and C# instead we wouldn't have this mess of a language.

Saying it's fine to use GC in time critical code is obviously not the same as saying it's not fine to use manual memory management for time critical code, where the hell do you get that from?

GC means you gain programmer productivity and memory safety, but if you can't use it because of resource or timing constraints, what have I written that you construe as saying you use it anyway?

That's a pretty good sign that your entire embedded carreer consists of making a LED flash on an Arduino. In the real world all that matters is costs and constraints. If BOM costs dominate over dev costs, you probably want to use lower power hardware and manual memory management, but if dev costs dominate over BOM costs, you probably want to go with higher powered hardware for more programmer conveniences like a RTOS and RT GC. Nobody in the industry cares about your ideological purity e-peen.

>Nobody in the industry cares about your ideological purity e-peen.
Please, keep posting. I love it.

Keep making that LED flash

GC doesn't give you memory safety though, it only plugs memory leaks.

>I need to resort to ad-hominem because I can't cope with being wrong and trying to salvage nonsense arguments by hoping no one notices when I go back on what I previously said
Don't stop posting.

Just let him keep posting. Anyone with an internet connection and the ability to use a search engine knows what he's saying is absolute garbage.

First of all actual time-critical systems aren't doing runtime allocations at all so that kinda eliminates the need for GC. Jow Forums is fucking retarded sometimes.

they think golang is competing with C when it's really just competing with python/JS

Well that's the most asinine thing I've heard today, being as barebones as C doesn't make something a replacement of C.

Undefined behaviour and no error checking does

The absolute state of Jow Forums
this illustrates why I love seeing seeing white programmers get replaced by 'pajeets', they are a bunch of hacks who learned one way to program and now are completely ignorant of any other way of doing something. if some programming language doesnt follow their meme methodologies they rage like Stockholm syndrome stricken little girls protecting their captors

this thread is completely pozzed, I'll enjoy seeing all of you get *real* jobs

Please, show me a single statement that I've gone back on. But of course you won't because you can't, because I haven't gone back on anything.

Leaks, double frees, dangling pointers, etc. are all memory safety issues addressed by GC.

If you're thinking about things like buffer overflows, that's orthogonal to GC, you can have bounds checking and manual management as well as you can have no bounds checking and GC.

That's complete nonsense. Yes, obviously you don't need GC if you don't do runtime allocation whether it's time critical or not, but no, not all time critical systems are easy or desirable to implement using only static allocation. It would be nice if they were, but that's not how it works in the real world. Any embedded dev should want to use static allocation, but not at any cost, certainly not at the cost of time-to-market or total unit cost. That just doesn't make business sense.

desu the "idiomatic" Go way (interface{}) decimates the performance so at least he is carrying over something decent.

they are both incomprehensible to 90% of Jow Forums so they might as well both be rocket science.

>that's orthogonal to GC
No fucking shit, that's what I said. GC doesn't give you memory safety.
>That just doesn't make business sense.
Making a program that's guaranteed to fail some time in the future doesn't make business sense either.

I never got an answer to
>What do you think "time critical" means, then?
but I have a sneaking suspicion you thought it was something completely different, which is why having such an autistic meltdown to distract from the embarrasment.

depends on how far in the future and how much a failure hurts, figuring those things out is exactly business sense

oh woah you sure got him dude chalk another one up on the Jow Forums argument victory board for you even though you have multiple people disagreeing with you and correcting your posts man nice good job

>No fucking shit, that's what I said. GC doesn't give you memory safety.

Leaks, double frees, dangling pointers, etc. are memory safety issues. This is what a GC is concerned with, this is the memory safety that GC brings to the party. You can't blame the GC for not meddling in other memory safety issues that the GC has no business with.

>Making a program that's guaranteed to fail some time in the future doesn't make business sense either.

see
and also a garbage collected system is no more or less likely to fail in the near or far future than a statically allocated and manually managed system. There are other sources of bugs, no matter what you still have the halting problem.

>you have multiple people disagreeing with you and correcting your posts man nice good job
It's fine to disagree, but nothing has been corrected. I've repeatedly asked to have passages that are supposedly wrong or contradictory pointed out, but so far there's nothing except which quotes a completely unrelated passage.

>but nothing has been corrected
OK, so you're delusional. Got it.

So you can't show me a single thing I've said that was wrong. Doesn't look particularly good on your part.