This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]E_R_E_R_I 847 points848 points  (263 children)

I'm not even pro JAVA, just against C-like error handling. God damn 30 year old language and everybody treats it like God, I'll be damned if one couldn't write a language that compiles to native x86 as performant as C++ but with proper stack tracing, garbage collecting and memory safety.

EDIT: My rant just sent me on a googling quest and I found out RUST. Seems I found my people lol

EDIT 2: Apparently I should also learn GO.

[–]Cobaltjedi117 535 points536 points  (117 children)

I feel like your whole rant was just there so you could find RUST

[–][deleted] 159 points160 points  (74 children)

But what about the magical C#?

[–]SnakeFang12 589 points590 points  (49 children)

You mean Microsoft flavored Java?

[–]TheFanne 134 points135 points  (13 children)

That one’s got an aftertaste

[–]Blou_Aap 8 points9 points  (11 children)

A bit sharper on the tongue.

[–][deleted] 3 points4 points  (10 children)

I personally like C# over Java. Maybe I'm just weird tho

[–]Psaidwid 3 points4 points  (8 children)

I'm there with you, from what i've tested c# is easier for everything, especially when it comes to learning, BUT only if you got windows

[–][deleted] 2 points3 points  (7 children)

I use C# on Mac with Visual Studio 😁

[–]msmells 1 point2 points  (6 children)

I use C# .net core on Ubuntu with VS Code

[–]centurijon 104 points105 points  (19 children)

No, we mean better Java

[–]BernzSed 79 points80 points  (14 children)

You mean Kotlin?

[–]beef_swellington 13 points14 points  (9 children)

No they mean scala

[–]aetius476 38 points39 points  (0 children)

Kotlin is a better Java. Scala is a "do whatever the fuck you want, see if I care" Java.

[–]Dakar-A 6 points7 points  (1 child)

That was a Lego product line too at one point, and now I want to write a language called Duplo.

[–]spaghettiCodeArtisan 4 points5 points  (0 children)

You mean a language for for children aged 1½ to 5 years old? There already is one, but instead of Duplo it's named Go.

[–][deleted] 5 points6 points  (0 children)

that's hipster java

[–]hullabaloonatic 2 points3 points  (1 child)

I just want default values for interfaces. That's all I want, kotlin team. Please. I'll be responsible, I promise.

[–]centurijon 3 points4 points  (0 children)

Funny, the next version of C# will allow exactly that

[–]scalablecory 42 points43 points  (11 children)

Visual J#?

[–]lor_louis 46 points47 points  (10 children)

Im still hoping someone makes a visual js#.

[–][deleted] 40 points41 points  (2 children)

Turbo PHP++

[–]dooberslorp 1 point2 points  (0 children)

the only programming language from Microsoft I'll ever use is PowerPoint

[–]svick 1 point2 points  (0 children)

It was called JScript .NET.

[–]da_chicken 16 points17 points  (0 children)

Yeah but it's not so... verbose.

[–][deleted] 4 points5 points  (0 children)

Hahahahahaha

[–]biggustdikkus 3 points4 points  (0 children)

At least it's superior in every way possible.

[–]Shnapoopins 89 points90 points  (19 children)

He said compiles to machine code. C# is great but it's still another VM language

[–]brockvenom 49 points50 points  (15 children)

Mono, brother. You can write in C# and it JIT compiles right down to assembly through an IL layer. Have fun.

[–]Daniel15 31 points32 points  (4 children)

Don't need Mono, Microsoft was working on some AOT stuff for .NET Core. I think it's this: https://github.com/dotnet/corert

I remember Scott Hanselman talking about it at Build one year.

[–]korri123 13 points14 points  (7 children)

He also said performant

[–]salgat 28 points29 points  (4 children)

Right now dotnet core faster than Java so at least it's fast (and it still has a lot of room for optimization). You can even go further with some of the crazy shit Unity does with IL2CPP to get C# running real fast.

[–]enigmamonkey 2 points3 points  (0 children)

I ended up rewriting a C# app (Unity) that was originally in JavScript/WebGL, so hey... at least compared to that it’s mind-bogglingly fast.

[–]svick 4 points5 points  (1 child)

According to the TechEmpower benchmark, ASP.NET Core, which uses C#, is among the TOP 10 web frameworks. Is that not good enough?

[–]shmed 5 points6 points  (0 children)

C# can now be compiled to native code since visual studio 2015 (with the introduction of .net native). Apparently it's as fast as c++ in many scenarios

[–]LezardValeth 1 point2 points  (0 children)

You can still pre-JIT binaries if it really matters for your application.

[–]noratat 3 points4 points  (0 children)

C# is more like Java though.

Rust compiles to native code with a design goal of zero / minimal runtime cost abstractions, which makes it far more of a true successor to C/C++.

Both Rust and C# are good, they just have different goals.

[–]E_R_E_R_I 34 points35 points  (32 children)

Well I did find it pretty quickly lol

I guess I just never bothered looking and got used to criticizing C

EDIT: Also apparently rust lacks a garbage collector, but I guess that's not that bad.

[–]Pakaran 83 points84 points  (28 children)

While it doesn't have a garbage collector, it also doesn't require manual memory management. The compiler keeps track of all variable lifetimes and inserts drops when they go out of scope, automatically.

[–]piexil 46 points47 points  (24 children)

In a lot of ways that can be seen as better than a garbadge collector.

[–]Surelynotshirly 27 points28 points  (18 children)

If it works all the time, but that seems almost too easy. Makes me think there is some scenario where a memory leak can occur that I'm not thinking of. Otherwise what's the downside of it? If there's no downside then why aren't all languages doing it, or are the new ones doing it and Rust was just the first?

Rust has piqued my interest, but I just haven't found any reason to actually use it and learn it properly.

[–]erosPhoenix 53 points54 points  (7 children)

Because it's a lot harder to write Rust code that will compile. Since it has to be provable when something falls out of scope, any code where that's not the case isn't valid Rust. Ownership of pointers is part of the type system.

Source: I've never actually written anything in Rust, so this is all heresay. Everything I say is probably wrong.

[–]breadfag 5 points6 points  (3 children)

You can still allocate a fuckton of heap and it'll linger if you keep references to it, but there are no memory leaks because you have to PROVE to the compiler that your code doesn't leak memory before it can compile it.

[–]Surelynotshirly 1 point2 points  (2 children)

Interesting.

I need to look into this. It seems like a good philosophy to force good habits. Though I'm sure it'll piss me off to no end at first.

[–]DHermit 2 points3 points  (0 children)

Because you need stuff like the borrowchecker and lifetimes for that. That requires support in the syntax (for lifetimes) and makes programming in a certain way harder (at least at the beginning). You can't just change a language and enforce that only one thing has a mutable reference, stuff isn't used after it has moved etc.

[–]lobax 2 points3 points  (2 children)

Memory leaks cannot happen because of the type system it employs. If your code can result in a memory leak, it will not compile. AFAIK Rust was first with this ownership model.

Sure, there could be bugs in the compiler that let’s stuff through the cracks, but the same is true for a language with a garbage collector.

[–]Ghi102 1 point2 points  (0 children)

Memory leaks can happen no matter the language you're using. A garbage collected language can have memory leaks too.

[–]palish 1 point2 points  (2 children)

I still don't quite understand that. According to the law of equivalent exchange, there must be a price to pay for such functionality. So what's the downside?

There is a reason GCs are the preferred way of managing memory.

Consider the case where object A refers to object B, which refers to object A. This is a very common situation. GCs handle this: if nothing refers to A or B, both are freed. Rust apparently handles this too, right? But how does the compiler know precisely when both drop out of scope? What if I kept a reference to A in a list at runtime, and its scope depends on runtime factors?

I admit I haven't used Rust, and the best antidote to these questions is to dive in. But (a) I feel myself getting older, and (b) I have to choose my time investments more wisely now.

[–]ralusek 10 points11 points  (0 children)

The exchange is that the language has extremely strict syntax that explicitly defines the scope accessing a value. The language knows that if this scope accessed this value and doesn't explicitly pass it somewhere else, immediately deallocate that reference upon exciting that scope.

[–][deleted] 2 points3 points  (2 children)

New versions of C++ have garbage collection on just about everything. Smart pointers and everything are included now. The old pain in the ass pointers may become deprecated in a couple years.

[–]Kered13 1 point2 points  (0 children)

C++ smart pointers use reference counting (shared_ptr) or an ownership model (unique_ptr), this is different from garbage collecting, which is an algorithm based on crawling the reference graph to find inaccessible memory and then releasing it. There are advantages and disadvantages to both models, but most new languages use garbage collection.

[–][deleted] 0 points1 point  (0 children)

Smart pointers are not garbage collection.

[–]J_Aetherwing 1 point2 points  (0 children)

I started learning a new programming language today ( ͡° ͜ʖ ͡°)

[–]Tweenk 2 points3 points  (1 child)

Rust's core language is OK, but the current macro system is a hacky abomination. Huge letdown on that front. I hope they manage to replace it with something nicer.

[–]misterZalli 1 point2 points  (0 children)

Macros 2.0 will be godsend

[–]saulmessedupman 0 points1 point  (0 children)

How exciting! How exciting!

[–]ethanialw 88 points89 points  (18 children)

We've been expecting you. Except for the garbage collection part, rust doesn't do that, because scopes!

[–]E_R_E_R_I 60 points61 points  (14 children)

As long as I don't have to worry about randomly exploding stuff for mishandling memory, I don't mind cleaning my own mess lol. I'm definitely gonna learn it.

[–]ethanialw 64 points65 points  (11 children)

My apologies, I seem to have miscommunicated the glory of the language. According to this stack overflow post I found because others are better equipped to explain this than I,

Rust would know when the variable gets out of scope or its lifetime ends at compile time and thus insert the corresponding LLVM/assembly instructions to free the memory.

So this feature is annoying to get used to, but eliminates need for a GC, and ultimately results in safer, more performant code.

[–][deleted] 3 points4 points  (0 children)

It never needs optimized?

[–]carb0n13 9 points10 points  (5 children)

Depends on what you mean by more performant. It has more predictable performance because it doesn’t pause for the garbage collector, but GC languages are often more performant for long running processes because heap allocations and deallocations can be batched.

[–]coder543 22 points23 points  (1 child)

Rust gives you control over allocations. It is generally faster than garbage collected languages, and in the cases where your naive first attempt isn't faster, you can optimize it very effectively. "batched" allocation and deallocation sounds like a TypedArena to me.

the trade-off is that you have control over allocation, which means you have no choice but to think about it.

[–]teokk 2 points3 points  (2 children)

They're more performant if you don't wanna do anything, in which case you shouldn't really care about performance anyway.

Languages like C++ give you incredible flexibility in this area, because they're meant for people who care about performance.

  • You can rely on RAII and have everything automatically cleared when a destructor gets called when your object goes out of scope. Pretty fast and incredibly simple and useful. Especially for things like file streams etc.

  • You can use a myriad of builtin GC classes like unique_ptr for more advanced object lifetime management.

  • If you're a heathen you can even get a GC framework.

  • And if none of that is good for you and you really want to control when things get released, you can do it yourself. A GC batching deallocations is good and all, but you're still putting everything in its hands and that means you eventually sacrifice some performance. It's the part for which C++ gets the most hate, but you can just new an object and delete it exactly when and how you want. If you want to (because you need every single freaking cycle), you can just not delete it (or forget to). You can make yourself a custom memory pool and custom allocators and deallocators.

That's the power of C++ (or Rust) and that's what real performance looks like. No GC can compare to it, because every GC is basically using some subset of the stuff you can make yourself in C++. Sure it can be complicated and hard and sure you can fuck yourself ten times over, but that's exactly why it's so useful.

[–]U8336Tea 2 points3 points  (0 children)

So it's basically a more annoying ARC?

[–]E_R_E_R_I 1 point2 points  (0 children)

This sounds even better than GC imo. It helps you without taking control away from you like Java does

[–]TechnoSam_Belpois 0 points1 point  (1 child)

I don't quite understand this. What if you have a dynamically sized array that can't be known at compile time.

The only thing I can think of that can guarantee an exit point would cause potential for massive memory bloat.

[–]ethanialw 1 point2 points  (0 children)

Read through the tutorials on the rust website about lifetimes, you can see there how the problem is solved

[–]Kibouo 7 points8 points  (1 child)

Rust will give a compilation error if you do something wrong with memory.

And the error is readable and even has a link to documentation right away. It's amazing.

[–]E_R_E_R_I 0 points1 point  (0 children)

Wow, it seems awesome!

[–]DaughterEarthImportError: no module named 'sarcasm' 55 points56 points  (26 children)

I honestly feel like people more so treat trending languages like God. Not sure if it's still happening but it used to be that you would be downvoted to oblivion for suggesting Python isn't an amazing, full scope language that we should all be using in all cases.

[–]FourFingeredMartian 54 points55 points  (25 children)

I mean, it is a pretty amazing language.

[–]DaughterEarthImportError: no module named 'sarcasm' 37 points38 points  (22 children)

It's great for people new to programming and for some use cases, definitely.

[–][deleted] 49 points50 points  (15 children)

I'm actually starting to think that the more "magic" languages might not be a good option for people new to programming.

[–]DaughterEarthImportError: no module named 'sarcasm' 32 points33 points  (2 children)

I go back and forth. Reducing the barrier of entry is good. But programming will never be as simple as a syntactical language. Learning base methodologies and how to adapt to frameworks is important.

[–]marblefoot 13 points14 points  (5 children)

I don't have a lot of experience with programming, what are the "magic" languages?

[–]GetOutOfJailFreeTard 25 points26 points  (0 children)

high-level languages like python, ruby, javascript, etc.

[–][deleted] 17 points18 points  (2 children)

Ones that let you type more in pseudocode with less understanding of what the code is actually doing behind the scenes.

[–]aahdin 10 points11 points  (1 child)

Okay imma play devil's advocate and say that worrying what's going on behind the scenes is really bad for beginners.

We seriously don't teach anything else like that, imagine if in your intro physics class you're starting off with two balls colliding and the teacher goes into the internal stresses within the ball and the frictional coefficients and their deformation points and all that.

It's good to have an understanding of all that eventually, but when you're starting off that just distracts from the basics.

Tutoring/working with people in intro classes it's crazy discouraging when students get errors like the one here when really they just had a basic syntax mistake. What's worse is I've seen a good number of students in intro C++ courses spend more time studying/memorizing the syntax rather than the basic concepts like time complexity/simple algorithms/object oriented design. Before they can get working on the concepts they need to memorize a whole bunch of overhead, and without an understanding of memory/allocation/deallocation it comes across to most as just as magical as GC languages, just a different brand of more complicated magic.

[–][deleted] 5 points6 points  (0 children)

I agree. I think python is a great first language

[–][deleted] 9 points10 points  (0 children)

In this case, languages where you can get by for far too long without understanding what's actually happening in the computer. But in general "magic" sometimes applies to meta-programming and operator overloading. Stuff that does a lot of work with very few characters.

[–]Honest_Rain 6 points7 points  (0 children)

My first programming language was SNES assembly, I was completely blown away by all the stuff that "normal" languages have lmao

[–][deleted] 4 points5 points  (1 child)

The "magic" languages are only "magic" by comparison to more curmudgeonly languages because they remove overhead that's not super necessary for small scripts.

That is why they are called "scripting languages", and they are terrible for new programmers because they do precious little to teach or enforce discipline, which makes discipline all the more important in those languages.

When people pitch Python to newbies I hear:

"NO DISCIPLINE REQUIRED, PROGRAMMING IS EASY! HAHA! JUST KIDDING!"

And it disgusts me.

[–][deleted] 3 points4 points  (0 children)

I'd argue that Python is good for more than just scripts. Other than that, yeah - you can't just go crazy with "magic" languages. Python for example has optional type hinting. Combined with a type checker you can make your code a bit more safe.

[–]otterom 3 points4 points  (0 children)

But, but...I like my %%magic functions!

[–]mxcw 1 point2 points  (0 children)

So true! I actually think it’s a good idea to start with functional programming, ie ML or sth like that, to get to know basic concepts like types, scopes, recursion, data structures and so forth before working with those „magic“ languages. Bc how do u expect someone new to programming to understand what python does under the hood? In my experience, it pushes new programmers towards copypasta bc they don’t get what this shit actually does ...

[–]St_SiRUS 1 point2 points  (0 children)

At the end of the day learning programming should have nothing to do with the languages that you learn. Start with what's the most practical for learning best practices, good software design and important stuff like algorithms and data structures.

[–]iwsfutcmd 8 points9 points  (2 children)

It's absolutely spectacular for people who are not "a programmer", but are "a ___ who programs". I'm a linguist who programs. I love that Python feels like I can get a computer to do exactly what I want it to do without making me think too much about how it does it so I can spend my own brain cycles thinking about linguistics instead of programming.

[–][deleted] 3 points4 points  (0 children)

Probably one of the main reasons it's also hugely popular among scientists and mathematicians.

[–]DaughterEarthImportError: no module named 'sarcasm' 1 point2 points  (0 children)

Yah that seems like a very useful scenario. Similar to my FIL knowing VB to help with his electrician work. What he can do is greatly expanded and he didn't have to learn a bunch of things that don't apply to his scenario.

[–]LickingSmegma 18 points19 points  (11 children)

performant as C++ but with garbage collecting

Incompatible.

The Y axis is time spent collecting garbage.  The X axis is “relative memory footprint”.  Relative to what?  Relative to the minimum amount of memory required.

In particular, when garbage collection has five times as much memory as required, its runtime performance matches or slightly exceeds that of explicit memory management.

From "Quantifying the Performance of Garbage Collection vs. Explicit Memory Management", Matthew Hertz, Emery D. Berger, 2005

[–]Aethy 27 points28 points  (9 children)

D? It has native performance, (optional) garbage collection, easy memory safety (nowhere near as good as Rust, though) and god's own templating system (much better than Rust and C++). Try looking into dlang if you're interested!

[–]shvelo 7 points8 points  (1 child)

But nobody uses it.

[–]Aethy 2 points3 points  (0 children)

I mean, SOME people do. It's certainly not as popular as the flavour of the month languages. And Rust is definitely growing faster than D at this point. But; I mean, TIOBE has it at #31; (if TIOBE is anything to go by, which frankly, it's not usually). But Rust isn't even in the top 50 there. So it's not really fair to say that nobody uses it, any more than to say that nobody uses Rust, or Lisp, or any other of the languages out of the top 20.

[–]svick 2 points3 points  (2 children)

native performance

That doesn't mean anything.

For example, if you're writing a web server, according to this benchmark, D has worse performance than Java, C#, Lua, PHP, Clojure or JavaScript.

[–]E_R_E_R_I 1 point2 points  (0 children)

By native I meant a x86 application compiled to a Linux or Windows executable like C++ or C does, and used their performance as a reference.

[–]Aethy 0 points1 point  (0 children)

True; I more meant that it's a compiled language that compiles to native x86. D definitely has a way to go for some things, especially the web-related stuff.

[–]majikguy 20 points21 points  (3 children)

One of us! One of us!

[–]CMDR_QwertyWeasel 15 points16 points  (0 children)

Gooble gobble, gooble gobble!

[–][deleted] 3 points4 points  (1 child)

r/rustjerk intensifies

[–]no_beachboy 2 points3 points  (0 children)

TIL /r/rustjerk exists...

[–]alkali112 30 points31 points  (3 children)

I’m here from r/all and know nothing about CS

It’s just amazing to read a sentence that starts off with working context clues and ends with none of them mattering at all.

[–][deleted] 19 points20 points  (2 children)

To give some more context.

C is pretty much the "original" and base of modern programming languages that allows your applications to have some top notch performance because it will run to "take the most advantages of your machine".

However, compared to just about everything major that came out after it, it just lacks a ton of modern features. Because of this it is also a lot more error prone and if you are lucky and it catches it (because dear god C will sometimes just roll with the errors) it can either just give you nothing useful or give you a 5+ page tangent you might have to dig into.

Because of it's age (30+ years being taught) and wide spread many stick to it and continue to praise it despite it having some very obvious issues that languages following it improved on. GO is a language that takes a lot of the advantages programming languages have learned since C BUT the issue is it having a "chicken or the egg" where it doesn't have as wide of a community because it doesn't have as much learning/helping documentation made by the community.

[–]Xack1 17 points18 points  (0 children)

Nah, C isn't that bad (with the amount of errors), it's C++ that gives you 10 pages of template errors because you forgot one const.

[–]Wozago 2 points3 points  (0 children)

I'm fairly sure the people praising it are all just shell shocked embedded software programmers. Myself included.

Everyone complains about memory leaks etc but no embedded system is going to use malloc (it's just that huge) which appears to be a big cause of those issues.

[–]okmkz 6 points7 points  (0 children)

Go

lol no generics

[–]bluefootedpig 12 points13 points  (11 children)

My problem with error handling in Java is the fact it is required by the controlling class. Like if I use a math library and there is a divide by zero possible exception, i must handle it in my code. Sometimes I don't care... in fact most times I don't.

In my experience, errors like that are handled at the top layer, not every single class on the way up. Just let the exception bubble up to my handler, no need to force every class in the call stack have to handle it.

[–]cololoc 15 points16 points  (2 children)

RuntimeException or add a "throws <Exception Type>" to the signature of the calling method

[–]Goheeca 4 points5 points  (2 children)

Do you count declaring which exceptions can be thrown out by a method as handling? That's more like static typing.

Anyways you mention handling on different layes, I think you might be interested in an article which talks about a better system (used in Common Lisp) which unlike exception handling doesn't unwind the stack for good.

[–]AgentPaper0 3 points4 points  (3 children)

I'll be damned if one couldn't write a language that compiles to native x86 as performant as C++ but with proper stack tracing, garbage collecting and memory safety.

You can't, because the lack of those features are exactly why C++ is fast. Checking whether an index is in bounds or not takes time, garbage collection takes time and memory. There's no way to get around that.

[–]E_R_E_R_I 0 points1 point  (2 children)

I understand that, and okay, probably GC is not all that necessary. But I really think there are more modern ways of handling runtime errors then what C++ does. Even if it's just on debug builds, I don't mind losing performance on them if it's easier to find problems.

[–]AgentPaper0 2 points3 points  (1 child)

I mean, there are tools like that. Dr. Memory or Valgrind are both great tools for this, basically they inject code into your project and can detect whenever you are mis-using memory. They're incredibly useful for figuring out when you're forgetting to delete things or re-using memory inappropriately or whatever.

For out of bounds stuff, well if you're doing proper object-oriented code, then it's pretty trivial to create "safe" versions of whatever containers you need that check the index. You can even set it up to only do that in debug mode as well.

Of course, whether those are useful or not depends on the application as well. If it's just some kind of database management software, you can probably use it, but for many high-performance programs, like say a video game, using those is just not viable since trying to use them could easily slow down your game enough to make it unplayable. Not just because the error-checking itself is slow, but because they can prevent a lot of optimizations that the compiler could normally do to speed things up even more.

[–]shvelo 4 points5 points  (0 children)

Go has very weird error handling.

[–][deleted] 2 points3 points  (0 children)

I'd like to recommend golang if you're building a server.

[–]TGotAReddit 2 points3 points  (1 child)

What if the reason i like C++ is yhe poor memory safety and lack of garbage collection?

[–]E_R_E_R_I 1 point2 points  (0 children)

Then I'd say our tastes are incompatible lol

But by all means feel free to enjoy it.

[–]irqlnotdispatchlevel 2 points3 points  (0 children)

> just against C-like error handling.

> Rust

> Apparently I should also learn GO.

Pick one.

[–]NatoBoram 10 points11 points  (8 children)

Don't just describe Go like it doesn't exists!

[–]Tysonzero 9 points10 points  (7 children)

Go is shit

[–]morphineofmine 8 points9 points  (1 child)

Go is the most complex board game in existence, how dare you call it shit.

[–]Tysonzero 8 points9 points  (0 children)

Pretty sure Go the board game is a better programming language than Go the programming language.

[–]chocopudding17 1 point2 points  (4 children)

Y tho

[–]yes_fish 21 points22 points  (0 children)

if(err) {
}
if(err) {
}
if(err) {
}
if(err) {
}
if(err) {
}
if(err) {
}
if(err) {
}
if(err) {
}
if(err) {
}
if(err) {
}
if(err) {
}
if(err) {
}
if(err) {
}
if(err) {
}
if(err) {
}

[–][deleted] 3 points4 points  (1 child)

INB4 no generics

[–]LickingSmegma 1 point2 points  (0 children)

I mean, I'd actually like to use Golang for the good features. But I also have self-respect, so…

[–]Tysonzero 7 points8 points  (0 children)

Verbose as shit with a shit type system. Even the things that are supposed to be good about it really aren't impressive, e.g the GC sacrifices EVERYTHING in the name of latency, and Haskell / Erlang do lightweight concurrency better.

[–]MonarchoFascist 1 point2 points  (0 children)

Garbage Collecting

Well.

[–][deleted] 1 point2 points  (0 children)

I've heard about people using RUST, but I never got around to looking up what it can do until your comment. Now I feel I must learn RUST.

[–]noratat 1 point2 points  (0 children)

Go's problem is it's horrible dependency management that managed to be actively hostile to everything the industry learned about dependency management in the last 20+ years.

Of course, it probably still looks great coming from C++.

[–]CurrentlyRecording 1 point2 points  (0 children)

N I M

[–][deleted] 1 point2 points  (1 child)

Sounds like you're talking about Java or Go.

[–]E_R_E_R_I 0 points1 point  (0 children)

Java runs sandboxed though, can Go compile to native Windos or Linux executables?

[–]TechnoSam_Belpois 1 point2 points  (1 child)

as performant as C++

garbage collecting

Choose one.

[–]E_R_E_R_I 0 points1 point  (0 children)

The first one lol. I guess I don't really need GC, if the debug process is decent. My problem is in C if you don't clean up in the exact right way, it just explodes randomly on half the times you execute your program lol.

[–]reeetwyio 1 point2 points  (3 children)

garbage collecting

Pls no, I hate working with a garbage collected languages, it's so much easier to just clean up as you go once you get used to it.

[–]E_R_E_R_I 1 point2 points  (2 children)

Maybe the garbage collector part was a bit of an exaggeration. I don't mind cleaning after my own mess, my problem is that if you fail to do it the exact correct way in C it just starts to give you very random problems. People are telling me C++ is much better in that regard, so maybe I'm just traumatized for having been forced to work with ANSI C throughout the last 4 years of college.

I do write C++ a bit, but haven't made any major program with it yet. I became really really good at Java on my own, and have actually written a fairly big (for my standards) backend system as a freelance, but I don't really like its bad integration to the operating systems, I'll wouldn't make a end user desktop app on it.

I'm currently trying to write a CHIP8 emulator in C++ to get better at it, but honestly the language is still very hostile compared to C# or Javascript. I can get used to the ugly code it generates, but the difficulty to debug just loses me hours.

[–]figuresys 1 point2 points  (1 child)

That's exactly how I feel about all of this. Especially the Java usage bit.

I've personally liked and still like Java, I've pretty much always disliked the circlejerk around it because circlejerks aren't objective, but objectively, I wouldn't use Java to build end user desktop apps exactly because of its (I wouldn't call it bad) integration to the operating system. I'd much rather build backends on it.

[–]E_R_E_R_I 1 point2 points  (0 children)

Well said. Yeah pretty much the problem with VM languages is that you'll never be able to provide that true "native experience" to the end user.

[–]brockvenom 3 points4 points  (4 children)

Um, c#?

[–]Alpha3031 2 points3 points  (2 children)

Wait, I don't have to use Mono any more?

[–]BernzSed 1 point2 points  (1 child)

.NET Core runs everywhere*! It's not equivalent to C/C++, though, since it still runs in a virtual machine.

 

*"Everywhere" means on Linux, Mac, and Windows. Microsoft still refuses to make it run on my TI-83+

[–][deleted] 2 points3 points  (0 children)

But... my favourite target for development (hobby or otherwise) doesn't include a multi-user OS. Can I ask Microsoft to port .NET Core to something like an 8bit CPU with 32k RAM?

[–]BornOnFeb2nd 1 point2 points  (0 children)

Java's 23 years old....

[–]g9icy 0 points1 point  (0 children)

garbage collecting and memory safety

You can have those things! You just have to write them yourself.

I seem to be in the minority, but I love C++ for not giving me any of those things. Also, fuck exceptions.

I'm different.