|
It sure is. Arthur Whitney has a very distinctive coding style. His current project is an operating system. I've been learning K for fun recently and it's a very nice little language, but the initial learning curve is pretty tough. Once you memorize the primitive operators it's much easier to read.
|
# ? Dec 13, 2014 02:03 |
|
|
# ? Jun 8, 2024 06:34 |
|
You should see the mess BoA implemented to workaround lack of materialized views in KDB, A client written in IronPython with a web browser address bar interface too, kinda neat and scary at the same time.
|
# ? Dec 13, 2014 03:32 |
|
Snapchat A Titty posted:Reminds me: There's a website I use where once your session times out, http://www.example.com/user/account.php will start returning a blank 404 page until you go to /user/login.php and log in again. necrotic posted:While that's a bit on the extreme side, its pretty common to return 404 instead of 403 to hide stuff from users who can't access it. I don't think I've ever seen it for an account management page, but maybe its just a generic handler they use for that crap? Scaramouche posted:The idea being that it's trivially easy to redirect to a login page on session expire instead of just failing to return the resource. Almost any other return code would be better suited than 404. Forbidden, redirect, 200 with a login page, whatever No idea what kinda backend they have, though. Indicia say it's bespoke.
|
# ? Dec 13, 2014 03:40 |
|
Snapchat A Titty posted:Almost any other return code would be better suited than 404. Forbidden, redirect, 200 with a login page, whatever Returning 404 certainly conforms to the standard: RFC 7231 posted:An origin server that wishes to "hide" the current existence of a forbidden target resource MAY instead respond with a status code of 404 (Not Found).
|
# ? Dec 13, 2014 04:11 |
|
pokeyman posted:Returning 404 certainly conforms to the standard: It very well might be a secret! I like how GitHub does it: private and non-existent repositories are both served the same 404 page, but if you're not logged in you get an inline login form right there. https://github.com/foo/bar
|
# ? Dec 13, 2014 04:20 |
|
Huh, that is surprising! Gotta say that's a lovely thing to put in the standard. A horror, if you will. Though I guess it does make sense if the url isn't literally the account homepage url, like if it's some asset that should only be available in very specific contexts. Better to just pretend it doesn't exist than let people know that there's something at this very specific address that they can try to grab at. E; Yea like the emoji guy says
|
# ? Dec 13, 2014 04:20 |
|
MrMoo posted:You should see the mess BoA implemented to workaround lack of materialized views in KDB, A client written in IronPython with a web browser address bar interface too, kinda neat and scary at the same time. Yeah, after working with KDB for a while I have really mixed fealings about the ecosystem as a whole. It's very good at what it does (storing and querying timeseries data) but I feel a lot of installations have various rude-goldberg like services built around its shortcomings (it's not a database, but people want to treat it like a database). It wouldn't be so bad if the learning curve wasn't a cliff, and query optimization wasn't a black art (an example: using "within" with a dummy variable can be ten times faster than using the greater than/less than operators. Completely counter intuitive since one is a language primitive that translates directly to a hardware op, and one theoretically requires two bounds checks). I will say though, I think the ridiculously-specked-server with an in memory database model that KDB is exemplary of is an evolutionary dead end*. (*unless we see a true distributed memory fabric implementation at the OS level. I don't know any company that's working in this area that has any desire to open-source their code though. Apache Ignite is the closest thing, and I do find that project incredibly exciting.) Chuu fucked around with this message at 09:07 on Dec 13, 2014 |
# ? Dec 13, 2014 08:51 |
|
Internet Janitor posted:It sure is. Arthur Whitney has a very distinctive coding style. His current project is an operating system. I love the last three lines of his coding style doc: Arthur Whitney posted:don't generalize. I'll leave it up to the audience to decide if that's a coding horror or not. Really, my gut feeling when looking at anything Arthur has worked on is "this is so alien to me I can't even judge if this is an abomination or incredibly brilliant. It's probably both." It's the only coding style that I have that reaction to. Chuu fucked around with this message at 09:05 on Dec 13, 2014 |
# ? Dec 13, 2014 09:00 |
|
How does one even arrive at that kind of coding style. "Hmm this algorithm is slow as gently caress, welp no point in trying to optimize it"
|
# ? Dec 13, 2014 11:07 |
|
Chuu posted:I'll leave it up to the audience to decide if that's a coding horror or not. How can it possibly not be?
|
# ? Dec 13, 2014 13:11 |
|
I've shown the kdb c header file to friends out of context and they've asked why I linked to the IOCCC.
|
# ? Dec 13, 2014 13:48 |
|
QuarkJets posted:How does one even arrive at that kind of coding style. "Hmm this algorithm is slow as gently caress, welp no point in trying to optimize it" Well don't pick a lovely algorithm and your poo poo won't be slow! Maybe your algorithm for putting a list of items in a drop-down menu doesn't need to run in factorial time.
|
# ? Dec 13, 2014 14:36 |
|
Chuu posted:Really, my gut feeling when looking at anything Arthur has worked on is "this is so alien to me I can't even judge if this is an abomination or incredibly brilliant. It's probably both." It's the only coding style that I have that reaction to. I think there are many parallels between Whitney and Chuck Moore, the creator of Forth. Here's how Moore has been coding recently: http://www.colorforth.com/cosd.htm That's a semi-symbolic representation of machine code (the colors are semantically significant, not syntax highlighting) meant to run on one processing node of a 144-core machine he designed at the transistor level, using tools which ran on another machine he likewise made. Whitney published a style guide for K which provides some reasoning behind the way he formats code, although his personal style seems to have become a more extreme version of some of the ideas in that manual.
|
# ? Dec 13, 2014 15:14 |
|
fritz posted:How can it possibly not be? Because it comes from an alternate world where Scheme and APL won the mindshare wars in early computing history, and procedural languages and their decedents are academic curiosities. The rules in that world could be very different than ours, and his coding style could have been the standard in that timeline. I mean, all of Whitney's work would just be an intellectual curiosity if KDB wasn't the backbone of most investment banks. Because it's thrived in the wild makes it such an interesting study.
|
# ? Dec 13, 2014 16:03 |
|
QuarkJets posted:How does one even arrive at that kind of coding style. "Hmm this algorithm is slow as gently caress, welp no point in trying to optimize it" He has severe savant induced aspergers? I unfortunately found someone else with similar traits and whilst the code running is impressive it is just too depressing to understand: hundreds of local variables with short names and what should be hundreds of functions all rolled up into visually short but very long logic single functions. It is the pseudo-inlining that causes them to give up on optimization.
|
# ? Dec 13, 2014 16:26 |
|
Bruegels Fuckbooks posted:Well don't pick a lovely algorithm and your poo poo won't be slow! Maybe your algorithm for putting a list of items in a drop-down menu doesn't need to run in factorial time. And what if you're solving a problem that hasn't been solved before, perhaps something important that takes a month of supercomputing time in the optimal case? Then you just pick whatever first comes to mind and go with that? QuarkJets fucked around with this message at 19:05 on Dec 13, 2014 |
# ? Dec 13, 2014 19:02 |
|
QuarkJets posted:And what if you're solving a problem that hasn't been solved before? If you think you fall into this category, you are probably mistaken. Feel free to keep right on reinventing the wheel, though, rewriting things in increasingly inefficient ways has kept programmers employed for decades now and there's no reason to suppose you can't spin it out for the rest of a lucrative career!
|
# ? Dec 13, 2014 19:05 |
|
Soricidus posted:If you think you fall into this category, you are probably mistaken. No, it's actually the aggressive condescension.
|
# ? Dec 13, 2014 19:11 |
QuarkJets posted:And what if you're solving a problem that hasn't been solved before, perhaps something important that takes a month of supercomputing time in the optimal case? Then you just pick whatever first comes to mind and go with that? Unless you're working in academia or some company has hired you to solve the Travelling Salesman problem or somesuch*, you, with all likelihood, never have to invent any new algorithms. At most you'd have to refurbish, implement and combine algorithms others have already made. *which they would probably hire a mathematician for, if private companies hired for that purpose at all. E: Welp, looks like I was wrong. I guess I'm still young and naïve. Joda fucked around with this message at 20:02 on Dec 13, 2014 |
|
# ? Dec 13, 2014 19:48 |
|
Arthur Whitney posted:don't generalize. QuarkJets posted:"Hmm this algorithm is slow as gently caress, welp no point in trying to optimize it" I think it's pretty obvious that Whitney is rephrasing another older piece of advice: Donald Knuth posted:Premature optimization is the root of all evil. Don't let me interrupt your derail though.
|
# ? Dec 13, 2014 19:56 |
|
Actually it's "Love of premature optimization is the root of all evil."
|
# ? Dec 13, 2014 19:58 |
|
You guys realize QuarkJets works at/for motherfucking CERN, right?
|
# ? Dec 13, 2014 19:59 |
|
People invent, combine, and refine algorithms for their purposes all the time in industry. Not everyone is pushing together Lego bricks according to the instructions that came in the box. You can find lots of papers published by non-academic practitioners. Even if you're not doing publishable work, you may well be attacking a problem that hasn't been attacked in the relevant configuration before, or for which a general solution doesn't exist in literature. Well, I guess not so much you you, given this thread, but software developers.
|
# ? Dec 13, 2014 19:59 |
|
Choosing a better/faster/more suitable algorithm is a form of optimization.
|
# ? Dec 13, 2014 21:08 |
|
Usually a form of amelioration, since it rarely ends up actually optimal. But doing anything prematurely is bad, or it would be timely rather than premature. What are we talking about here again? That people never have to optimize, or that its always premature, or that nobody does algorithm design? I've lost my sense of direction.
|
# ? Dec 13, 2014 21:15 |
|
Subjunctive posted:Usually a form of amelioration, since it rarely ends up actually optimal. But doing anything prematurely is bad, or it would be timely rather than premature. I'm not really sure anymore, everyone seemed to take their own interpretation of the topic. I thought that we were talking about some guy who believes that all attempts at optimization are bad, which would imply that all worthwhile optimizations have already occurred or something. Or maybe he's just misquoting the idea that premature optimization is bad, an idea with which I think we all agree (for many reasons) The idea that real efficiency gains to very important computational problems can't be made because they've already been made just kind of irked me, since there are tons of unsolved or poorly solved problems out there. It'd be like taking Numerical Recipes in C and then assuming that those are a complete set of the best algorithms for all problems and for all time. It's kind of a coding horror in and of itself, like if someone saw a sorting function that uses bubble sort and then said "well this function is already perfect, no point in trying to improve it." But at the same time, yeah, there's no point in you trying to roll your own heapsort or something like that. We can agree that there's a middle ground where there are lots of nice and commonly used algorithms for many problems while also agreeing that these existing tools don't necessarily solve all problems. Or "for every complex problem, there is a solution that is simple, neat, and wrong." QuarkJets fucked around with this message at 21:39 on Dec 13, 2014 |
# ? Dec 13, 2014 21:32 |
|
QuarkJets posted:But at the same time, yeah, there's no point in you trying to roll your own heapsort or something like that. And yet it wasn't that long ago that we got timsort, so maybe that well's not totally dry. Understanding what is unusual about your problem, what's not, and the importance of the unusualness is pretty core to systems design in all fields, I would expect.
|
# ? Dec 13, 2014 21:41 |
|
Good points
|
# ? Dec 14, 2014 00:16 |
|
I'm currently on the bench, because my previous client hosed me without me knowing and so now I'm marked for death, so to speak. Anyways, the in-house project I'm one is a project with a specific management sytle. Basically, someone can work on it for 1 month or two at most and then leaves, so you can imagine the quality of the code. Here's a quick example: public InitializeViewBagItems(ClassModel model, bool isCreate = false){ *cringe worthy stuff here* }
|
# ? Dec 15, 2014 18:03 |
|
Honest Thief posted:I'm currently on the bench, because my previous client hosed me without me knowing and so now I'm marked for death, so to speak. Anyways, the in-house project I'm one is a project with a specific management sytle. Basically, someone can work on it for 1 month or two at most and then leaves, so you can imagine the quality of the code. Here's a quick example: Maybe you should post some of the cringe-worthy stuff. The method signature means nothing.
|
# ? Dec 15, 2014 18:16 |
|
Ithaqua posted:Maybe you should post some of the cringe-worthy stuff. The method signature means nothing. That method signature sounds like someone cut up the Microsoft Marketing handbook and taped together seven random pieces. But yes, I'm also excited to see its contents!
|
# ? Dec 15, 2014 18:26 |
|
Okay, you know how XORing a byte by 0b0000 0000 (0x00) will flip the bits, right? e.g. 0b1010 1010 (0xAA) ^ 0b0000 0000 (0x00) -> 0b0101 0101 (0x55). You'd expect the same behavior in Javascript, since it's basic computer science and logic, right? WRONG code:
" MDN posted:Bitwise XORing any number x with 0 yields x. Bitwise XORing any number x with -1 yields ~x. You have got to be kidding me.
|
# ? Dec 15, 2014 18:30 |
|
XORing a byte by 0xFF will flip the bits. XORing a byte by 0x00 will change nothing. This is how XOR ordinarily works. Edit: and to clarify, -1 as a signed two's complement byte is 0xFF.
|
# ? Dec 15, 2014 18:32 |
|
Pollyanna posted:Okay, you know how XORing a byte by 0b0000 0000 (0x00) will flip the bits, right? e.g. 0b1010 1010 (0xAA) ^ 0b0000 0000 (0x00) -> 0b0101 0101 (0x55). You'd expect the same behavior in Javascript, since it's basic computer science and logic, right? what are you talking about that's not how xor works.
|
# ? Dec 15, 2014 18:33 |
|
Internet Janitor posted:XORing a byte by 0xFF will flip the bits. XORing a byte by 0x00 will change nothing. This is how XOR ordinarily works. mother gently caress me I'm gonna go hide my shame in the corner.
|
# ? Dec 15, 2014 18:33 |
|
Pollyanna posted:Okay, you know how XORing a byte by 0b0000 0000 (0x00) will flip the bits, right? e.g. 0b1010 1010 (0xAA) ^ 0b0000 0000 (0x00) -> 0b0101 0101 (0x55). You'd expect the same behavior in Javascript, since it's basic computer science and logic, right? That isn't XOR. This is XOR. code:
In other words, one OR the other, but NOT both. Hence, eXclusive OR, or XOR for short. This is also why 0x(something) ^ 0x00 will remain the same, because 0x0 ^ 0x0 == 0x0 and 0x1 ^ 0x0 == 0x1 e:f;b
|
# ? Dec 15, 2014 18:43 |
|
If you want an operator which bitwise flips one operand when the second operand is 0 you could use NOR (joint denial), biconditional or converse implication, but most languages don't include those as primitives.
|
# ? Dec 15, 2014 18:44 |
|
Ithaqua posted:Maybe you should post some of the cringe-worthy stuff. The method signature means nothing. btw I say its a new logic because it explicitly says so on the comment, because otherwise I got no freakin idea if (isCreate) { var clist = ClientsService.FindAll(new FindAllClientsRequest { UserId = User.UserId }).Clients.ToList(); var emptyOption = new ClientModel { ClientId = Guid.Empty, Name = ViewRes.Appointment.Select }; if (clist == null) { clist = new List<ClientModel>(); } clist.Insert(0, emptyOption); ViewBag.ClientList = clist; } else { ViewBag.ClientList = GetClientsByUserId(User.UserId); // NEW LOGIC! }
|
# ? Dec 15, 2014 18:54 |
|
I don't see the problem with that code.
|
# ? Dec 15, 2014 18:58 |
|
|
# ? Jun 8, 2024 06:34 |
|
The problem is they have a method signature setting, I guess, the flag to false to force the new logic, and yet kept the method signature as it is and the whole code. Because, I dunno. The only other place its used the flag is always true, so I dunno, either it's leftover code from whenever or.. the whole project is stuff like this, I've found classes commented whole and kept around for what I guess passes as stashing. Honest Thief fucked around with this message at 19:13 on Dec 15, 2014 |
# ? Dec 15, 2014 19:00 |