Everything I’ll ever make will be done in C. Try and stop me.

urpasswdistrash
link
fedilink
English
111Y

So true man

𝘋𝘪𝘳𝘬
link
fedilink
English
721Y

Finding my own old projects: “What the hell did this guy do and why does it work?”

nicman24
link
fedilink
381Y

that is me with regex that I wrote from scratch like 5 mins ago

@tool@lemmy.world
link
fedilink
English
11Y

Every regex that I write ends up looking like line noise or the holy tome to summon Chtulu.

Bipta
link
fedilink
81Y

Commenting regex fucking sucks. There’s really no good approach.

“Finally! It works! I’ll never touch it again! I’ll just move it in a variable and–… WHYYYY???!?!11!”

fmstrat
link
fedilink
21Y

Its always the backslash before the forward slash. Every. Time.

That’s why I like to include a comment with a link to an example on regex101.com.

fmstrat
link
fedilink
31Y

This is so smart. I’m stealing this.

Nothing like good old C with Classes

nicman24
link
fedilink
401Y

bash is veeery old and it implements all of posix.

Noodlez
link
fedilink
221Y

Bash’s posix mode still has a lot of bashisms. The only way to test true posix compliance is to test with other shells like dash and ash. I have found this is the case a lot of time. People will say it’s POSIX compliant shell, but it’ll obviously only be tested in bash Like at that point just make it a bash script, since pretty much every system under the sun has it.

nicman24
link
fedilink
61Y

there is always shellcheck it points them out to you

narshee
creator
link
fedilink
41Y

I was thinking about bash scripts that use bash specific builtins. Some of those require >= x version.

nicman24
link
fedilink
61Y

even <<< is like 10 years old

narshee
creator
link
fedilink
61Y

Yeah. The only language I didn’t have the right version for in the past was python. I just wanted to make a joke about standards vs implementations.

JoYo
link
fedilink
English
31Y

these are the same picture.

Carlos Solís
link
fedilink
English
321Y

And don’t even get me started with C# and Node.js projects, chances are you will need to reimplement the entire application just to get the project out of vulnerable library versions.

Ehem… I think you mean job security.

Precisely, it’s a feature, not a bug

@marcos@lemmy.world
link
fedilink
English
81Y

It doesn’t matter what version of your dependencies you use if your code is always broken.

(But anyway, C developers tend to avoid the older standards…)

@TheCee@programming.dev
link
fedilink
English
21
edit-2
1Y

install minor cc update

compiler exploits undefined behavior as it always was technically allowed to

Checkmate, Cniles!

@SmoothSurfer@lemm.ee
link
fedilink
English
11Y

I am sick of these meme. Of course we know c is better than python on many aspects but python is also. Lets say you are building… I an continuing, I hope you are capable of continuing it by yourself. Everyone knows which is better for their particular needs, so just let these memes go. We can be more creative with memes

@miname@feddit.de
bot account
link
fedilink
English
111Y

No

Ew, used languages? Yuck! Gimme a brand, spanking new language, hot off the factory floor.

@d_k_bo@feddit.de
link
fedilink
English
341Y

Rust has pretty strong stability guarantees. Backwards incompatible changes are only made using “editions” where every compiler version supports all previous editions and editions are fully interoperable.

https://doc.rust-lang.org/stable/edition-guide/editions/index.html#what-are-editions

@PeterPoopshit@sh.itjust.works
link
fedilink
English
8
edit-2
1Y

The versions still make me reluctant to try rust. I’m sure it’s reliable in theory but I’m always getting cockblocked when someone’s python project doesn’t work because of dependencies and different versions. I once remade a python 3d object format converter in c++ because that was easier than a) fixing whatever dependency and runtime version shenanigans or b) using whatever bullshit ass Windows-only propriety software most people used to make that file conversion

voxel
link
fedilink
1
edit-2
1Y

rust doesn’t install dependencies globally, and packages or versions can’t be deleted from crates.io (they are instead yanked which prevents them from being used in new projects, while throwing a warning in existing ones)
rust editions are fully compatible with each other so you can use 2015 crate in a 2021 project and vise versa.
rust also allows having multiple versions of dependencies at the same time.
if crate A depends on B 0.1 and crate C depends on B 0.2, rust will download and use both versions of B.
you can run into issues if:

  • …you’re using c dependencies
  • …you have incompatible crate versions; cargo treats different versions as completely separate crates (please note that this is not a big issue, this shouldn’t scare you off; for example if there’s a crate A that depends on crate B 0.1 and provides fn A::dostuff(B::TypeFromB) and you have A and B 0.2 specified as dependencies, you won’t be able to use your B::TypeFromB as an argument in A::dostuff(...), and you’ll have to downgrade your version of B to 0.1 or ask the crate developer to update their library)
  • …you have a multi-crate cargo workspace or monorepo and forgot to specify resolver="2" (it uses resolver="1" by default for compatability, which is incompatible with a lot of crates)
@Rian@lemmy.sdf.org
link
fedilink
English
111Y

I use both python and rust extensively and they are literally day and night when it comes to dependency issues. The only problems I’ve ever had with rust are when there is a non-rust dependency that’s not cross platform (which would be a problem in c as well). The editions (which are different from versions) are nothing to be afraid of either, iirc a rust 2021 project can depend on 2018 and 2015 libraries without issues.

darcy
link
fedilink
English
11Y

@Rian is correct. the only dependency problems ive had are relating c libraries

@Gecko@lemmy.world
link
fedilink
English
31Y

Also, you can just download an older version of the toolchain and use that to compile the project. If the project is properly setup it’ll tell you the toolchain version it used. If not you can probably guess by the time of the last commit ^^

Black616Angel
link
fedilink
English
161Y

Better not pay in cash, if you’re so afraid of change, I mean.

Why would someone who is afraid of change pay cash? Wouldn’t they be given change?

Yep two other comments imply the change is moving toward paying with cash, with it is the opposite we are doing now?

Yes. That is the joke.

fmstrat
link
fedilink
-11Y

/c/whooosh anyone?

Call me antiquated, but I still don’t love Rust for these reasons. I don’t dislike it, and I recognize it solves some very real problems around memory management. Whether I like it or not it is probably the future… But Cargo is incredibly opinionated, essentially obligatory, the compiler is huge…

It’s not something you could bootstrap on a glorified microcontroller running MINIX or something. I’ll just say that. And that’s something I really really love about C.

voxel
link
fedilink
1
edit-2
1Y

compiler is based on llvm and is relatively lightweight (llvm is the “huge” part which to be fair is also used in clang)

You can add PHP to the left picture. It doesn’t even require compile or special deployment pipelines.

Create a post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
  • 1 user online
  • 77 users / day
  • 211 users / week
  • 413 users / month
  • 2.92K users / 6 months
  • 1 subscriber
  • 1.53K Posts
  • 33.8K Comments
  • Modlog