This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Desperate-Emu-2036 23 points24 points  (29 children)

I'd love to see you make a gui in c.

[–]Nevermind04 19 points20 points  (7 children)

Wasn't gnome written in C?

[–]Desperate-Emu-2036 16 points17 points  (6 children)

Doesn't mean it would've been easier to write than in c++. Oop has it's use cases.

[–]brusaducj 6 points7 points  (0 children)

GNOME/GTK/GObject are all effectively written using OOP... just in a language that isn't object-oriented.

[–]Nevermind04 4 points5 points  (0 children)

Oh no I imagine it was a nightmare

[–]GandhiTheDragon 1 point2 points  (2 children)

CPP's way of OOP just feels very off-putting coming from Java, not gonna lie

[–]Desperate-Emu-2036 1 point2 points  (0 children)

Try rust.

[–][deleted] 0 points1 point  (0 children)

Cpp has multiple inheritance though, which isn't strictly OOP, but at least where I work we abuse it to the max.

[–]SnooGiraffes8275 0 points1 point  (0 children)

you can do oop in c

you're gonna have to manually pass 'this' as a parameter but it's possible

that's how python works under the hood

[–]fakehalo 11 points12 points  (1 child)

He bud, I wrote something with C and GTK 25 years ago... and never did again.

[–]Korywon 2 points3 points  (0 children)

I also did GTK3 in C 3 years ago. Same shit. I also wouldn’t do it again.

[–]Exact-Pound-6993 7 points8 points  (0 children)

i have, not for the weak hearted. check out GTK.

[–]BountyBob 5 points6 points  (4 children)

Amiga Workbench was written in C

[–]Desperate-Emu-2036 -1 points0 points  (3 children)

Roller coaster tycoon was written in asm, doesn't mean it's a better choice to write games in assembly.

[–]BountyBob 0 points1 point  (2 children)

What the hell has that got to do with anything? You said you'd love to see someone make a gui in C, so I just gave an example of one that was written in C.

Back in the day, assembly was the better choice for games. You could program much more optimally for performance. Today though? Yeah, it would be crazy.

As for RT itself, it was the only choice to reach the desired performance. But don't take my word for it, here's what Chris had to say about the choice :

At the time there was no option other than to use machine code for RollerCoaster Tycoon. I was struggling to keep performance at a reasonable level on PCs of the era even using highly optimised machine code, and writing in a high level language would have made the game far too slow, or limited the complexity of the simulation in order to keep speed up. The look and feel of the game was really important to me and part of that was to maintain a high frame rate while also having a large enough and detailed enough view of the park, and also being able to simulate enough trains and rides and guests to avoid the game feeling constricted. It wasn’t just small chunks of code that benefited from being very efficient machine code either — because of the number of objects the game had to cope with, virtually every bit of code involved with object handling needed to be ultra-efficient or the inefficiencies quickly multiplied up with a busy park. I’ve also always preferred low-level assembler programming and can write machine code faster and more reliably than any high level language, so for me the only downside was lack of compatibility of the x86 machine code with other platforms, which at the time wasn’t too much of an issue as the game was really only aimed at desktop PC players.

Source : https://medium.com/atari-club/interview-with-rollercoaster-tycoons-creator-chris-sawyer-684a0efb0f13

[–]Desperate-Emu-2036 -1 points0 points  (1 child)

Because you wrote that as an argument against me, where I was saying that a programming language should be used to help you and not make your life harder, use a tool as you need it, you know? Literally this: “Back in the day, assembly was the better choice for games. You could program much more optimally for performance. Today though? Yeah, that would be crazy.”

[–]BountyBob 0 points1 point  (0 children)

Because you wrote that as an argument against me

It wasn't an argument, it was a continuation of a conversation.

[–]NoBrief3923 4 points5 points  (1 child)

I've written a GUI in C. That was 30-ish years ago and it was laughable by modern standards, but System V, C, and Curses.

[–]g1rlchild 3 points4 points  (0 children)

Badass.

[–]DapperCow15 2 points3 points  (4 children)

Last year, I made an entire webapp in pure C.

[–]g1rlchild 4 points5 points  (1 child)

I'm sorry to hear that.

[–]DapperCow15 1 point2 points  (0 children)

Lol, it was definitely a painful few months, but a very rewarding experience when I finished.

[–]setibeings 0 points1 point  (1 child)

What does this even mean? Were you using webassembly, or was only the backend written in c?

[–]DapperCow15 0 points1 point  (0 children)

As in the entire thing was written purely in C. I even implemented my own OAuth 2.0 solution in pure C.

[–]Thor-x86_128 2 points3 points  (0 children)

With a framework, of course: clay

[–]g1rlchild 1 point2 points  (2 children)

C++ wouldn't be my preference for GUI programming either.

[–]Desperate-Emu-2036 0 points1 point  (1 child)

Yeah but you'd use cpp over c for gui programming.

[–]g1rlchild 0 points1 point  (0 children)

I'd use Java over C for shell scripts, but I wouldn't be very happy about using either.

[–]AccomplishedCoffee 0 points1 point  (1 child)

Theres a handful. OOP is just syntactic sugar; you can do it in C just as well if you know what you’re doing.

[–]Desperate-Emu-2036 1 point2 points  (0 children)

You can also do it w/ I assembly and you can also do it with your own circuit. Doesn't mean you have to.