Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Macichne Leainig
Jul 26, 2012

by VG
Return to binary input. Assign one team to 1, another to 0. Each individual team has to work together to decide when it is appropriate to input their bit, and they have to work together to decide what the sequence of input is.

Adbot
ADBOT LOVES YOU

chglcu
May 17, 2007

I'm so bored with the USA.

Pollyanna posted:

Video games can involve some very complex, high level logic and architecture. How do you handle that with C, and how does that differ from app development’s requirements?

Keeping this a bit brief, since I'm at work atm, might try to expand on it later.

The reason I wouldn't want to do non-game app development in C is mostly that there are decent frameworks in other languages that make things simpler, and apps generally don't need the performance of games. The framework bit’s also true for games, but I actually enjoy writing the lower-level stuff there, and I was talking about what I use when programming for enjoyment. At my real job - also in games - we use C++, and after using it for over 20 years, I'm pretty sick of the relative complexity and cognitive load.

Most of the C++-y stuff I need can be accomplished with function pointers and macros if it's actually necessary. C was used for games before C++ was, and it's been used for entire operating systems. It's not incapable of handling complexity. There are definitely things C++ makes easier, but I prefer the simplicity of C when programing for fun.

Macichne Leainig posted:

I'm also curious, do you do your own engine kind of stuff? I was reading about how the dev for HROT wrote his own engine for that in Pascal and it gives me some serious impostor syndrome because most of what I do is UI mockup garbage (i.e. not even functional half the time)

Yeah, in my personal projects I've started doing my own engine-level stuff since the available engines all annoy me in one way or another, though as mentioned, it's for fun. If I was actually trying to ship something in a reasonable amount of time and make money, I'd likely use an off the shelf engine and whatever language that required, and deal with the annoyances.

chglcu fucked around with this message at 20:41 on Jul 12, 2023

ryanrs
Jul 12, 2011

I mostly do microcontroller programming. Everything is still small and close to the metal, but now with 32-bit ARM cores and dozens of kbytes of memory, so not totally cramped. C and (simple) C++ feel just right for this environment.

Pollyanna
Mar 5, 2005

Milk's on them.


I tried doing game dev as a hobby but quickly realized that I don’t have any good ideas. :v:

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Pollyanna posted:

I tried doing game dev as a hobby but quickly realized that I don’t have any good ideas. :v:

You can just remake existing ideas. It's a hobby, you're allowed to be unoriginal. :shobon:

Pollyanna
Mar 5, 2005

Milk's on them.


NO :mad:

wilderthanmild
Jun 21, 2010

Posting shit




Grimey Drawer
I constantly dabble in game making, but I also refuse to learn any existing engine so my project folder is littered with half written game engines.

Pollyanna
Mar 5, 2005

Milk's on them.


I’ll be hosed if I write a game engine, that poo poo takes entire divisions.

chglcu
May 17, 2007

I'm so bored with the USA.
Writing a general purpose engine does, yeah. Writing only what you actually need for a given game and then building on it in the future, while still a lot of work, is doable, though.

StumblyWumbly
Sep 12, 2007

Batmanticore!
You start simple, with a square moving around a 2d map, then you just gradually add in the 3rd dimension and more polygons until you've recreated UnReal.
That is how a demo becomes a product!

wilderthanmild
Jun 21, 2010

Posting shit




Grimey Drawer

chglcu posted:

Writing a general purpose engine does, yeah. Writing only what you actually need for a given game and then building on it in the future, while still a lot of work, is doable, though.

Yeah, I'm not writing like Unity here. I'm writing like the foundation of a very specific games supporting a narrow set of features but never actually making content beyond placeholders for testing.

Pollyanna
Mar 5, 2005

Milk's on them.


The game is the content, though. You only write just enough engine to go wide on the content.

Bongo Bill
Jan 17, 2012

"Engine" is the most overloaded term in game programming. A generalizable underlying system providing the common structure between several games is a very handy thing to have in a stable state before you start working on the game itself. If you're experienced enough to know what you need from that system, you can even build it in advance, but you get a better result if you've got the needs of an actual game driving out the engine's features. However, it's difficult to make the engine and the game at the same time, which is a particular problem for one-programmer projects. It's a difficult paradox and I think the only thing for it is to suffer until you learn what you need to know.

However, it doesn't take much to make an engine. At minimum, you're going to want things like: input, rendering, audio, asset loading, state management (hint: use ECS), and perhaps some debugging hooks. There are better and worse ways to make each of those parts, and unfortunately, all this poo poo is pure architecture, so you might end up locked into some bad designs.

Whether you use an existing engine or make your own, it's important that it be a good fit for the scale of the project: the scale of the project determines the size of the team, and the size of the team determines how deeply each programmer can specialize, and therefore what kind of power they can handle.

An inexperienced programmer should not attempt to make an engine, but might benefit a lot from using somebody else's, if it's a good one. Of course, even building a game without an engine can be very educational.

Falcon2001
Oct 10, 2004

Eat your hamburgers, Apollo.
Pillbug
A recent series of meetings has me wondering if my current team is even a sane place to stay in the near future, and now I realize I don't have a lot of idea what other options I can look into.

I'm currently a python dev (I've done some C# but not professionally) and I've been recently promoted at a FAANG and I'm one of the stronger devs on my team. My background is in incident management work, which has a lot of useful overlap with any sort of production service supporting team in terms of 'how do you get poo poo done in enterprise'. I haven't got any frontend experience unfortunately, but I've done a lot of infrastructure management work in one way or another (both programmatic and just general sysadmin stuff historically).

What sort of job titles should I be looking for? I haven't actually had to job hunt as a dev yet, managed to get my current and previous gigs through industry contacts (and obviously I'll start talking to them again too). SRE seems promising as a general sort of 'must write code but understand uptime' sort of deal, but I'm trying to avoid getting back into massive oncall again after a decade of waking up at 3am.

thotsky
Jun 7, 2005

hot to trot

Falcon2001 posted:

A recent series of meetings has me wondering if my current team is even a sane place to stay in the near future, and now I realize I don't have a lot of idea what other options I can look into.

I'm currently a python dev (I've done some C# but not professionally) and I've been recently promoted at a FAANG and I'm one of the stronger devs on my team. My background is in incident management work, which has a lot of useful overlap with any sort of production service supporting team in terms of 'how do you get poo poo done in enterprise'. I haven't got any frontend experience unfortunately, but I've done a lot of infrastructure management work in one way or another (both programmatic and just general sysadmin stuff historically).

What sort of job titles should I be looking for? I haven't actually had to job hunt as a dev yet, managed to get my current and previous gigs through industry contacts (and obviously I'll start talking to them again too). SRE seems promising as a general sort of 'must write code but understand uptime' sort of deal, but I'm trying to avoid getting back into massive oncall again after a decade of waking up at 3am.

Devops would work.

wilderthanmild
Jun 21, 2010

Posting shit




Grimey Drawer

Pollyanna posted:

The game is the content, though. You only write just enough engine to go wide on the content.

See I don't really like writing stories or making characters, but when I play a game I always think about "I wonder how they handle pathfinding", "I wonder how hard it is to set up n-body physics in this game", or "What does the code that makes this pawn decided to take a poo poo look like?"

Pollyanna
Mar 5, 2005

Milk's on them.


Ah, you’re John Carmack.

Hughlander
May 11, 2005

I mean it’s basically what people preach these days. Do you want to make a game? Grab an engine and make a game. Do you want to make an engine? Fine make an engine but don’t trick yourself that you’re doing it to make a game.

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003
i remember learning three key principles of oop: encapsulation, polymorphism, and inheritance

but now we know:
- encapsulation is just modularity, and non-oo languages have this too. also mutable state is bad
- parametric polymorphism is independent of oop, we are only really talking about subtype polymorphism here
- inheritance is usually a bad idea

the only true oop feature is dynamic dispatch, and in mainstream oo languages that means nominal subtyping which means class inheritance hierarchies. and we have already established that these are bad. therefore oop is bad, qed

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

wilderthanmild posted:

See I don't really like writing stories or making characters, but when I play a game I always think about "I wonder how they handle pathfinding", "I wonder how hard it is to set up n-body physics in this game", or "What does the code that makes this pawn decided to take a poo poo look like?"

NPCs that shitpost to Twitter. What a time to be alive.

Canine Blues Arooo
Jan 7, 2008

when you think about it...i'm the first girl you ever spent the night with

Grimey Drawer

DELETE CASCADE posted:

i remember learning three key principles of oop: encapsulation, polymorphism, and inheritance

but now we know:
- encapsulation is just modularity, and non-oo languages have this too. also mutable state is bad
- parametric polymorphism is independent of oop, we are only really talking about subtype polymorphism here
- inheritance is usually a bad idea

the only true oop feature is dynamic dispatch, and in mainstream oo languages that means nominal subtyping which means class inheritance hierarchies. and we have already established that these are bad. therefore oop is bad, qed

I wasn't in the industry as OOP became The Thing™ - I was born into it being the defacto, so my perspective is skewed here, but my take is that things like Inheritance becoming a staple pattern of OOP in it's hayday meant that everyone seemed to want to turn every problem they could into a nail that the Inheritance Hammer can smash away at.

I don't think Inheritance necessarily is bad on it's face - it's a feature with tradeoffs, and ought to be wielded carefully. Maybe more carefully then it has been in the past.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Implementation inheritance (and the corresponding "design all your classes so that some other programmer can come along and override half the public methods while leaving the other half untouched and your class still functions in a useful way" bullshit) is a total misfeature. It has zero good uses, approximately one okay use, and a bunch of potential for misuse. (The one okay use is facilitating code re-use within a strictly-controlled hierarchy, which is an okay workaround, but mostly reveals that your language is lacking in other good ways to facilitate code re-use).

Subtype polymorphism is pretty good, though.

Love Stole the Day
Nov 4, 2012
Please give me free quality professional advice so I can be a baby about it and insult you
This is one of the things I've been interested in seeing with Golang and Rust: because they don't do classes, I see people using OOP patterns in there... but since classes and inheritance work so differently, it feels like a round peg in a square hole. I wonder what patterns will be evangelized as those things become more ubiquitous. Then again, we should separate concerns and organize things in a way other engineers can understand... and OOP patterns are what they understand, so it's not wrong, but culture changes faster than language specs.

smackfu
Jun 7, 2004

What do you call the thing in stupid Java programs where every single class has a matching interface even if there is only one implementation? I hate that.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

smackfu posted:

What do you call the thing in stupid Java programs where every single class has a matching interface even if there is only one implementation? I hate that.

C# does that too, it's a pattern for testing so every class can be mocked. I don't think there's a pithy name for it.

I hate overuse of DI containers where you eventually reach the point where debugging consists of setting random breakpoints and hoping that's the one that you need. I was just dealing with that on a very large code base that I was unfamiliar with. Exceptions would get thrown deep in the bowels of the application and get swallowed and I couldn't step my way into the problem. Took two days to realize it was a missing file because I didn't have git lfs installed.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Splitting interfaces and implementations also helps with build times - if you have to compile a hundred different files sequentially (or worse, all at once in a single compiler invocation because they're circularly dependent), that takes forever compared to compiling just the interfaces all in parallel, followed by all the implementations (again in parallel).

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Jabor posted:

Splitting interfaces and implementations also helps with build times - if you have to compile a hundred different files sequentially (or worse, all at once in a single compiler invocation because they're circularly dependent), that takes forever compared to compiling just the interfaces all in parallel, followed by all the implementations (again in parallel).

That might be true but I don't think it's the reason anyone does it

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

New Yorp New Yorp posted:

That might be true but I don't think it's the reason anyone does it

It's literally the reason I'm doing it right now to the software I'm working on, FWIW.

Judiciously, of course - just to the problem children that show up all on the time on our build critical paths.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
Program to an interface, and not an implementation! :byodood:

I will not pretend I'm not guilty of this as well.

smackfu
Jun 7, 2004

New Yorp New Yorp posted:

C# does that too, it's a pattern for testing so every class can be mocked. I don't think there's a pithy name for it.

Yeah, I vaguely remember that being a thing but now everyone using Java just uses mockito which I assume uses reflection to do this magically for you.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

smackfu posted:

Yeah, I vaguely remember that being a thing but now everyone using Java just uses mockito which I assume uses reflection to do this magically for you.

Only for extendable classes. Final classes cannot be mocked, for example.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Love Stole the Day posted:

This is one of the things I've been interested in seeing with Golang and Rust: because they don't do classes, I see people using OOP patterns in there... but since classes and inheritance work so differently, it feels like a round peg in a square hole. I wonder what patterns will be evangelized as those things become more ubiquitous. Then again, we should separate concerns and organize things in a way other engineers can understand... and OOP patterns are what they understand, so it's not wrong, but culture changes faster than language specs.

Go has something similar which is to embed structs and/or interfaces but yeah that’s full of awful footguns especially when using anything from the atomic or sync packages and definitely if the type has custom marshaling or unmarshalling behavior.

Go’s equivalent in terms of bad stuff that’s cargo-culted is micro-interfaces repeated everywhere because idiomatic Go says you should “accept interfaces and return structs.”

Each accepted type that’s not a primitive becomes a ThingDoer and the compiler complains if you’re not passing a struct that implements it rather than complaining that a type doesn’t explicitly implement an interface.

It makes actually finding implementations of an interface extremely painful even with an IDE that has “go to implementation” because guess what gomock does when you’re generating mocks?

Yeah :sigh:

Judge Schnoopy
Nov 2, 2005

dont even TRY it, pal

Blinkz0rz posted:

Go’s equivalent in terms of bad stuff that’s cargo-culted is micro-interfaces repeated everywhere because idiomatic Go says you should “accept interfaces and return structs.”


Yeah :sigh:

There's some bad idiomatic go, and this is absolutely the worst one. Luckily I've never seen people actually doing this because it's just so insane and hard to work with.

Clanpot Shake
Aug 10, 2006
shake shake!

Judge Schnoopy posted:

it's just so insane and hard to work with.

But enough about Go

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Judge Schnoopy posted:

There's some bad idiomatic go, and this is absolutely the worst one. Luckily I've never seen people actually doing this because it's just so insane and hard to work with.

It’s not awful when you think about DI and being able to couple use to behavior rather than identity but it can absolutely miserable to jump into a codebase where it’s been applied everywhere.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Mocking should be a tool of last resort when you can't figure out any other way to test some code, and as such going out of your way to ensure that every class in your codebase can be mocked is just a bad idea.

Xarn
Jun 26, 2015
Probation
Can't post for 2 hours!
:hmmyes:

Bongo Bill
Jan 17, 2012

Mocking is the test strategy to apply when the purpose of the component is to communicate with another component in a particular way, and that second component is either not under your control, fundamentally has side effects, or both. Inject a mock of the inconvenient dependency into the component under test and assert that it interacts with the mock in a manner that conforms to your assumptions about the real version. Almost every system that does something useful will contain components best tested in a mockist way, but it shouldn't be your go-to. Put as much as you can into pure functions.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Test fakes are superior to mocks in just about every single way. The only exception is the "nobody has written a test fake for this particular inconvenient dependency yet and I don't wanna do it just for this test" scenario.

Adbot
ADBOT LOVES YOU

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Jabor posted:

Test fakes are superior to mocks in just about every single way. The only exception is the "nobody has written a test fake for this particular inconvenient dependency yet and I don't wanna do it just for this test" scenario.

If it weren't proprietary code I'd post an example of just how awful test fakes get in a Go codebase. That's not to say they're not useful for simple logic but they have a tendency to balloon miserably and can end up taking a lot of work to maintain the internal bits that actually allow you to validate the expected behavior under test.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply