--- Log opened Fri Jul 22 00:00:16 2022 |
01:35 | | gizmore [kvirc@Nightstar-hkqqen.dip0.t-ipconnect.de] has joined #code |
01:38 | | gizmore|2 [kvirc@Nightstar-d3vdsp.dip0.t-ipconnect.de] has quit [Ping timeout: 121 seconds] |
02:22 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed] |
02:38 | | Degi_ [Degi@Nightstar-80ugp6.pool.telefonica.de] has joined #code |
02:40 | | Degi [Degi@Nightstar-dafj56.pool.telefonica.de] has quit [Ping timeout: 121 seconds] |
02:40 | | Degi_ is now known as Degi |
04:05 | | Kizor [a@Nightstar-nfsqa7.yok.fi] has quit [Ping timeout: 121 seconds] |
05:13 | | Vorntastic [uid293981@Nightstar-phvupn.irccloud.com] has joined #code |
05:13 | | mode/#code [+qo Vorntastic Vorntastic] by ChanServ |
06:12 | | Netsplit Deepthought.Nightstar.Net <-> Krikkit.Nightstar.Net quits: @PinkFreud |
06:12 | | Netsplit over, joins: @PinkFreud |
06:14 | | gizmore [kvirc@Nightstar-hkqqen.dip0.t-ipconnect.de] has quit [Connection reset by peer] |
06:14 | | gizmore [kvirc@Nightstar-hkqqen.dip0.t-ipconnect.de] has joined #code |
06:22 | | Kindamoody[zZz] is now known as Kindamoody|afk |
07:50 | <&McMartin> | Ugh, I am tempted to become a bad person |
07:50 | <&McMartin> | It's looking like I have to take a detour from my Amiga nonsense to do a quick tutorial on vsnprintf(3) |
07:51 | <&McMartin> | And I'm trying to set the stage for what the problem is that it solves without basically assuming vsnprintf as the right answer in the problem statement |
07:51 | <&McMartin> | Because, let's be real here, everything about stdarg.h and the things that use it are batshit |
07:52 | <&McMartin> | But that means I find myself intentionally leaning away from correct answers like a youtube video essayist trying to avoid coming to the point so he has more room for paid sponsorships |
07:53 | <&McMartin> | Maybe I should just get to the point immediately, then say "basically everyone agrees that this is a bad idea and that the real solution is to have an I/O library that isn't shit and doesn't get you into this kind of trouble to begin with", followed by various examples through history, and *then* get to the sample code |
07:53 | <&McMartin> | Thank you, my noble virtual collection of goldfish and rubber ducks. |
07:58 | <~Vorntastic> | You're welcome |
08:41 | <~Vorntastic> | You could... Well it's easier with that, jan misali did a video about floating point numbers by gradually developing more and more complex versions of the system until it gets all the way to full strength. But that's a little trickier when you have to basically start with printf |
08:45 | <&McMartin> | Yeah, the chain *in C* is: |
08:45 | <&McMartin> | - stdout isn't well-defined or isn't what we need to write to -> fprintf |
08:45 | <&McMartin> | - also it isn't a FILE * -> snprintf, hand resulting memory buffer to whatever you want |
08:46 | <&McMartin> | - snprintf's API is really inconvenient, I want to wrap it in a way that lets me use printf syntax, forward transparently to snprintf, and then from there to the TCP connection or the window's console or the system log or whatever -> the actual topic of the article, revolving around vsnprintf and how it meshes with varargs |
08:47 | <&McMartin> | And so once you remove yourself from C's shackles, the answer is "snprintf's API is really inconvenient, *don't do that* in your stdlib" |
08:48 | <&McMartin> | via, say, being garbage collected and having some kind of String.Format method or operator (C#, Python 2), or straight-up string interpolation (C#, Python 3), or punting on all of that having individual methods for writing each kind of data to your stream (C++, C#, Java) |
08:48 | <&McMartin> | *on all of that and having |
09:04 | | jessifae_ [catalyst@Nightstar-ejd4sd.cable.virginm.net] has quit [The TLS connection was non-properly terminated.] |
10:47 | | jessifae [catalyst@Nightstar-ejd4sd.cable.virginm.net] has joined #code |
12:19 | | Kizor [a@Nightstar-nfsqa7.yok.fi] has joined #code |
15:00 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code |
15:00 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
17:03 | | Vorntastic [uid293981@Nightstar-phvupn.irccloud.com] has quit [[NS] Quit: Connection closed for inactivity] |
20:00 | | Emmy [Emmy@Nightstar-l49opt.fixed.kpn.net] has joined #code |
20:22 | | Kindamoody|afk is now known as Kindamoody |
21:24 | | jessifae [catalyst@Nightstar-ejd4sd.cable.virginm.net] has quit [Connection reset by peer] |
21:27 | | jessifae [catalyst@Nightstar-ejd4sd.cable.virginm.net] has joined #code |
21:47 | | Kindamoody is now known as Kindamoody[zZz] |
23:27 | | Emmy [Emmy@Nightstar-l49opt.fixed.kpn.net] has quit [Ping timeout: 121 seconds] |
--- Log closed Sat Jul 23 00:00:18 2022 |