"ChatGPT, please write me some C++ code and some Rust code, and also explain the benefits and drawbacks of each so I can sound smart."
Its one wisdom to study the things and another clowning to spread the induced opinions as facts
This is a pretty good thing to do when choosing a stack though. I still end up writing all backend in Go unless theres some cool node package i want.
What do you mean? I have done a hello world project in both. C++ is clearly faster.
That’s because hello-world
in NPM drags 137 transitive dependencies along with it.
You know, if most rustaceans on reddit are really just web devs who don't know anything besides javascript... That would explain a LOT.
ngl recent years sent our way a big wave of devs who keep giving very controversial opinions. took me a while to realize that all they did was CRUD. not saying one is better than the other but man, coding really changed over time from creating complex desktop applications singlehandedly to web dev where everything is condensed into a service or library that does all the work for you.
makes sense they have been pushing for browsers to replace desktop, and why half of them suck ass lol
This is why I was always so confused when I read programmer opinions on Reddit. Then I realized everyone chiming in is a web dev. Us solo desktop devs still exist!
[deleted]
What is low level cpp to you? You'll find a lot of people with a science background who had to suffer with projects written around tools like geant4 or root in cpp. But if you're looking at hiring be aware those are people who have learned to live inside some hideous code bases. (eg classes that don't implement abstract methods of parent classes leading to undefined behaviour or constructors randomly shuffling order of parameters and which are passed as pointer value or reference)
Looking around for Haskell comments.
a monad is just a monoid in the category of endofuctors what's the problem
Are there any rust frameworks with a nice ORM and admin like Django yet?
SeaOrm is pretty complete tbh. It has an optional admin that you can integrate into your program.
Yes, loco.rs
and also have good devex? Intellisense was unusably slow the last time I tried out rust and it killed any motivation to continue working with it.
Funny because ruff is such a nice fast Python linter.
I'm not talking about separate tools like that, when I tried using rustanalyzer with a few dependencies installed it would take up to 20-30 seconds to see any intellisense or errors in my ide. I was on a 5900x at the time when it was current
I have a 9950x now and would be interested to give it a go again but that really soured my mood to try rust outside of basic apps
Rust programming is so rewarding. If your crate compiles successfully, the program probably works, now weird silent errors.
You are just describing this sub lol
Fellow webdev here. C++ is the best language of all times. Rust stinks.
Rust is the only language I’ve seen where I couldn’t even get a general idea of what was going on. I dunno if it was the codebase or the language but it was strange. We were supposed to port the program to another language. The idea got abandoned outside of my control so I never had to learn it
I don’t know C++ either but I’ve had to go in a make bug fixes before and it was mostly intuitive.
Skill issue
For sure, I do not know rust. But over the years I’ve had to read or make small changes to projects in 10 or so languages and that’s the only project I couldn’t sus out what was going on.
I can see how idiomatic rust might be hard to read if you don't even have the basics, but tbh every time I try to read C++ my mind goes numb (skill issue on my part too)
The code I had was written by one person that had left so it could’ve just been bad code too
C++ is def superior to rust. Still js is the goat.
js is for glue eating mouth breathers
I think JS can be very elegant. I've written in Python, JavaScript, TS, C#, Java, and Dart. Of all of those I probably prefer Typescript, but JavaScript is a close second.
I think I just threw up in my mouth a little bit.
What don't you like about the language? I often see arguments that JavaScript code is poorly organized and architected. That's fine, but that's a decision the developer makes. Hence why I said JavaScript can be very elegant. For example, a senior engineer at my company rewrote a portion of our .NET Core frontend in a very impressive, organized fashion that made total sense, was abstracted nicely, and followed clear architectural principles. But yeah you do see a lot of horrible JavaScript code, but that's because it's the most widely adopted language today.
JavaScripts biggest issue is a lack of good standards, or a standard library.
I’ve built plenty of projects like what you’re describing, but that only works in a bubble. In my experience, the second you have a project with more than one developer it falls apart pretty quickly. It’s extremely rare to find a project that doesn’t heavily rely on NPM and/or bloated frameworks. It’s a generalization, but that’s what most JS developers are conditioned for. The number of times I’ve come across simple projects using something like React because “it has everything we might need later”, or “it’s easy to find developers who know React” is pretty gross.
A lot of JS developers are either lazy or inexperienced as well, which is how you end up with situations like the left pad debacle. Most of the JS community is quick to reach for a package that does something they need without considering that what they might actually need is a simple function they could write on their own.
In my opinion, most of the modern JS ecosystem is no better than the Wordpress ecosystem. It’s mostly garbage because there were no guardrails back in the wild-west days of the web.
The final comment I’ll make is that I think there is an over dependence of JS to do stuff it was never designed to do. I personally feel like JS is fine for building interactive features on the front-end, but JS has no business being used on the back end. Just because you can doesn’t mean you should when there are other, better options. Other than in synthetic benchmarks, a Go backend is going to run circles around anything written in JS. If what you need is more organized code, using something like Symphony or Laravel would be a better choice.
JavaScript has become a shitty Swiss Army knife. That’s my biggest gripe with the language. I don’t mind writing JS at all, but I have to sit eyeballs deep in sewage on most JS projects. That’s the biggest turnoff.
So it seems you have a problem with the community in which you associate JavaScript with, but not JavaScript itself from what I can tell from your comment. If a JavaScript codebase has clean code, good architectural practices, and clear abstractions, I think it's very similar to working on something like a C# codebase or a Python codebase or a Java codebase that follows the same principles. This works for my company, at least for our newer codebases and not the legacy code, because we're all adhering to maintaining those core set of principles.
Very true. Javascript gives you "all the rope to hang yourself with," as they say. It allows you to write almost whatever you want. That can either be a disadvantage or an advantage depending on the developer. Typescript, though, is just silly, in my opinion. It just adds restrictions that you could follow in your js if you wanted to and bloats code.
I feel like you can make similar mistakes in other languages like Python. I agree, ideally you just have clean JavaScript, but TypeScript does a good job guiding better practices. The worst is when you see the any keyword popping up all over the place.
Exactly. It's just rules that you could follow. Like training wheels. Did it actually change how types function or just put a rule on top of js?
He definitely has never worked on a clean JS projects and just here to gather some "JS bad" karma. JS definitely can be elegant it's only because the user base is so gigantic so the chances of seeing egregious codes are higher. Doesn't mean it's inherently bad, it could happen to any language
I’ve been working with JavaScript since 2004, and currently maintain projects written in vanilla JS, jQuery, Vue, React, and Svelte. I started my career doing mostly marketing agency work but have been self-employed for the past 10 years. I still do mostly greenfield work since I subcontract for several big agencies, but a good portion of my work also involves maintaining legacy projects. Hence the active vanilla JS and jQuery projects.
Having said all of that—JS bad.
Brother you are working on codebases that use technology 15 years ago with actual typeless JS. It is as disconnected to the modern world as it can be. JS is only becoming better and better with modern human intervention like typescript and various newer standard approaches, which all lack in legacy code base.
IDK what to say if you bring up jQuery codebase and say JS is bad, I mean sure dude...
Still you can't use the broken reddit without it.
it's broken because only stupid people use js of course the end result is going to be garbage
I hate C++, dislike using rust and love web dev, so of course my fav. "low level" language is C, because it just feels so good to write
Are web devs software engineers, or are they not worthy of such a prestigious title?
In classic Reddit fashion, Reddit is gate keeping the term. Bunch of fart sniffers think that their in-house .pdf -> .csv converter is the best thing since Jesus turned water into wine.
Yeah I'm of the view that if you're developing software, whether its web, mobile, CLI tools, appliance facing software, whatever, software is software, then you're a software engineer if you're doing it in a professional capacity. The term engineer might be a bit debatable in the sense that we don't have to get certifications and licenses in the same way civil engineers or structural engineers do, but that's a broader topic of discussion.
I call myself a Computer Programmer because that is a prestige title.
Maybe it's just an American thing but.
"Engineer" is a real professional title. In fields like civil or electrical, it comes with certification, responsibility, and legal accountability.
I think it’s strange seeing programmers argue for the same title just because they write code. Writing code isn't the same as designing systems where lives or infrastructure are at stake.
All the software engineers I work with including myself have engineering degrees related to our field of work.
If any programmer wants to call themselves a software engineer, I mean who cares, but it does kinda signal ego and insecurity over substance.
Depends on if they got the bs in cs.
So what makes a software engineer is a computer scientist? I don't think that's true. Some of the best software engineers I've met don't have a degree in computer science at all.
True but you asked how to distinguish web devs and most web devs have just gone to code schools. That for me is the easiest distinction. You are right though, there are some brilliant self taught coders I've worked with that I would call engineers.
There are boot camps for ML, are they ML devs or ML engineers if working in that space?
Good question. I don't work exclusively in machine learning so I'm not as able to make a distinction. From my understanding that a lot of ML devs are just running a few lines of python and the sophistication comes just from the tools they use. I guess the general difference for me is are you just following a happy path you know will work or do you really understand what the code does in order to build the best system to solve a problem.
Learn Cpp after learning Rust and I'm just wondering why people would willingly use that language
I write C++ when forced to, have never written a line of Rust and I hope it stays that way.
F# > Scala > C# for me.
It is unfortunate web developers often don't get the 4 year degree where you will definitely be writing some c++.
Write? Why write? Just used ChatGPT or other people's code.
That's why I stan for Elixir. It's just better than everything.
But is it webscale™?
Java chads win again, as always.
Boilerplate 🔥🔥🔥
Readable code 🔥🔥🔥
public class AbstractFactoryFactory extends AbstractFactoryFactoryFactory implements Factory
🔥🔥🔥
More than 10 year old stereotypical memes that makes it clear you don't actually have any knowledge 🔥🔥🔥
oh yeah? go ahead, show us how it's done.
Just use Scala. Readable, safe and no boilerplate
Scala is for devs who don't understand software development beyond writing some code.
Fake, gay and nonsense
Damn I've been found out, I forfeit.
I learned with java. Now all my colleagues hate me because even small projects have deep inheritance and corresponding file structures.
It's also ridiculous that writing "Hello world" requires you understand imports, public, class, static, methods String, arrays and return values. Why can't it be like a normal language and just allow you to compile println("Hello World");
? Why do I need to give someone a 90min lecture about OOP principles when all I want is for them to check whether their IDE is setup correctly
skill issue
Java 21+ introduced unnamed classes and instance main
as a preview feature, so you can print "Hello World" like this:
java
void main() {
System.out.println("Hello, World!");
}
It's also ridiculous that writing "Hello world" requires you understand imports, public, class, static, methods String, arrays and return values.
I can't believe I have to understand programming in order to program!
Wait until you find out all modern web tools have been re-written from JS to Rust. Rust is the go-to language of choice for compiled binaries for the web now (it used to be Go, and that's still popular, but in my experience Rust is now more popular than Go).
Obviously the average web dev isn't maintaining their own tools, or contributing to big open source libraries, but the ones that discuss C++ vs Rust likely are.
Isn't TypeScript being rewritten in Go?
Yes
How dare you! goes back developing a code analysis tool with AI
ill get downvoted but who cares, i havent written single line but i hate rust because its mostly used by guys who wear girls socks and that always cringes me out
1) what do you have against programming socks? (/gen)
2) my teacher used to say "There is no such thing as a "bad programming language". Each language is good for its area of usage.". I also don't like Rust (since, imo, its approach to memory safety makes the programmer focus more on fighting the compiler rather than actually developing), but I don't have anything against Rust devs and projects written in it. It's a good language for what it's worth.
As i said, it cringes me out.
Second point doenst make sense in this post context.
that still doesn't explain the missing semicolon jokes
im not that deep into this
Who told you that false facts ? And why is your iq so low ?
facts ? in this meme context? 🤣
and talk about iq 🤣🤣🤣
but i like them 😞
They don't write in either language, but they are very exposed to the issues and vulnerabilities of systems languages.
Web apps run on top of web servers, containers, VMs, databases, caches, routers, and proxies, most of which are written in systems languages. The security and robustness of web apps rely on the security and robustness of the underlying systems.
I work for a large org as a security engineer. I help oversee security for a couple thousand sites and none of any of the web devs give a single shit about any of that. More often than not they request that we just get rid of the WAF altogether so they have less hassle
But I know how they look (Rust is horrendous) and I kinda know how they work (unless it's Rust, which has like 3 times the amount of syntax).
Guy who picks programming language based on how it looks
Readability is a valid reason to pick a specific language.
More like on how much setup it needs. Trying to compile and run cpp source code was a nightmare for me back then. Also it's not like I'm using haskell, JS can still get shit done without requiring 3 buisness days.
skill issue
Probably, but I bypassed it and coincidentally found a beautiful language which has the best friction/flexibility/performance balance.
Using JS as an example of being good at any of those is laughable. I seriously hope your entire account is satire and that you're just bad at it.
I don't see how that's a bad example, you could show me some proof.
Their fervent arguments likely revolve around abstract benchmarks and theoretical security guarantees, all while their own projects are probably being held together by duct tape, JavaScript fatigue, and a prayer that no one inspects the console errors too closely.
Embedded dev that had to do a local webpage for the first time recently, I was so worried about fixing any console errors I was creating but then I started opening dev tools on professional websites to compare and oh my god guys get it together why are there dozens of errors in production
It’s not always up to the developers. Sometimes non-developers are allowed to insert tracking scripts dynamically, and they can be very noisy
Jesus, it's a wonder anything works.
You get errors just by importing a library
My brand new spanking project required me to run
npm install --force
without me having written a single line of code. Spent several hours trying to figure out how to fix it, but the web of dependencies makes that impossible.@material
also comes bagged with tens of thousands of deprecation warnings out of the box, which is only cool if one of the warnings doesn't happen to be importantIt's not you, it's a tool set designed by and for amateurs. Using Javascript is an absolutely horrible experience that people defend because they have literally never written a single line of code in anything else
The beauty of PMs and middle management that only want short term results, don’t understand feature creep and code debt, coupled with decades of high staff turnover and migration to low cost countries where the original developers are long gone, left no documentation or any kind of reasoning behind why things are done that way, leading to current code owners that know absolutely nothing about the code they are responsible for. Which then are pressured to develop more features on impossible deadlines given to them by marketing execs and are forced to come up with something that barely works for 1 demo and immediately switched to another thing before they can finish the first feature properly.
Fr the most passionate language debates always come from people with 500 TODO comments and production code that would make you cry
LMAO exactly 💀
They’ll passionately debate Rust's borrow checker and C++'s UB like seasoned veterans, meanwhile their own React build is breaking because they updated one package.
Console flooded with red, but yeah-tell me more about zero-cost abstractions
You can break any project when you are fucking around with dependencies. It's completely irrelevant how well the project is managed and written. It's true in every language with a package manager.
You forgot about micro-services sir!
Wouldn't be me. When I do purely scripting projects I end up writing pretty optimal JS, then the underlying engine usually optimizes everything else for me, and then if most of the code gets JIT compiled I'm practically running a C++ program (in terms of performance).
Please say /s right now.
Yes and no. It's not like I can do any benchmarks, the last time I tried to setup all the tools to actually make c++ programs - I couldn't do shit, not even a hello world. If had some c++ clones of my programs I could compare them.
Just use Visual Studio if you don't want to "have fun" with build systems. It's way easier.
IDEs are for the weak!
I write binary directly to memory like the old Altair 8800 gods intended.
Lol thats practically vibe coding. I connect two wires at calculated intervals, coding with the electrical pulses.
Have you tried Linux? It's pretty trivial to compile C/C++ on it.
Even if nothing else works, the C/C++ compiler works more or less always on Linux.
No, and I don't believe I will ever use Linux.
then stay ignant playboy
That’s nonsense, and an extra crazy thing to say when you admit you have no evidence or reason to believe it’s true.
For hardcore contiguous memory number crunching, C++ will probably be 50-100x faster than JS.
Actually not.
https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/node-gcc.html
Most VMs have quite extremely high memory overhead, but performance is actually quite OK-isch for JavaScript; and in fact on par, or sometimes even faster, for something like the JVM or CLR.
JS has the fastest dynamic runtime. You get "only" ~ 2 - 4 slow down in comparison to C, for optimized cases. And that in benchmarks that aren't nice to JS, namely mostly heavy number crunching.
For the usually pointer chasing app code, it's not really much slower than C/C++. Nobody can do magic, and JITs in fact output machine code close to optimum. (Sometimes even better than C/C++ which didn't go through PGO, as a dynamic runtime with JIT has PGO more or less build in, so you get it for free).
Like said, memory is more the concern. But with a VM that allows compact memory representations this can be mitigated to some degree. See for example the benchmark game results for C#. Future JVMs will also improve massively in that regard with the advent of Valhalla. For JS it's not really possible, at least if you don't count WASM, that can be almost as memory efficient as C/C++.
Of course starting a VM and profiling and then JIT compiling needs also resources, which aren't than available for the actual task. For long running processes that's not a problem, but for short running processes that's not optimal.
PGO is implemented in a lot of compilers, if anything, C++ needs less profiling because it has types, JS can be more of a pain because in order to compile a piece of code, the JIT compiler must "guess" the type of each variable
I feel like that's supposed to be in the opposite. I can have a continuous number buffer in JS, and a loop works exactly the same way in both languages. If anything - the more complicated things, which have some manual boilerplate automated away in JS (like arrays or something) would be lagging behind CPP.
You're also saying ridicuouls stuff like 50x-100x when you have no benchmarks whatsoever, lol.