Stop comparing programming languages
- Python is versatile
- JavaScript is powerful
- Ruby is elegant
- C is essential
- C++
- Java is robust
- PHP is old
- HTML is NOT A PROGRAMMING LANGUAGE!!!
- CSS is
︎ ︎ ︎ not alig-
︎ ︎ ︎ ned
Actual definitions (my opinion):
- HTML is website
- CSS is style
- JS is everywhere
- SQL is data
- Python is simple
- PHP is backend
- Markdown is README
- YAML is config
- SatouKazuma ( @SatouKazuma@programming.dev ) 50•4 months ago
Mfw Rustaceans don’t exist :(
Also, JavaScript…why are you the way you are? Does anyone have advice for learning it so it makes sense? I can’t even get tutorial projects to run properly…
- polonius-rex ( @polonius-rex@kbin.run ) 17•4 months ago
use typescript and don’t look too hard at the infrastructure
- frezik ( @frezik@midwest.social ) 5•4 months ago
I tried, but the infrastructure collapsed on me.
- magic_lobster_party ( @magic_lobster_party@kbin.run ) 13•4 months ago
I like Douglas Crockford’s talks about the “good parts” of JavaScript. They’re old and probably a bit outdated, but he explain quite well the history and why JavaScript is the way like it is.
It clicked for me when I saw them the first time. Still hate JavaScript though.
- wreel ( @wreel@lemmy.sdf.org ) English6•4 months ago
What Crockford did was enable a lot of devs to realize there was a viable development platform built into the most prolific and open network client in the world. For that he should be commended but it should have never been taken as “this is a viable general purpose language”.
- magic_lobster_party ( @magic_lobster_party@kbin.run ) 2•4 months ago
He also showed that JavaScript has more resemblance to functional programming languages rather than object oriented ones. If you try to treat it as an object oriented language like Java (like the seem to imply), you will have a bad time.
This has changed with TypeScript though.
- MajorHavoc ( @MajorHavoc@programming.dev ) 12•4 months ago
The mantra that got me through JavaScript was “almost nothing we do here is able to be synchronous”.
Everything about the language makes more sense, with that context.
- Xylight ( @Xylight@lemdro.id ) English49•4 months ago
-
Python is
NameError: name 'term_to_describe_python' is not defined
-
JavaScript is
[object Object]
-
Ruby is
TypeError: Int can't be coerced into String
-
C is
segmentation fault
-
C++
-
Java is
Exception in thread "main" java.lang.NullPointerException: Cannot read the termToDescribeJava because is null at ThrowNullExcep.main(ThrowNullExcep.java:7) Exec.main(ThrowNullExcep.java:7)
- CSS j ust # sucks
- Kotlin is
type inference failed. The value of the type parameter K should be mentioned in input types
- Go is
unused variable
- Rust is
Compiling term v0.1.0 (/home/james/projects/Term)
- sus ( @sus@programming.dev ) 14•4 months ago
C++ is std::__cxx11::list, std::allocator > >::erase(std::_List_const_iterator >) /usr/include/c++/12/bits/list.tcc:158
- Zacryon ( @Zacryon@lemmy.wtf ) 3•3 months ago
The only reason to use AI in programming is to simplify C++ error messages.
- xigoi ( @xigoi@lemmy.sdf.org ) English7•4 months ago
Rust is downloading 1546 dependencies
- schnurrito ( @schnurrito@discuss.tchncs.de ) 4•4 months ago
If you’re naming variables like that in Java you should definitely switch to C.
- Xylight ( @Xylight@lemdro.id ) English3•4 months ago
fixed ive using rust for a while
-
- magic_lobster_party ( @magic_lobster_party@kbin.run ) 42•4 months ago
Just accept it, all languages suck
- asyncrosaurus ( @asyncrosaurus@programming.dev ) 66•4 months ago
“There are only two kinds of languages: the ones people complain about and the ones nobody uses.”
- magic_lobster_party ( @magic_lobster_party@kbin.run ) 34•4 months ago
That’s why Haskell is so loved. Nobody uses it.
- wreel ( @wreel@lemmy.sdf.org ) English5•4 months ago
I love how after a decade pandoc is still Haskell’s “killer app”. smh
- BatmanAoD ( @BatmanAoD@programming.dev ) 5•4 months ago
I mean to be fair, that’s a pretty useful tool.
- sparkle ( @sparkle@lemm.ee ) Cymraeg3•4 months ago
Not Scala and Rust. They are my beloved, my sweethearts, my knights in shining armor.
Ok Rust does have some major issues, but not Scala…
- BatmanAoD ( @BatmanAoD@programming.dev ) 5•4 months ago
Oof, slow compile times to target, of all things, the JVM? Implicit methods?
Some(null)
? Function call syntax where the difference between a tuple argument and a sequence of non-tuple arguments can be determined by whether or not there’s a space before the parentheses?There are definitely some major issues with Scala.
- magic_lobster_party ( @magic_lobster_party@kbin.run ) 2•4 months ago
They also thought the best thing to take from Python is that version 3 should not be backwards compatible with version 2
- sparkle ( @sparkle@lemm.ee ) Cymraeg3•4 months ago
I think that’s good when the objective is to improve the language. One key thing that holds many languages back is that they’re stuck with historical baggage, and it can be pretty difficult to replace/remove “outdated” stuff without breaking everything.
I do not want to be stuck using Python 2, or Scala 2 (although there exist people who use Scala 2 instead of Scala 3).
- magic_lobster_party ( @magic_lobster_party@kbin.run ) 1•4 months ago
Where I’m working we’re heavily using Spark, which kind of blocks us from upgrading. There seem to be ways to get Scala 3 to work, but we also have old terribly written baggage code no one understands. Just upgrading between 2.12 to 2.13 was a journey.
- sparkle ( @sparkle@lemm.ee ) Cymraeg2•4 months ago
I agree that the slow compile times are pretty bad (maybe even deal-breakingly for large projects). I think it’s kind of necessary for a language with as powerful of a syntax as Scala though, it’s pretty absurd how expressive you can get. Maybe if it didn’t target the JVM, it’d be able to achieve way faster compile times – I don’t really see a point of even targeting JVM other than for library access (not to say that that isn’t a huge benefit), especially when it has relatively poor compatibility with other JVM languages and it’s nearly impossible to use for Android (don’t try this at home).
Even more so, I think that null handling isn’t nice – I wish it were more similar to Kotlin’s. One thing I’m really confused as to why Scala didn’t go all-in on is Either/Result like in Rust. Types like that exist, but Scala seems to mostly just encourages you to use exceptions for error propogation/handling rather than returning a Monad.
A more minor grudge I have is just the high-level primitive types in general – it’s pretty annoying not being able to specify unsigned integers or certain byte-width types by default, but if it really is an issue than it can be worked around. Also things like mutable pointers/references – I don’t actually know if you can do those in Scala… I’ve had many situations where it’d be useful to have such a thing. But that’s mostly because I was probably using Scala for things it’s not as cut out to do.
With the tuple arguments point, I get it but I haven’t found it much of an issue. I do wish it wasn’t that way and it consistently distinguished between a tuple and an argument list though, either that or make functions take arguments without tuples like in other functional languages or CLI languages (but that’d probably screw a lot of stuff up and make compile times even LONGER). I saw someone on r/ProgrammingLanguages a while back express how their language used commas/delimiters without any brackets to express an argument list.
I think an actually “perfect” language to me would basically just be Rust but with a bunch of the features that Scala adds – of course the significant functional aspect that Scala has (and the clearly superior lambda syntax), but also the significantly more powerful traits and OOP/OOP-like polymorphism. Scala is the only language that I can say I don’t feel anxious liberally using inheritance in, in fact I use inheritance in it constantly and I enjoy it. Scala’s “enum”/variant inheritance pattern is like Rust enums, but on crack. Obviously, Rust would never get inheritance, but I’ve found myself in multiple situations where I’m thinking “damn, it’s annoying that I have to treat and as almost completely serparate”. It would especially be nice in certain situations with const generic traits that are basically variants of each other.
Plus, I’ve always personally liked function overloading and default arguments and variadics/variadic generics and stuff, but the Rust community generally seems to be against the former 2. I just really hate there being a hundred functions, all a sea of underscores and adjectives, that are basically the same thing but take different numbers of arguments or slightly different arguments.
The custom operators are a double-edged sword, I love them and always use them, but at the same time it can be unclear as to what they do without digging into documentation. I guess Haskell has a similar problem though, but I don’t think Scala allows you to specify operator precedence like Haskell does and it just relies on the first character’s precedence. I would still want them though.
How it goes now, though, is I use Scala 3 for project design/prototyping, scripting, and less performance-sensitive projects, and Rust for pretty much everything else (and anything involving graphics or web). Scala has good linear algebra tooling, but honestly I’ll usually use C++ or Python for that most of the time because they have better tooling (and possibly better performance). I would say R too, but matplotlib has completely replaced it for literally everything regarding math for me.
- BatmanAoD ( @BatmanAoD@programming.dev ) 1•3 months ago
Sounds like we’re actually in agreement about most of this.
I’m okay with languages limiting their “expressive” power in order to provide stronger correctness guarantees or just limit how “weird” code looks; but this is largely because I’ve worked on many projects where someone had written a heap of difficult-to-understand code, and I doubt such limitations would be appealing if I were working strictly on my own.
I also don’t really see the appeal of Java-style inheritance, but to be honest I didn’t use Scala for long enough to know whether or not I agree that Scala does inheritance “right”.
It does make sense that Rust provides mutability in some cases where Scala doesn’t. Rust’s superpower, enabled by the borrow checker, is effectively “safe mutability.” I hope other, simpler languages build on this invention.
- lseif ( @lseif@sopuli.xyz ) 2•4 months ago
not zig
- Hotzilla ( @Hotzilla@sopuli.xyz ) 2•4 months ago
Yes, just flip binary directly to the cpu
- luciole (he/him) ( @luciole@beehaw.org ) 36•4 months ago
- C++ is fine
- Python is fine
- C# is fine
- PHP is fine
- JavaScript is fine
- C is fine
- Java is fine
I could go on
- polonius-rex ( @polonius-rex@kbin.run ) 32•4 months ago
PHP is fine
i will fine you
- CanadaPlus ( @CanadaPlus@lemmy.sdf.org ) 15•4 months ago
JavaScript is also not fine.
C++ apparently has a lot of footguns if you use too many parts of it. C and orthodox C++ are fine.
- polonius-rex ( @polonius-rex@kbin.run ) 12•4 months ago
people say this but C is significantly more batshit than javascript
oh you used
scanf
? one of the basic functions of our language? sorry that’s got a buffer overflow vulnerability so now your application is compromised- CanadaPlus ( @CanadaPlus@lemmy.sdf.org ) 9•4 months ago
Yeah, but as far as I understand that’s not a C vulnerability. It wasn’t added. C just exposes how the underlying CPU works.
If you could avoid exposing dangerous memory quirks but still retain the same power… well, you’d have invented Rust. Rust is a better language than C, I agree with that.
Edit: Yep, just double checked. Buffers live in physical memory and have to be finite, so if you advance outside of them you’ll go somewhere else. Scanf’s not special, this is just another inherent pointer issue.
- polonius-rex ( @polonius-rex@kbin.run ) 9•4 months ago
exposing the machinations of the underlying CPU with no regard for safety is like, the definition of a footgun
- CanadaPlus ( @CanadaPlus@lemmy.sdf.org ) 6•4 months ago
Okay, but how do you code on a CPU without directly interfacing the CPU at some point? Python and JavaScript both rely on things written in mid-level languages. There’s a difference between a bad tool and one that just has limitations inherent to the technology.
Like, to echo the meme a bit, it’s not a totally straight comparison. They have different roles.
- polonius-rex ( @polonius-rex@kbin.run ) 6•4 months ago
a footgun isn’t inherently bad, it just implies a significant amount of risk
yes, if you need the ability to code on a low level, maybe C is necessary, but the times where that is actually necessary is smol
also rust
- xigoi ( @xigoi@lemmy.sdf.org ) English1•4 months ago
What’s the point of having a function in the standard library if the universal recommendation is to never use it?
- CanadaPlus ( @CanadaPlus@lemmy.sdf.org ) 1•3 months ago
Is that the recommendation? This is the first time I’ve actually seen it discussed.
I’m wondering at this point if a new, different stdlib would be better. Or just use Rust.
- xigoi ( @xigoi@lemmy.sdf.org ) English1•3 months ago
To be honest, my comment probably applies more to
gets
, but the point is the same.
- SquishyPandaDev ( @SquishyPandaDev@yiffit.net ) 9•4 months ago
A true programmer
- SeekPie ( @SeekPie@lemm.ee ) 6•4 months ago
Go on…
- passepartout ( @passepartout@feddit.de ) 5•4 months ago
Don’t give them ideas
- drspod ( @drspod@lemmy.ml ) 35•4 months ago
ITT: Rust programmers rewriting the joke in Rust.
- AllNewTypeFace ( @AllNewTypeFace@leminal.space ) 30•4 months ago
Are those adjectives randomly chosen?
- odium ( @odium@programming.dev ) 28•4 months ago
Yeah, JavaScript powerful? How?
- Ace! _SL/S ( @AceSLS@ani.social ) 32•4 months ago
By running everthing in a single thread obviously. Won’t get more powerful than that
- polonius-rex ( @polonius-rex@kbin.run ) 11•4 months ago
good luck doing frontend development without it, but it can also do backend development
it can do everything
- CanadaPlus ( @CanadaPlus@lemmy.sdf.org ) 17•4 months ago
but it can also do backend development
The same way a rusty spoon can dig a hole, sure.
- odium ( @odium@programming.dev ) 10•4 months ago
That makes it versatile, not powerful.
When I hear powerful language, I think of languages that are good at intensive tasks like assembly, c, rust, Python (because of numpy, pandas, pyspark, cuda, etc.).
- echindod ( @echindod@programming.dev ) 8•4 months ago
Python is powerful because it easily wraps C libraries that do real work! Just kidding mostly.
But yeah, js isn’t a language I would describe as powerful. Ubiquitous? More capable than you would expect given it’s history? Bloated?
- CanadaPlus ( @CanadaPlus@lemmy.sdf.org ) 4•4 months ago
Python is powerful because it easily wraps C libraries that do real work! Just kidding mostly.
Not kidding. There’s no rule against that though. It’s good at it’s niche.
- frezik ( @frezik@midwest.social ) 3•4 months ago
I exercised JavaScript out of some of my apps, and I’m happier for it.
- lseif ( @lseif@sopuli.xyz ) 1•4 months ago
if its acceptable to force javascript onto the backend and everywhere else, then why not write the frontend in rust, or anything else than can compile to wasm ?
- BatmanAoD ( @BatmanAoD@programming.dev ) 4•4 months ago
WASM has no native ability to access most web APIs, including the DOM. JavaScript is literally unavoidable on the front end.
- lseif ( @lseif@sopuli.xyz ) 1•4 months ago
javascript cannot be compiled natively for the backend or desktop either…
also libraries like wasm bindgen allow a developer to write almost no javascript. and i wouldnt could a few lines of bootstrapping.
im dont advocate for wasm when its not necessary. nor do i advocate for backend js when its not necessary.
- BatmanAoD ( @BatmanAoD@programming.dev ) 3•4 months ago
Sorry, I’m not sure what your point is. I realize that you can almost completely avoid JavaScript, but the point I’m making is merely that there is a real technical limitation that limits the choices developers can make for front-end code, and although WASM is making great strides in breaking down that barrier (something I’ve been thrilled to see happen, but which is going much more slowly than I had hoped), the limitation is still there. Conversely, such a barrier has never existed on the backend, except in the sense that C limits what all other languages can do.
- lseif ( @lseif@sopuli.xyz ) 1•4 months ago
my point is that languages have their places.
javascript is great for the frontend. not just because it’s the only choice, but it’s also a lot easier to write code for ui than say, C or rust.
however i do not see a reason why it needs to run on servers or desktop apps, bar a few cases. i know node is popular, but i think fullstack devs just like to have everything in the same language, even if it makes it harder to use and slower to run.
likewise C, rust, go, whatever, are great for backends, embedded etc, but they shouldnt be ran on in the browser, unless there is a specific reason like heavy computation with little dom interaction.
just because a barrier does not exist doesnt mean that we should write programs in a language not designed for the domain.
- onlinepersona ( @onlinepersona@programming.dev ) English15•4 months ago
C++ is a surprise CVE generator.
- linuxgator ( @user1234@lemmynsfw.com ) English13•4 months ago
C++ EXISTS
- Yuri addict ( @Iloveyurianime@ani.social ) English11•4 months ago
what about Holy C? is it only usable to people that are actually god choosen programmers?
- LoudWaterHombre ( @loudWaterEnjoyer@lemmy.dbzer0.com ) 8•4 months ago
Java is robust haha
- downpunxx ( @downpunxx@fedia.io ) 8•4 months ago
C++ catchin strays
- noproblemmy ( @noproblemmy@programming.dev ) 3•4 months ago
C pew pew
- OpenStars ( @OpenStars@discuss.online ) English7•4 months ago
What is C essential for anymore these days? Genuine question btw.
I thought C++ was essential for microprocessor control, but that it depends and sometimes I gather people use C instead, but not always.
Use the language that the company hires you to know:-).
- Brosplosion ( @Brosplosion@lemm.ee ) 17•4 months ago
Most of the Linux kernel is written in C
- BatmanAoD ( @BatmanAoD@programming.dev ) 3•4 months ago
This is a really good post about why C is so difficult to seriously consider replacing, or even to avoid by using a different language for certain projects: https://faultlore.com/blah/c-isnt-a-language/
- OpenStars ( @OpenStars@discuss.online ) English1•4 months ago
It isn’t just a language, but it is a language - as it eventually gets around to saying, but it starts off by saying that it isn’t, then later corrects itself to say that it is, etc. I feel like the focus of this ignores the historical context of what C was written to be for - at the time there was like Assembly, BASIC, Fortran (?), other long-dead languages like was it A and/or A* or whatever, there was a B language too! (developed by Bell Labs, if Google can be trusted these days), etc. - and C was developed to be better than those. So saying that like it lacks type conversions is very much missing the point - those were not invented yet. A lawn mower also lacks those, but it’s okay bc it doesn’t need them:-) I am probably nit-picking far too many points, I suppose to illustrate that the style of the article became a hindrance to me to read it b/c of those reasons. But thank you for sharing regardless.
- BatmanAoD ( @BatmanAoD@programming.dev ) 2•4 months ago
I don’t really like the title either, but the article does demonstrate how unfortunate it is that we’re effectively locked in to using the ABI at some level of nearly every piece of software.
That said, there definitely were languages with better type systems prior to the invention of C. Pascal is a frequently-cited example.
- OpenStars ( @OpenStars@discuss.online ) English1•3 months ago
Oh wow, good points!:-)
- tiredofsametab ( @tiredofsametab@kbin.run ) 6•4 months ago
- Rust has safety and efficiency close to C
- Perl is processing most of your healthcare records
- Ada is doing space stuff
- Go is going places
- witx ( @witx@lemmy.sdf.org ) 3•4 months ago
I was caught by surprise and for some reason this joke clicked so much that I laughed for a while. Kudos