A loosely moderated place to ask open-ended questions
Search asklemmy 🔍
If your post meets the following criteria, it’s welcome here!
- Open-ended question
- Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
- Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
- Not ad nauseam inducing: please make sure it is a question that would be new to most members
- An actual topic of discussion
Looking for support?
Looking for a community?
Icon by @Double_A@discuss.tchncs.de
- 0 users online
- 244 users / day
- 957 users / week
- 2.45K users / month
- 5.6K users / 6 months
- 1 subscriber
- 3.07K Posts
- 119K Comments
- Modlog
I’m a big fan of Rust.
cargo
) just works, the compiler’s error messaging is simply unmatched and the IDE story is excellent thanks torust-analyzer
.Result
and you have to explicitly handle the possibility that something went wrong. There’s no forgetting a null check and slamming face-first into aNullReferenceException
or segfault in some other part of your code.Obviously it’s not all perfect, however.
rustc
is always getting faster, of course, but it’ll probably never be as fast as Go or JVM/NET.)And much time is saved from debugging. It makes a lot of sense that we let the computer/compiler keep an eye on lifetimes, allocations and access so the code is much more correct once it compiles.
I feel like my old colleagues and I have spent a far too large part of the last 20 years chasing memory issues in C++. We are all fallible, let the compiler do more.
I like the way the compiler doesn’t just tell you there’s a problem, but also gives you advice on ways you may be able to fix it. That’s a smart compiler.
And I like the way I can write something that runs fast but not feel faintly anxious all the time I’m doing it.
After years, and many languages, I still have to say Ada. Kotlin, Rust, Julia, and Nim are my current contenders to overtake, but here’s what Ada does well enough to still be my preferred tool when appropriate:
There are some situation where Ada shows its age:
func
/proc
(Nim) vsfun
(Kotlin) vsfn
(Rust) doesn’t make much difference to me, butfunction X returns Y
/procedure X
starts to add a lot of visual noise to a file.Here’s when I use the alternatives, and their biggest weaknesses:
Thank you for attending my TED talk :P. Any questions?
Really appreciated this thanks for taking the time to put this together.
I learned Ada in the early 90s before being plunged into a world of C/C++. I haven’t heard much about it since, but I’m glad to hear it’s alive and kicking. I’ll have to have another look, see if I recognize any of it!
Python, and I like that I know it
I’m an embedded systems C programmer with passing familiarity with Python. To me it seems ridiculous that a language relies on whitespace for blocking. Is that true?
It only requires consistent indentation inside blocks, which is what any good code does anyway for readability. So the main difference then is just that you no longer need the redundant curly braces.
Yes, unfortunately. There is a lot of tooling around it but it still feels bizarre after years of using it.
I’m anal about curly braces in C. I never code without them because I don’t like being ambiguous.
I never do
if(i=0) return 0;
or worse
if(i=0) return 0;
I do
if(i=0) { return(0); }
I had to use Python for a bit at work and it was confusing
pipenv, venv, virtualenv, poetry…wtf is all this shit
a.b
vsa['b']
vsa.get('b')
…wtf is a KeyErrorWhat happens in other languages you use when you try to access a non-existing key for a hash/map/dict?
What language do you use that accessing an object attribute is the same that accessing a dict key?
What knowledge do you have (or not) that KeyError is a mistery to you?
Javascript / Typescript.
Well, yeah, I thought about later. Lua does the same.
The other questions are still valid, though.
Return undefined.
Typescript.
Why error? Just return undefined. Simple, no try/catch needed.
Because that’s prone to errors. And the Zen of Python includes “explicit is better than implicit” and “Errors should never pass silently”. Languages that do otherwise create bad habits.
Is it? It’s just an optional property. And Typescript will tell you that it’s optional.
People love to complain about
npm
andnode_modules
, but I think they were on to something with the simplicity of it.Python for its versatility.
Rust for its strictness and speed.
Try Julia, it has both
By versatility, I’m also including the ecosystem. Julia doesn’t seem to be anywhere near python on that.
However, I’ve heard good things, it’s on my to-do list.
rust thank you for asking
crab army attack! 🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀
I use Rust btw
rust is really great but rust foundation’s mistakes kinda killing it :/
Rust is like Bitcoin, nothing can kill it
I agree. :) I kinda marked “bad decisions to screw community” thingy.
I think the stuff with the foundation is kinda overblown by the Internet drama machine. That’s not to say they haven’t made mistakes, but hopefully the leadership council will fix things up.
Plus, Rust has come into widespread use, so it’ll be very hard to kill.
Ah, I do not think it’s really overblown… It’s really a mistake that needs to be fixed up and people screaming to let them know. That is what we should do and it is great!
Agree by the way, its really hard to kill but i think can be killed if same mistakes happens over and over. Rust is an awesome language, I do not want foundation to overrun it. We should be talking about awesome crates, not an idiot decision made by foundation…
sorry i meant crablang, the based language with no cringe foundation
C#. Strong core, a lot of convenience extensions, extensive ecosystem, great docs, great IDE (VS) with suggestions, refacs, lingers, etc.
C# is still my favorite. I’ve been pushed back into a C++ project recently and it’s just painful.
I live on the C++ side and I find C# painful, I think it’s just a matter of familiarity.
Go. It’s high level enough in terms of syntax that it’s easy to build complex apps in, and low level enough that I’m able to control pointers, manually run the garbage collector, and benefit from the runtime performance.
It’s the best of python and JS.
Hell yea. Can’t forget those compile times and that parallelism handling. I can’t think of a language that has a better dev cycle to performance ratio.
I really want to learn it, and I understand the basic syntax and patterns. What apps did you make with it to learn it? I can’t think of anything big to make.
Python. It’s the only one I know :(
I’ve been trying to learn C# too but object-oriented programming just slides right off my smooth brain lol.
Once oop clicks it’s a revelation.
Don’t worry, although it’s good to learn, IMO it’s still on the wrong side of overused and overrated and could stand to be applied more selectively than it tends to be.
Been learning python for selenium and I love it. I know some C# and Javascript but I enjoy Python a lot more as a newb.
You ask a carpenter what his favorite tool is? I like languages that are fit for purpose, and I enjoy using them for that purpose.
I used bin/bash when I automated the backups at work and happy doing it. I was pulling my teeth out when I had to write code for communicating with Bluetooth devices in /bin/sh because that was what was available from factory on the router.
I picked Python for when I needed to scrape a Romanian phone book (to win an argument on the internet about something completely unrelated to programming). I once tried doing parallel programming and threads, it did not work out very well and I switched to some other language before I got too deep into it.
My guilty pleasure is the voodoo magic of C. I don’t really have a use for it in my job so I never get around to really do anything with it.
Python. I’m a data engineer by trade and the ability to just lay out functionality between different systems and move content fast is great. I know you can do that with many languages but python does scripting very well. And since by default I am working with remote/parallelized/containerized systems I never really lament pythons lack of speed.
Obviously python is not the only language in my workweek.
PHP.
It picked a niche and fits exactly into it. It’s a language for server side web pages. It’s not a general purpose language shoehorned into the task, so it wisely sets boundaries. PHP could avoid a lot of async/await/promise hell because you can work in the mindset of HTTP requests-- terms of short lived requests that are compiled elsewhere. You don’t have fragile runtime environments (see: server-side JS), since it just plugs into Apache or Nginx, which are at least battle tested and known quantities to operate.
It’s batteries included. Hell, it’s the entire Duracell company included. The standard library is rich and centrally documented, including decades of community nitpicks, even before you go into composer repos.
It’s non judgmental. You can write procedural code, or object-oriented code, based on preference and fit to task.
It makes ad-hoc easy and formal possible-- If I need an array of [227, “Steve” => “meow”, 953 => new FreightLocomotive()] I can get it, or I can enforce types where it’s relevant and mitigates risk.
PHP really is such a forgiving language and easy to understand and get in to. My favorite part is that every time I have a seemingly very niche and specific use-case, there is a function that just does that thing perfectly and is already included in the base library.
You said it and I’ll reaffirm: the documentation and online library of SO questions/answers is absolutely priceless. Most of the older versions are still compatible with the latest version, so upgrading is simple and usually just means there are more features you can use now.
Good old C. Simple to use, minimalistic, stays out of the way and allows me to do what I want while programming. My only problem with it is that is no longer really a low level language to due auto vectorization in modern compilers and kind of requires a PDP-11 style flat memory model to have full control. Although if I ever want full controll in the language I can drop down to inline assembly.
Lisp.
It just feels extremely natural to me, so it’s difficult to pinpoint specific features I like. But two such features stand out: the parantheses-based syntax and the extreme interactivity.
Python
It’s real easy to just launch it and get a script going, no need to wait for and ide or a compiler, there’s alot of nice modules, and it’s really API friendly
I’ve spent more time in the blender python API than I’d like to admit
On the one hand I like Lua for its elegant, minimalistic design. I enjoy writing Lua, most of the time when working on Neovim plugins.
On the other hand I value the raw expressive power of C++. It is a beast, but I enjoy taming it.