--- Log opened Wed Sep 18 00:00:34 2019 |
00:03 | | Degi_ [Degi@Nightstar-p0h.2r2.232.185.IP] has quit [Ping timeout: 121 seconds] |
00:06 | <&McMartin> | ... huh |
00:06 | <&McMartin> | Perl's first public release was in 1987 |
00:06 | <&McMartin> | It's weird to think of Perl as younger than the Amiga. |
00:12 | <@sshine> | or ten years older than Standard ML. |
01:26 | | celticminstrel [celticminst@Nightstar-6an2qt.dsl.bell.ca] has joined #code |
01:27 | | mode/#code [+o celticminstrel] by ChanServ |
01:39 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed] |
02:23 | | catalyst [catalyst@Nightstar-5dv16h.cable.virginm.net] has quit [Connection closed] |
04:57 | | Mango [Frankie_Boy@Nightstar-hqmi86.abhsia.telus.net] has left #code ["ISON mango@acrovoice.ca +17802009140@shortmsg.ca "] |
05:26 | | Derakon is now known as Derakon[AFK] |
06:35 | | celticminstrel [celticminst@Nightstar-6an2qt.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
08:01 | | himi [sjjf@Nightstar-jihllh.optusnet.com.au] has joined #code |
08:01 | | mode/#code [+o himi] by ChanServ |
08:21 | | * McMartin Trogdors the Hell out of this set of classes |
08:21 | | himi [sjjf@Nightstar-jihllh.optusnet.com.au] has quit [Ping timeout: 121 seconds] |
09:32 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code |
09:32 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
12:28 | | Degi [Degi@Nightstar-evssvs.dyn.telefonica.de] has joined #code |
12:32 | <@ErikMesoy> | An accomplice at work has found himself in a situation where he wants to break out of many loops and much nested program at once, in a language that doesn't* support GOTO. |
12:32 | <@ErikMesoy> | He came up with a clever solution of implementing a ReturnToMainException, which can be raised deep inside the code and is simply passed up to be silently caught at the outer control flow. |
12:33 | <@ErikMesoy> | I'm not sure if I should advise him to use GOTO or what. |
12:36 | <@ErikMesoy> | Other accomplice is suggesting the use of an is_done variable to indicate when it's time to break out of loops and it sounds an awful lot like he's reinventing while(). |
12:37 | <&Reiver> | that is kinda what while does, yes |
12:41 | <~Vornicus> | doesn't*? |
12:45 | <@ErikMesoy> | There exists a third party April-Fools-but-functional module that adds support for GOTO and it contains a request to please not use it in serious code. |
12:57 | <~Vornicus> | aha |
12:58 | <~Vornicus> | exceptions are the most appropriate sounding thing here, if you wish to do *nothing* in the other loops and functions on the way up |
13:00 | <@abudhabi> | What, like putting the whole shebang in a try-catch, then throwing an we-are-done-exception to continue onwards? |
13:03 | <~Vornicus> | Yeah. |
13:46 | <~Vornicus> | But you should name the exception based on why you're leaving, not based on what you intend the result to be |
14:04 | <@ErikMesoy> | He's leaving because he wishes to return to main. :) |
14:40 | <&ToxicFrog> | ErikMesoy: this seems like the solution is to factor out the nested loops into their own function and break out of them with return, assuming the language doesn't support break-N or something like call/cc. |
15:24 | | Kindamoody[zZz] is now known as Kindamoody |
16:32 | | catalyst [catalyst@Nightstar-5dv16h.cable.virginm.net] has joined #code |
16:50 | | Degi [Degi@Nightstar-evssvs.dyn.telefonica.de] has quit [Connection closed] |
17:03 | | Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has joined #code |
17:07 | <@abudhabi> | Hmm. |
17:44 | <&jeroud> | call/cc is FP-flavoured GOTO. |
17:52 | | Kindamoody [Kindamoody@Nightstar-eubaqc.tbcn.telia.com] has quit [Client exited] |
17:53 | | Kimo|autojoin [Kindamoody@Nightstar-eubaqc.tbcn.telia.com] has joined #code |
17:54 | | mode/#code [+o Kimo|autojoin] by ChanServ |
17:54 | <&jeroud> | ErikMesoy: I have used both of the solutions TF mentioned, and "factor the loops out into a separate function" is usually best. I tend to resort to exceptions only in cases where the inner loops are already inside other functions (in which case GOTO would either be unavailable or would do horrible things) or the thing I want to escape from is recursive. |
19:41 | | Derakon[AFK] is now known as Derakon |
20:07 | | Kimo|autojoin is now known as Kindamoody |
20:20 | <&Derakon> | Anyone know, in C#, if there's a way to say "this function takes as a parameter a void callback function with zero parameters" without having to put "delegate void callback()" somewhere? |
20:21 | <&Derakon> | That is, without having to declare a type that is "a function that takes no parameters and returns nothing", which type is not attached to the function. |
20:21 | <&Derakon> | Ideally I'd be able to say, like, "public void PlayDialog(List<ScriptLine> lines, () => void callback)" but that doesn't seem to be valid syntax. |
20:48 | <&McMartin> | You're trying to avoid use of named delegates here, or of delegate classes? |
20:50 | <&McMartin> | I *think* for type signatures you have to actually declare them, but that's based on a very brief google search |
20:50 | <&McMartin> | All variation I see is in what you can feed to declared delegate types |
20:59 | <&Derakon> | Named delegates, and yeah, my impression is you have to declare them. |
20:59 | <@sshine> | Derakon, https://stackoverflow.com/a/9245039/235908 |
21:00 | <&Derakon> | sshine: hm, thanks. |
21:00 | <@sshine> | so 'Action' for what would be '() -> ()' |
21:01 | <@sshine> | I remembered 'Func<...>', and I remembered that that wouldn't work for void. |
21:01 | <@sshine> | Derakon, I *think* an 'Action' means you can pass in something declared using the older 'delegate' syntax. I think they're equivalent *to some extent*... |
21:02 | <@sshine> | but I think Func<...> and Action<...> also play into some reflection-related stuff that came after 'delegate'. but I'm totally out of my comfort zone by saying that. |
21:04 | <@sshine> | huh, reading the StackOverflow answer I linked to more closely, "Actions have always a void return type. A void return type needs not and cannot be specified as generic type parameter." |
21:05 | <&Derakon> | Fortunately I don't need nor want a return type. |
21:10 | <@gnolam> | https://twitter.com/i/videos/1173601503904325633 |
21:11 | <&Derakon> | gnolam: ah, yes. |
21:11 | <&Derakon> | Except that the group can work in parallel. |
21:13 | <&Derakon> | ...this gets dark. |
21:13 | <@sshine> | hahaha |
21:13 | <@sshine> | that turned murky |
21:13 | <@sshine> | we just got a new UX designer |
21:13 | <@sshine> | things felt like that before he came. |
21:14 | <@sshine> | or UX specialist, I think it's called. |
21:15 | <@sshine> | our old UX thingamabob would constantly say "The users think <X>" where "The users" is some kind of metaphorical sock puppet for her own uneducated opinion. |
21:16 | <@sshine> | the new one asked for git access. |
21:21 | <@gnolam> | But you implied they already had access to end users? :P |
21:23 | <@sshine> | yes. |
21:23 | <@sshine> | but only as many as they can fit in a room at once. the code base reaches everyone! ;) |
21:38 | <@gnolam> | Ok, I'm being unfair. I honestly prefer end users to many of their managers. |
21:39 | <@gnolam> | Also, I giggled a little too much at https://twitter.com/sec_reactions/status/1174330669385814018 |
21:55 | | Degi [Degi@Nightstar-evssvs.dyn.telefonica.de] has joined #code |
21:55 | < Mahal> | https://twitter.com/dollar20879178/status/1174287562585886726?s=21 |
21:57 | <@gnolam> | GMTA? |
21:57 | < Mahal> | oh |
21:57 | < Mahal> | oops! |
21:57 | < Mahal> | It found it's way to me elsenet and I went "code would like this!" and I had not looked at your link yet |
21:57 | < Mahal> | and in my defense it *is* a different link :D |
21:58 | < Mahal> | the internet converges |
21:59 | <@sshine> | Mahal, nice one. |
21:59 | < Mahal> | gnolam linked it first! |
21:59 | <@sshine> | oh, that's what GMTA meant. |
22:00 | <@sshine> | one of our student programmers just found a glaring hole in our access control system. I'll send it to him. |
22:02 | <@sshine> | I wish I could disclose it, but it's so bad I have to wait until they patch it. |
22:08 | | Degi [Degi@Nightstar-evssvs.dyn.telefonica.de] has quit [Connection closed] |
22:09 | | Degi [Degi@Nightstar-evssvs.dyn.telefonica.de] has joined #code |
22:33 | <&McMartin> | Yay Maru! |
22:54 | <@sshine> | looking at my old code: next unless any { !$_->is_fallback } ... |
22:54 | <@sshine> | the amount of logical negation on that line is overwhelming. |
22:56 | <@sshine> | now: next if all { $_->is_fallback } ... |
23:00 | <&McMartin> | Took me a bit to sort that out. |
23:03 | <@sshine> | I had to write it down in English, close my eyes and say it, then open my eyes and write it properly. |
23:04 | | Kindamoody is now known as Kindamoody[zZz] |
23:04 | <@sshine> | I'm OK with unfiltering badly negated logical expressions. I'm really bad with figuring out predicates that deal with overlapping date intervals. |
23:04 | <&McMartin> | Checks out, that is one level of logical generality up |
23:04 | <&McMartin> | propositional vs. first-order logic, iirc |
23:07 | <@sshine> | ah, that may be why :) |
23:07 | | macdjord [macdjord@Nightstar-rslo4b.mc.videotron.ca] has joined #code |
23:07 | | mode/#code [+o macdjord] by ChanServ |
23:10 | | mac [macdjord@Nightstar-rslo4b.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
23:10 | | Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds] |
23:19 | | * sshine is necro-cherry-picking from a very old project that was put on hold from back when I just started working here. |
23:19 | | * McMartin is rearchitecting stuff that he designed back when he joined the company |
23:19 | <@sshine> | the code carries all the traits of ambition: over-engineered, intelligently made. I really cared back then. |
23:22 | <@sshine> | https://gist.github.com/sshine/f3cdb26c9cd0be45b2c5125841403416 -- trying to pick an ad based in a way that lets me test that the probability distribution is correct. |
23:23 | <@sshine> | I don't think it performs very well. |
23:23 | <&McMartin> | 15:19 <@sshine> the code carries all the traits of ambition: over-engineered, intelligently made. I really cared back then. |
23:23 | <&McMartin> | [X] I am in this photograph and I don't like it |
23:24 | <@sshine> | haha |
23:24 | <~Vornicus> | I seem to recall helping you with this code or something |
23:24 | <@sshine> | Vornicus, you did! |
23:24 | <~Vornicus> | oh good |
23:25 | <@sshine> | McMartin, what were you architecting? |
23:27 | <&McMartin> | The client side of a minor social media platform, so it was a set of core systems for working with their server systems, local databases, and feeding fetched past data, freshly-synced new data, and realtime updates to the eventual UI |
23:27 | <&McMartin> | And then there was also a ton of other bits that involve talking straight to the device. |
23:27 | <&McMartin> | Having the core logic be aggressively-buffered platform-independent C++ code turns out to have been three mistakes. |
23:27 | <&McMartin> | Albeit ones that did adequately power a mobile application for many years and got first-to-market on some of that device-specific stuff. |
23:34 | <@sshine> | how long ago was that? |
23:38 | <&McMartin> | About four and a half years. |
23:38 | <&McMartin> | Some of this code has been running most of that time but hasn't been meaningfully touched since. |
23:39 | <&McMartin> | But there's enough internal tech pressure that this is a major source of tech debt, so I'm revisiting my old designs and refining them into ways that are more suitable for interoperation with modern iOS applications such as the Only Software That Uses These Libraries. |
23:39 | <&McMartin> | I wrote some very effective glue layers back then, but man |
23:39 | <&McMartin> | To my current eyes they are not very *good* glue layers |
23:41 | <&McMartin> | The overall goal is to migrate the codebase completely away from C++ and to either C, ObjC, or Swift (so that they can be imported by ObjC or Swift code like, er, all iOS apps, more readily). Places where I figured I'd only be removing one translation layer end up pingponging data with a costly conversion step between the ObjC device layer and the C++ "platform independent" layer dozens of times per |
23:42 | <&McMartin> | operation |
23:42 | <&McMartin> | It was smooth and reliable in practice and the languages didn't pollute each other at all |
23:42 | <&McMartin> | But man |
23:42 | <&McMartin> | That turns out to have been solving the wrong problem. |
23:44 | <&McMartin> | (At the moment, I'm reorganizing the code that notifies the rest of the system that the user has enabled/disabled airplane mode) |
23:45 | <&McMartin> | (Apple's own APIs for this are... uncomfortable, and our wrapper works but depends more on dusty corners of clang-specific C/ObjC annotations than I'd like. Sorting that out will make it easier to make a few levels of C++ callback infrastructure redundant.) |
23:46 | <&McMartin> | Also, the C API to the core Objective-C datatypes is both (a) totally awful and (b) something that it's really too bad did not become semistandard >_> |
23:47 | <&McMartin> | I haven't sorted out my feelings there yet |
23:48 | <&McMartin> | Some of what I've said here is lies-to-children, but the iOS devs out there are already spotting them and sneering. It's OK, it's only important to us~ |
--- Log closed Thu Sep 19 00:00:35 2019 |