← Home ← Back to /g/

Thread 106977253

28 posts 6 images /g/
Anonymous No.106977253 [Report] >>106979161 >>106979252 >>106983747 >>106984243 >>106987613 >>106987725 >>106987799 >>106987841
quite literally the best syntactic sugar
Anonymous No.106979161 [Report] >>106987725
>>106977253 (OP)
It's breddy good but even better in combination with null coalescing operator.

var fugg = thing?.GetTheThing() ?? throw new KysException();
Anonymous No.106979252 [Report] >>106979371
>>106977253 (OP)
yeah i fuckin love kotlin
Anonymous No.106979260 [Report]
the emo haircut of ternary operators
Anonymous No.106979371 [Report] >>106979496 >>106984948
>>106979252
This is a C# thread.
Anonymous No.106979496 [Report] >>106979683 >>106981371 >>106984998 >>106985962
>>106979371
never used it before. have i been missing out all along?
Anonymous No.106979646 [Report]
For me, it's the ternary operator.
Anonymous No.106979683 [Report]
>>106979496
C# is a pretty nifty language with documentation almost as good as PHP.
one downside is once you start using linq you basically use it everywhere

does anybody in this thread know if they solved the event/delegate memory leak problem?
Anonymous No.106981371 [Report]
>>106979496
Yes but not that much IMO. It's literally just syntactic sugar:

https://thoughtbot.com/blog/ruby-safe-navigation

I would argue that you should never deeply nest field accesses like this, but to each their own. I don't feel strongly about it because I'm not a Jewish Chinaman from big tech.
Anonymous No.106981529 [Report] >>106987498 >>106987633
Object oriented languages are such fucking cancer. Instead of debugging your actual logic you spend all your time refactoring some rigid class hierarchy and fucking around trying to architect your code to get around limitations of the object model.
Object oriented was a fucking mistake. Big sign of a shitlang is when it does shit like
namespace Blah {
class Program {
public static int Main(String[] niggers) {
// YOUR ACTUAL CODE GOES HERE!
}
}
}

I tried to use C#, it's not a bad language at all except for the fact that I'm forced to go three levels of indentation deep to type ANY code at all. Fucking painful and annoying. (Later versions of C# let you skip that, which is great, but I'm stuck on an old version of visual studio.)
Anonymous No.106983747 [Report]
>>106977253 (OP)
What does the dot do?
Anonymous No.106983750 [Report]
I mean couldn't it just be ? without the dot
Anonymous No.106984243 [Report]
>>106977253 (OP)
JFL at having nullable fields. Variant types are almost always a bad idea, they invariably introduce edge cases.
Anonymous No.106984948 [Report]
>>106979371
UHHHMMMM EXCUSE MEE, this is a javascript thread
Anonymous No.106984998 [Report]
>>106979496
It's alright but all the C# production code I've seen is horribly bloated.
It's based on Java and I think the point of Java is to maximize the number of lines of code for the purpose of creating busy work.
Anonymous No.106985962 [Report] >>106987759 >>106987878
>>106979496
There is no reason to use c# over kotlin. Kotlin (java vm) has much better cross platform support as well as being a better language in general.
Anonymous No.106987498 [Report]
>>106981529
Nigger the { } brackets ARE the namespace. That's the whole point of them and why languages without them are retarded
Anonymous No.106987613 [Report]
>>106977253 (OP)
monads for the uninitiated
Anonymous No.106987633 [Report] >>106987671 >>106987712
>>106981529
I agree with you fully

OO was made for people too weak to understand programmatic programming

(and spoiler alert, C++ code runs like shit when you scale it up)
Anonymous No.106987671 [Report] >>106987717
>>106987633
for example:
>erm, let me use a shared_ptr which was first implemented in C++ 11 (I know this because I am autistic)
>Surprise! The code breaks down and crawls to a halt in multi-threaded scenarios because there are atomic locks on the pointers!
>Golly gee! I wish I hadn't relied on this endless well of useless features I could have implemented myself, instead of learning this endless well of bullshit that only benefits me in job interviews!
Anonymous No.106987712 [Report]
>>106987633
The problem with OOP comes from how it originally tried to represent the actor model, this is not how computations are done in a program since for an actor model you'd need N different computational machines (or threads) for N instances for them to implement a proper actor model, this is why it's trivial to implement in distributed computing environments.
it's not a model for computation but for orchestration.
Anonymous No.106987717 [Report]
>>106987671
This.
When I learned to link with the non-multithreaded libs, it made everything 20 times faster.
I don’t always (hardly ever) write multithreaded programs, and when I do, you can create muktipke heaps per thread instead of locking all the memory
Anonymous No.106987725 [Report]
>>106977253 (OP)
>>106979161
(?) (a : Option a) b = c -> case a of Some _ -> b | None -> c

thing ? (thing.get) raise
Anonymous No.106987759 [Report] >>106987934
>>106985962
> java VM
Never viable from day one.
Oracle will eventually kill it. And good riddance.
Basic Hello World runs in 500 MB code+mem which is insane.
Call me when all the /usr/bin binaries are re-implemented in Java.
Anonymous No.106987799 [Report]
>>106977253 (OP)
just make it default for dereferencing
Anonymous No.106987841 [Report]
>>106977253 (OP)
Can it be used in expressions yet?
Anonymous No.106987878 [Report]
>>106985962
kotlin is ugly, just use java
Anonymous No.106987934 [Report]
>>106987759
No one uses java for the Hello Worlds.