|
Games are extremely big, with lots of stuff that doesn't have anything to do with math or rendering. You don't need strong math chops to work in games (can't hurt, though). Source: 18-year veteran who is pretty sure I might know what a dot product does, maybe
|
# ? Feb 19, 2024 01:31 |
|
|
# ? May 2, 2024 22:40 |
|
I was thinking alone the lines of Game Engine developers and the like. Maybe they don't get paid that well. I would assume any hedge funds using C++ have probably worse coding standards than Enterprise apps. But I have nothing to go on for that thinking. Also, if I told you what company I worked at you'd probably say I work in the Games industry. I just don't do anything that involves rendering a triangle onto the screen. Okay that's it for me. Didn't want to derail this thread too much.
|
# ? Feb 19, 2024 09:17 |
|
Strong Sauce posted:I was thinking alone the lines of Game Engine developers and the like. Maybe they don't get paid that well. I would assume any hedge funds using C++ have probably worse coding standards than Enterprise apps. But I have nothing to go on for that thinking. engine devs dont need math for the most part either. throwing triangles at the screen is such a small part of games, if it werent for the very real visibility of it in the product id say it doesnt even matter. for most teams that part of the thing is a solved problem by epic or unity anyway. very few people writing commercial renderers. fewer need to and should be. games is about managing state with hard (soft) performance limits. typically state on a single node [even for most multiplayer games]. and copious amounts of UI, sometimes about that state but often instead about other state.
|
# ? Feb 19, 2024 13:53 |
|
Larger and more established hedge funds will have better software development practices, or at least will be in the process of improving. A lot of the code they write is throwaway so that tends to be messier but the reusable components will generally have some sort of reasonable standards.
|
# ? Feb 19, 2024 15:46 |
|
my friends in finance tell me that their C++ codebases are a nightmare of header-only template metaprogramming that only the Russian programmers at the company can understand if nothing else that sounds like a particular flavour of fun
|
# ? Feb 19, 2024 15:53 |
|
Some of that's what you need to do to get the performance, and some of it's the consequence of leaving newly minted math PhDs unsupervised.
|
# ? Feb 19, 2024 15:57 |
|
ultrafilter posted:Some of that's what you need to do to get the performance, and some of it's the consequence of leaving newly minted math PhDs unsupervised. ...this sounds like a comment on the STL, except I guess the newly minted part (and maybe the performance part).
|
# ? Feb 19, 2024 16:04 |
|
Strong Sauce posted:Thanks everyone for your sympathetic words. I kinda avoided this thread today because I was pretty exhausted from dealing with C++ at work that I wrote that out of frustration and didn't want to deal with anything C++ today. Just get a job doing embedded systems development with a company like mine who still uses C++99, we don't have to deal with any of that poo poo
|
# ? Feb 19, 2024 18:41 |
|
Still doing C++98 sounds miserable. I am generally angry about some things in the newer standards (goddamn import std.compat being superset of import std), but they are still a massive improvement.
|
# ? Feb 20, 2024 16:06 |
|
Xarn posted:Still doing C++98 sounds miserable. I am generally angry about some things in the newer standards (goddamn import std.compat being superset of import std), but they are still a massive improvement. I had to install VS2008 recently to do an eval of a C++03 codebase and it's dire. Remember faking static asserts with negative array indices?
|
# ? Feb 20, 2024 17:22 |
|
more falafel please posted:I had to install VS2008 recently to do an eval of a C++03 codebase and it's dire. Remember faking static asserts with negative array indices? I used to do that with enums and division by 0.
|
# ? Feb 20, 2024 22:24 |
|
Reading a few pages back about CS and universities and I realize I will never ever be able to do any of that, it all sounds dreadfully boring. I'm also too old. I only do some programming stuff because it's interesting, but the higher education scene sounds like aliens talking about concepts beyond my feeble brain.
His Divine Shadow fucked around with this message at 08:15 on Mar 15, 2024 |
# ? Mar 15, 2024 08:13 |
|
His Divine Shadow posted:Reading a few pages back about CS and universities and I realize I will never ever be able to do any of that, it all sounds dreadfully boring. I'm also too old. I only do some programming stuff because it's interesting, but the higher education scene sounds like aliens talking about concepts beyond my feeble brain. What kind of programming do you like to do?
|
# ? Mar 15, 2024 14:30 |
|
I'm trying to write mods/change code in nethack, I have built it successfully on ubuntu, but what is the process of rebuilding it after I have edited the source code? Just do make install again? https://github.com/NetHack/NetHack
|
# ? Mar 16, 2024 02:04 |
|
icantfindaname posted:I'm trying to write mods/change code in nethack, I have built it successfully on ubuntu, but what is the process of rebuilding it after I have edited the source code? Just do make install again? Typically running make will build the binaries, while make install will copy those binaries to an install directory like /usr/local/bin. edit: make install will also build the binaries, but typically you do those separately because make install is typically run with elevated privileges.
|
# ? Mar 16, 2024 02:50 |
|
So it will just replace the existing binaries in /usr/local/bin?
|
# ? Mar 16, 2024 02:51 |
Usually you can configure where it will install to, in some way. If the package comes with a 'configure' script that typically has an option for that, and otherwise it will be a variable in a Makefile.
|
|
# ? Mar 16, 2024 06:37 |
|
icantfindaname posted:So it will just replace the existing binaries in /usr/local/bin? nielsm posted:Usually you can configure where it will install to, in some way. If the package comes with a 'configure' script that typically has an option for that, and otherwise it will be a variable in a Makefile. This, but if you're iterating on these changes (making a change, testing it, making another change, testing it) there's no reason you have to do make install. The binaries will be built somewhere in the source directory (probably in the same directory as the makefile, but every project is different) and you can just run it from there.
|
# ? Mar 16, 2024 16:13 |
|
Alright, thanks
|
# ? Mar 16, 2024 23:20 |
|
Is there some way of disabling clang diagnostic completely for a project in VSCode? I have some broken, bad code examples in .c files and the errors generated by clang are extremely annoying. E: apparently this magic in .vscode/settings.json works and shuts up the editor: JSON code:
Ihmemies fucked around with this message at 13:45 on Mar 17, 2024 |
# ? Mar 17, 2024 13:37 |
|
Why not just exclude the directory they’re in? I assume you haven’t intermingled intentionally bad sample code with, like, your primary source files.
|
# ? Mar 17, 2024 18:43 |
|
rjmccall posted:Why not just exclude the directory they’re in? I assume you haven’t intermingled intentionally bad sample code with, like, your primary source files. It is a LaTeX project and I am not very good at figuring out how to exclude stuff. I was embedding a few bad memory management examples to my work, but clangd cheerfully wanted to complain how many errors my .c files have…
|
# ? Mar 17, 2024 18:52 |
|
Why would clang see files in a LaTeX project?
|
# ? Mar 17, 2024 18:54 |
|
ultrafilter posted:Why would clang see files in a LaTeX project? I don’t know an answer to that either. The project is pulled from our university’s gitlab repository, which contains a LaTeX project for thesis work. I am not very good at this, I just didn’t want to fight with Word to produce a thesis in the style university requires. As a bonus Git is easy to use, especially if you write one sentence per one line.. The simplest solution to the problem was separating content from style, and that is what LaTeX is for. Anyways with that project-specific settings.json I get no more errors from the .c files.
|
# ? Mar 17, 2024 18:58 |
|
Alright, if there are no actual source files in your project, excluding all C warnings is reasonable enough.
|
# ? Mar 17, 2024 19:12 |
|
rjmccall posted:Alright, if there are no actual source files in your project, excluding all C warnings is reasonable enough. Well they are actual .c source files, with proper syntax. But due to space reasons it does not make sense to include complete source files with includes and headers, so the .c files contain only the essential code.
|
# ? Mar 17, 2024 19:47 |
|
If the purpose of those source files is to be included as code listings in your LaTeX document there might be benefit in leaving those source files whole and slicing out only the relevant parts you need. That way, your code listings are always known to compile or otherwise be testable as your project develops. The simplest but most brittle approach is to specify the relevant lines that you want in your document using linerange if you're using lstinputlisting, but of course that's sensitive to minor changes in your source file. If you're okay with using up-to-the-minute releases, looks like minted is working on snippets based on in-file delimiters right now. (This is super handy in mdbook so I'm surprised it took this long for something like this to appear in latex-land.)
|
# ? Mar 17, 2024 20:54 |
|
Yes, those are code listings in my LaTeX document, and I am using lstinputlisting. I did not realize it was possible to only display sections of the source code file in the document, thanks. I'll look into that
|
# ? Mar 17, 2024 21:04 |
|
I have to implement a multithreaded pipeline with C++20. Each process type has a minimum of 4 threads, and I have 4 different types of processes - A generates numbers, B and C process them and D prints them out. I guess performance is not that critical, correct functionality is. I thought about making a thread safe queue class, and three queues based on it. AB, BC, CD. Each thread takes/puts stuff from their respective queue. It might be slow, but it also might work Does it make sense to implement such a solution, or should I look for something else, like non-locking queues, which look extremely.. finicky to implement?
|
# ? Mar 21, 2024 11:01 |
|
Ihmemies posted:performance is not that critical, correct functionality is. Print this out in huge bold type above your monitor and refer to it regularly while you design this project. I'm a masochist for lock-free, wait-free, cache coherent multi-threading insanity (still chasing those 0.25ms DSP latency highs) and it is not worth it in any manner unless absolutely necessary or if you enjoy meticulously boring pain. ynohtna fucked around with this message at 11:33 on Mar 21, 2024 |
# ? Mar 21, 2024 11:29 |
|
The secret to making concurrent programming less painful is to do as little of it as possible. Which is to say: the parts of your code that deal with correctly passing stuff between threads should only deal with that, and the parts of your code that implement the business logic should not deal with it at all. (Ideally the passing-stuff-between-threads should be handled by a battle-tested library that someone else wrote and maintains, but that's not really an option in an academic exercise where the point is to write that code). Which is to say: your idea of writing a thread-safe queue, and then using that queue to handle all the handoffs from one thread to another, is a very good plan. Having all the concurrency code behind a single queue interface also means that you can start with a simple and reliable implementation, and then experiment with more complicated ones afterwards if you have time and feel like showing off.
|
# ? Mar 21, 2024 11:53 |
|
Thanks! The idea felt good but I did not want to start with a foot gun, so I wanted to check. Apparently std::jthread is the current recommended method to create new threads. With that you can also issue stop requests to the threads, which then automatically stops and joins the threads. I’ll be back if I can’t manage to get this to work even after an unreasonable amount of work.
|
# ? Mar 21, 2024 12:02 |
Wrap all your data transfers as futures. Don't share data between threads in any other way.
|
|
# ? Mar 21, 2024 12:05 |
|
Good news is that C++20 added some extra synchronization primitives you can use. Bad news is no queues out of the box.
|
# ? Mar 21, 2024 12:44 |
|
Don't touch lock-free stuff unless you know what a memory consistency model is; that subject at least used to be rarely thought. You probably will have bad lock contention because it sounds like a class exercise with a toy example, but if you were doing a significant amount of processing per work chunk the simple stuff would near certainly be good enough and not suddenly blow up when run on a new microarchecture.
|
# ? Mar 21, 2024 13:47 |
|
Assuming this isn't some kind of school assignment, I can recommend https://github.com/cameron314/concurrentqueue
|
# ? Mar 21, 2024 21:50 |
|
If it's not a school assignment I recommend just not using threads at all because caring about correctness more than performance for your multithreaded processing thing is sort of a contradiction.
|
# ? Mar 22, 2024 04:43 |
|
seiken posted:Assuming this isn't some kind of school assignment, I can recommend https://github.com/cameron314/concurrentqueue This is crazy overkill for this usage case vs. a std::queue with std::mutex. I'd do something a lot more like this: https://morestina.net/blog/1400/minimalistic-blocking-bounded-queue-for-c. I guess if this is for a school assignment, that might be looking at the answer key, though.
|
# ? Mar 22, 2024 06:00 |
|
I always find it sad when we have to give context like “it’s for an assignment” to justify doing something in a weird (or worse) way. Surely if something is worth learning about in school, then there must be some way to apply it that actually makes sense in practice too. I think all the time about how I’d teach stuff if I were a teacher, but I wonder how much is out of the teachers’ control due to constraints on curriculum, etc
|
# ? Mar 22, 2024 17:45 |
|
|
# ? May 2, 2024 22:40 |
|
It's also a question of assignment complexity. If you want to teach people to write a thread-safe queue, you can have them either write a queue + toy usage, or write a queue + a bunch of other complicated stuff, which is probably a mistake unless that other stuff is also relevant to the course (like if you're writing an OS scheduler or something).
|
# ? Mar 22, 2024 17:56 |