|
So I want to learn C++. Does anyone have any book recommendations for modern C++? I'm worried if I just start googling and trying things that I'll end up writing C with classes and my code will be posted to this thread for eternity.
|
![]() |
|
![]()
|
# ¿ Mar 18, 2025 10:54 |
|
Kevin Mitnick P.E. posted:modern c++ is c with templates and an angry horde of nerds strangles you if you use a pointer or throw an exception pointers kick rear end tho
|
![]() |
|
Kevin Mitnick P.E. posted:yeah i know but c++ programmers are dumb Sounds like I'll fit right in. Phobeste posted:there’s a book called “modern c++” that I think is good idk I never read it Word, thanks.
|
![]() |
|
Volte posted:c++'s unique strength is writing parameterized programs that generate specific programs, which is something that most people don't want to do most of the time. they want to write the specific programs directly. it takes a ton of code and consideration of minutiae to write a "correct" C++ template that is suitable for inclusion in a library and people get salty over that fact because they just want to parameterize over the type of some operation and not worry about every potential interaction with other client code's reference types etc This is a really interesting post. Gonna have to think hard about if these are the type of problems I would like to have at my job.
|
![]() |
|
gonadic io posted:monadic jo is principled jo, you can't escape out of it only >>= it That's how David Carradine died.
|
![]() |
|
bob dobbs is dead posted:i took linear algebra in 11th grade I should have been a plutocrat.
|
![]() |
|
bob dobbs is dead posted:not a plutocrat myself, my parents just bought the cheapest place they could find in a weirdo school district that also served plutocrats I didn't mean it as an accusation, I just would have been stoked as hell to be able to take linear algebra in high school.
|
![]() |
|
Current terrible programmer status: saved output to folders in the format 'year-minute-day' instead of 'year-month-day' lol
|
![]() |
|
gonadic io posted:let those who have never sinned cast the first stone I did this. Turns out in .NET you want "yyyy-MM-dd", not "yyyy-mm-dd"
|
![]() |
|
CPColin posted:Just wait until somebody uses YYYY instead of yyyy in a Java SimpleDateFormat! The more I learn about date/time issues the more I'm amazed that anything works. What a minefield.
|
![]() |
|
brand engager posted:I'm just over here staring at all our gradle build files More like grundle am I right?
|
![]() |
|
Is there a modern use case for macros besides include guards or platform specific compilation?
|
![]() |
|
Thanks everybody, all of those examples are super helpful
|
![]() |
|
Space Whale posted:
Great googly moogly
|
![]() |
|
Forgive me if I'm stating the obvious re: unmanaged resources and the billion processes, but if I recall correctly in .NET Process implements IDisposable. If you had a process factory that wrapped these processes in a using block they should get GC'd when they go out of scope.
|
![]() |
|
Shaggar posted:its not so much about unmanaged resources used by the long running task (though you absolutely need to worry about them), but more about the task itself. You need to manage the total number of those long running tasks which is definitely doable, but its one more thing to remember to do properly in your code. Plus your long running tasks need to be incredibly durable as the application pool may terminate at any time and its not going to wait for your tasks to finish (unless you do some kind of hacky stuff). Thanks for posting this, it's super helpful. Truly I am in the right thread
|
![]() |
|
Nomnom Cookie posted:i'm pretty sure the secret to programming success is hubris and ignorance. always believing that you know what you're doing and it won't be very hard to reach your goal, until finally you get there after 20x the originally estimated effort I should be making a lot more money
|
![]() |
|
brap posted:yeah your compiler should be warning if the first argument to printf is not a constant I DECLARE TECHNICAL BANKRUPTCY
|
![]() |
|
Powerful Two-Hander posted:the moral of the story is: whatever you do it's gonna suck in some way and you'll wish you did something else, but you have to deal with that and not get super paranoid about what ifs I can assure you my posts are terrible in every universe
|
![]() |
|
Any recommendations for modern cmake tutorials? It's used for a project at dayjob but I gather that the way it's used is pretty outdated. The project is also relatively mature so I don't need to interact with the cmake portion much outside of adding source/header files to the lists here and there and rebuilding the visual studio solution. I want to use it for an idiot spare time project but most of the tutorials I find online are contradictory or vague. I can make it work, but I'd like to be more confident that I'm doing it properly and not setting myself up for headaches down the line.
|
![]() |
|
Antigravitas posted:I implore you to use a plain makefile for your idiot project. Always remember there are people who care about you… Let's assume I have a brain disease and cannot be persuaded otherwise quote:It's... complicated. The tldr is that a portion of the application is developed on Linux and needs to be integrated into the rest of the application which is windows only. There's nothing I can do about this arrangement
|
![]() |
|
Thanks friends. I'll just keep googling and reading documentation
|
![]() |
|
VikingofRock posted:When I was learning cmake a year ago, I remember An Introduction to Modern CMake being pretty good and useful Thanks, this is actually what I've mostly used so far. It seems the most complete and it's helpful that the example file structure is close to what I'm using qsvui posted:Professional CMake is quite thorough and modern. It's written by a maintainer. qsvui posted:here are also some blogs written by a fellow yosposter: Thank you much, I'll take a look at these
|
![]() |
|
Sapozhnik posted:cloud is good because it's an opex cost instead of a capex cost and the rich people who own you like that a lot Our devops director is real horny for cloud and framing it this way makes a lot of things fall into place for me
|
![]() |
|
Achmed Jones posted:see also i18n for internationalization, a11y for accessibility, etc. I'0m g3g t0o w3e a1l m0y p3s u3n t2s c8n f2m n1w o0n
|
![]() |
|
gonadic io posted:what's this? On. 0 letters between first and last
|
![]() |
|
Terrible programmer here with a question. This is going to be kind of vague because I haven't worked on this product yet and therefore: - I'm not very familiar with the codebase - I'm not very familiar with javascript or web stuff generally - I'm not very familiar with the pain points caused by the existing workflow I'm asking anyway because I'll probably have to work with this in the near future and have been asked to explore our options. Let me know if this is unclear and you just need more info At work one of our products is web based and uses ASP.NET. A lot of functionality is then built on top of that with typescript/react. Right now this is apparently a pain in the rear end to work with and manage, so we'd like to figure out a way to let us use npm. The current best idea is to split out the typescript/react portion, use npm to manage and compile the typescript, and then use webpack to output something that can be used with our existing ASP.NET structure. Is there a better way to go about this?
|
![]() |
|
Krankenstyle posted:yeah imo don't use javascript or derivatives. stick to static pages would that I could
|
![]() |
|
DELETE CASCADE posted:sounds like you first need to figure out why that is (or why they think so, anyway) I think some of the reasons are: - The current setup more or less locks us into visual studio, which is not great for typescript vs. vscode - 3rd party libraries are more of a PITA to manage than with npm mystes posted:So right now it's not really an SPA but instead you're using asp.net to serve some static pages as well as a bunch of javascript files manually compiled from typescript for individual pages? I believe so mystes posted:Are the typescript/react parts talking to the server via a rest api right now? Or are you using react just to enhance static pages even though that seems extremely overkill? They are talking to the server via a REST API
|
![]() |
|
Thanks for the advice friends, that helps
|
![]() |
|
Soricidus posted:ctps: trying to work out why the gently caress maven-javadoc-plugin keeps giving an "unmappable character for encoding windows-1252" error when i have explicitly set the encoding to UTF-8 everywhere I can find to change it, and indeed mvn -X claims that it is going to use UTF-8 for everything ... right before it tries to map something into windows-1252 and dies horribly This prompted me to bing whether git accepts any UTF-8 character in a commit message and I'm excited to take my terrible programming to the next level
|
![]() |
|
pokeyman posted:pretty sure machine "learning" has some role here. last time you typed "exce" you chose the Excel result so it remembers that for that query. if you've never typed "excel" all the way out before, it has no history to check. then you choose "search web for excel" by accident and that gets remembered for next time Microsoft is horny for bing and thinks it's users are too
|
![]() |
|
Case insensitivity is a scourge
|
![]() |
|
Ciaphas posted:operator{}() begins the song that ends the world IO! IO! Cthulhu f'operator{}()'gn!
|
![]() |
|
zokie posted:that was great, thanks agreed, I would subscribe to this blog
|
![]() |
|
I was directed to https://crascit.com/professional-cmake/ By this thread when I had cmake questions and found it to be well worth the money. I had a hard time separating good examples from bad examples whenever I googled a cmake question
|
![]() |
|
ctps: I'm trying to fix a bug where a windows service properly exits if it hits a problem right away (e.g. db connection string is wrong) but it stays alive in a zombie state if it encounters a problem later on (db service turned off). When I run it through the debugger the exception is caught in the same place and I can step it right to the end of the main method in either case ![]()
|
![]() |
|
That sounds entirely plausible, thanks for the tip. This codebase is pretty new to me, I've got a lot of spelunking ahead of me
|
![]() |
|
Bloody posted:blindly throwing threads around is basically the same as using goto for flow control. maybe worse it's rude to be talking about my posting like that
|
![]() |
|
![]()
|
# ¿ Mar 18, 2025 10:54 |
|
Is there a good starting point for understanding the purpose of/history of POSIX? The Dan Luu article linked in here about files being untrustworthy was great, so I feel like I know what's going on with that part of the conversation, but I'd also like to understand references to the angry ghost of POSIX
|
![]() |