THCDenton
cake
link
fedilink
119M

C is fun. Thats why I use it :P

The same way juggling chainsaws is fun I suppose. :)

I really like C because I can just get to the heart of an action and make it happen without much surrounding code.

I could make classes and blah blah blah if I want to make a large, complex program but I’d rather write several small, simple to grok programs which pass information around so each program can do its one simple thing, quickly and easily. Chain the small programs together with bash or something, and bingo, you’ve got a modular high speed system.

I’m not a programmer, actually a mechanical engineer. But the Unix philosophy of simple, modular tools is great, provided one properly checks and sanitizes inputs.

@masterspace@lemmy.ca
link
fedilink
English
99M

That sounds a lot more like functional programming languages / frameworks

What you’re describing sounds like Python. Not really C’s strong suit.

If you haven’t checked it out yet, you certainly should!

I agree with your main point. Python does a great job of replacing lots of tiny, chained scripts. Simple API calls with wget or curl have a place, but can spiral out of control quickly if you need to introduce any grain of control like with pagination, as an example.

Maintaining one Python app (or “script”) can still adhere to the unix philosophy of simplicity but can bend some rules as far as monolithic design is concerned if you aren’t careful.

It all boils down to whether you are introducing complexity or reducing it, IMHO.

I’m not suggesting replacing the small programs with one mega Python script, I meant that even C is not a good language for that either.

If you’re chaining a bunch of stuff together through your shell environment anyway, you’re not using the low level benefits of C, so you’re just punishing yourself with having to implement everything by hand every time! Python is amazing because the syntax is clear and readable and the standard library has nearly everything you’d need if you’re not building a large application.

However since most of these things are going to be one-liners then yeah you may want to just put them in one script!

I’m supporting embedded devices, and I like the performance of C. I’ve used python, it’s meh. At least you don’t have to compile it.

Aha on embedded not much choice there. It’s what keeps C alive and relevant for sure

Rust is starting to show up in embedded. And micropython, though that obviously has some limitations.

Totally, but I’m not aware of anyone using either properly in a truly production environment. Both are more on the hobbyist or tinkering side, or in the Linux space anyway where you can already just do anything.

(From what I’ve seen? Would be thrilled to see examples!)

I really like Micropython too. I made a “game” that communicates state between multiple boards over wifi in almost no time compared to how long it would take in C++.

I know I’m a fanboy, but I fell in love with C from the first time I tried it. I especially like its bare-bones grammar that never gets in your way. I appreciate how much it has taught me about how computers work. It helped me realize my aspirations to be an electrical engineer.

“Somewhere, someone whispers…”

What language was that jpeg compression written in?

You ever heard of lossless compression? Well they developed lossfull anti compression, it compresses and decompresses the images so many times that the added artifacts create a larger file than original ! Impressive ain’t it?

we do live in the future

Impressive

and the Nobel goes to some nerd playing with electrons. Unbelievable

billwashere
link
fedilink
English
219M

Potato

YOU WERE NEVER MEANT TO ACCESS STARCH DIRECTLY

… D?

Imagine having anyone tell you how to access your memory.

I think Linux is even written in C

@dohpaz42@lemmy.world
link
fedilink
English
139M

And Linux was never meant to access memory directly. Boom. Roasted.

davel [he/him]
link
fedilink
English
149M

fry Still not sure if you’re high or trolling.

But I like C, it’s like a smaller Golang

SavvyWolf
link
fedilink
English
79M

🦀

kbal
link
fedilink
59M

C was a nice idea but I guess it just didn’t work out as well as everyone hoped. Ah well, back to BCPL then.

C is meant for embedded stuff. #changemymind

smpl
link
fedilink
English
79M

Because RAM is so cheap, right?

davel [he/him]
link
fedilink
English
14
edit-2
9M
@dohpaz42@lemmy.world
link
fedilink
English
179M

That article is incomplete. Nowhere do I see JavaScript listed.

It seems the cancer has metastasized. First to the backend, now to the entire operating system.

davel [he/him]
link
fedilink
English
15
edit-2
9M

😂

node-os is a full operating system built on top of the linux kernel

Exactly for that a memory safe language would avoid so many security vulnerabilities.

Ease of access to the underlying hardware in your programming language is only ever needed for embedded programming in the current year. Change my mind.

There are actual use cases where direct memory access and pointer magic can be very efficient or almost necessary. We work a lot with large images and basically always the first steps are some pointer operations.

What kind of pointer operations?

@Venator@lemmy.nz
link
fedilink
0
edit-2
9M

Sounds like you just need a bigger graphics card to me. 😂

davel [he/him]
link
fedilink
English
6
edit-2
9M

Every operating system running on bare metal needs access to the hardware. And if not on bare metal, it needs access to the virtual hardware.

It’s required for drivers too.

That’s basically embedded programming, or pretty similar.

I have used both C and Rust for embedded. Rust is significantly more enjoyable. https://embassy.dev/

C is good for nothing.

umulu
link
fedilink
69M

Even for small 4/8 bit soc systems?

I had the idea that C was the go-to language for that.

Yes: https://github.com/avr-rust

When you’re writing code involving global state and interrupts, and any access to an integer larger than a u8 needs to be surrounded by cli() and sei() just for guaranteed atomicity, then you will truly come to value rust’s statically enforced thread / memory safety.

There’s Assembly for those

@fl42v@lemmy.ml
link
fedilink
2
edit-2
9M

Are those still in use? With how cheap modern MCUs got, it kinda seems like it often makes more sense to get smth a bit more powerful and get the benefits of overall easier and faster development. May be wrong here, tho – it’s not like I compared numbers or something

Addit: I mean, 8 bit may easily still be a bit cheaper, yet corps will likely spend more than the difference in price paying devs

It probably won’t do anything less than 32bit, so that’s at least one thing C is good for.

@excitingburp @NocturnalMorning “C is good for nothing because I don’t enjoy it” yea that’s some big brain logic right there

Rust is making inroads.

Or micropython. That might sound nuts, but consider that Python was released two years after the 486 and two years before the Pentium. The RP2040 microcontroller has a far higher clock rate than those, has dual cores, and costs a dollar. It may lack RAM compared to some of those desktops at the time, though.

For years I wrote embedded C for 8 bit microcontrollers used in industrial controls.

Never again.

Rust is by far a better language for embedded. The only times I would consider it reasonable to write embedded code in C is if you’re doing it for fun, or you depend on an existing and well tested / audited codebase or library and your application logic is less complicated than rust to C FFI.

Even then, you won’t find me contributing to that effort.

Yesterday I tried using an honest-to-god pointer pointer pointer, and I think the compiler refused on moral grounds.

Ah, a three star programmer.

Sonotsugipaa
link
fedilink
English
109M

w… windows 10?

W10: :(

I think I saw online that Windows was written in C++

Pxtl
link
fedilink
English
119M

C++, but a very ugly and oldschool dialect of it.

Yes, you already said C++, no need to repeat yourself :P

@pewpew@feddit.it
link
fedilink
4
edit-2
9M

Well… I love C, just the semplicity of the syntax and low level aspect of it makes it the only language you need. F*ck high level languages

low level aspect of it makes it the only language you need

about that https://queue.acm.org/detail.cfm?id=3212479

Pxtl
link
fedilink
English
39M

C is simple in the same way that a circular saw with no safety features is simple. I like having fingers better.

Does anyone even know what Windows is written in?

Well, you know those claims that Java runs on 18 trillion devices? How do you think they got there, hmmmmm?

Skull giver
link
fedilink
20
edit-2
9M

deleted by creator

On the other hand, C# is great

Originally Windows was written in assembly and ran on top of DOS, but since Windows 2000 and XP, it’s been exclusively running on the NT kernel, which is written primarily in C, with some C++ in there as well.

The actual userspace is mostly C++ and C#.

astrsk
link
fedilink
169M

And basically the entirety of dotnet 6 forward is spans. It’s all spans. All the way down.

deleted by creator

Skull giver
link
fedilink
49
edit-2
9M

deleted by creator

True! Their embrace of Rust is certainly heartening to see.

Let’s just hope they don’t follow it up with the other two E’s in their typical playbook.

@masterspace@lemmy.ca
link
fedilink
English
59M

Please do go ahead and name the last open standard that Microsoft intentionally destroyed.

EEE is the fucking boogeyman on Lemmy. You just mention it’s name and a bunch of nerds shit their pants and upvote.

I did upvote… but my pants are pristine

Atom died about 13 months ago.

Just because they’re in a relative lull in the desktop space doesn’t mean they’ve stopped.

There may be good examples out there, but I’d argue Atom isn’t one of them. VS Code was clearly intended to be a spiritual successor with MS branding IMO, it is a fork of Atom, and it is equally open source (MIT license).

@masterspace@lemmy.ca
link
fedilink
English
1
edit-2
9M

Atom usage dropped off dramatically in favour of VS Code or the fully open source VS Codium, there’s no point in Github writing it’s own code editor when it’s hosting a much more popular, more powerful, and equally open source editor in one of its repos.

Github had been funding development of Atom until MS bought them, put Atom on maintenance mode for 4 years, then killed it.

@masterspace@lemmy.ca
link
fedilink
English
19M

2002?

Unless I’m missing something, the most recent example there is from 2002 which, to my own horror, was more than 20 years ago.

deleted by creator

witchcraft

Makes sense

C or C++ usually

yeah but which craft?

There first version of sudo rewrite in Rust has been released last year: https://www.memorysafety.org/blog/sudo-first-stable-release/

That’s really cool! Rewriting sudo in Rust actually feels like a no brainer tbh

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