|
Jabor posted:Is the first thing that gets done to the result of that query a split on `~'?
|
# ? Mar 11, 2011 23:06 |
|
|
# ? Jun 10, 2024 10:59 |
|
I'm getting this tickling feeling that the whole thing would be done better by BETWEEN time AND time_spent
|
# ? Mar 11, 2011 23:19 |
|
McGlockenshire posted:Why yes, that's exactly it. And can you guess what happens next? a split on : looks like someone only knows how to extract one value from a database call?
|
# ? Mar 11, 2011 23:45 |
|
Tux Racer posted:To my defense though, there is nothing in the API that says it formats it based on characters, not spacing. there was nothing on the knife that said don't place in eye socket. so, now can we get a special case for newlines, whitespace, ascii control codes, unicode space. if you want a language that does this sort of poo poo, use php. (ie the coding horror is you)
|
# ? Mar 11, 2011 23:50 |
|
tef posted:there was nothing on the knife that said don't place in eye socket. I like you.
|
# ? Mar 11, 2011 23:51 |
|
I mean it should have known I was writing to a CSV, HTML, XML, JSON file and escaped the character appropriately, I mean how was I meant to know it worked on *characters* *snort*
|
# ? Mar 11, 2011 23:51 |
|
Tef: hey dude, it's 2011.
|
# ? Mar 12, 2011 00:01 |
|
is this a I am old thing? i.e shut up old man, we don't have time to learn from your mistakes we're moving too quickly and have to make our own mistakes
|
# ? Mar 12, 2011 00:33 |
|
Yes, in 2011 every library should be expected to know about every file format, terminal, and other sinks, including the kitchen's. None of these things take time or testing; do it goddamn it!
|
# ? Mar 12, 2011 01:03 |
|
Just to beat this dead horse some more... From Joshua Bloch's "How to Design a Good API and Why it Matters" talk: quote:Most API designs are over-constrained
|
# ? Mar 12, 2011 01:35 |
|
the talk is awesome, and the slide deck is so verbose you can just read it instead: http://aarontgrogg.com/wp-content/uploads/2009/09/How-to-Build-API-and-why-it-matters.pdf
|
# ? Mar 12, 2011 01:41 |
|
tef posted:there was nothing on the knife that said don't place in eye socket. Forget php, he could write a really good regex that would just do it. It'll be so easy!
|
# ? Mar 12, 2011 04:24 |
|
tef posted:the talk is awesome, and the slide deck is so verbose you can just read it instead: I'll also give some anecdotal evidence to support the reasoning behind some of the ideas in this talk. Bloch's experience is miles beyond my mine but, sometimes it helps to have specific examples to illustrate why a best practice is actually a best a practice. I worked on a project where we had inherited a bunch of code from a legacy system. The part of the team that was assigned to my area was working mainly on the central data access component of the legacy system. The original intent of that component was to provide data in a format that was a low level common abstraction that was useful for all users of the component (going back to the "pissing everyone off equally" mentality). That worked well for a while but, eventually, the data models from other parts of the system were moved into the central data access component. This seemed great from the perspective of the groups who were moving their data models from their components into the central data access component; less code for them to maintain. The problem was that, of course, the knowledge of why these data models existed in the first place was lost. So, now, the maintainers of the central data component had to deal with a lot of issues and bugs with data models of which they had no knowledge about and, these issues distracted from their real focus of making data available in the "lowest common denominator" format. A few years down the road, as the cycle continues, a new project came along that needed to use this central data access module, since not doing so would mean a huge increase in cost to the customer; management had already sold the customer on the fact that we already had a lot of existing functionality that we could leverage. The main problem was that, the precedence had been set as far as this central data access component being responsible for providing data in whatever format anyone else wants the data in. Fighting this decision took a considerable amount of time and money. Eventually, the correct decision was made to move the external component specific data models back into the components that needed them but, it took a lot of time and money to get everyone to agree on that. So, moral of the story is, again, an API will generally not fill your specific needs. However, there is often a reasonable explanation behind this; and, if the API is designed correctly, the API will provide building blocks that you can then use to create what you need.
|
# ? Mar 12, 2011 07:41 |
|
tef posted:(ie the coding horror is you) for example: https://groups.google.com/group/microsoft.public.win32.programmer.kernel/browse_thread/thread/6326c306e22e05bb/c0fee26e301bbcf2 wherein a programmer decides to use 32-bit Windows process IDs as 16-bit indexes to a flat array and refuses to listen to everybody saying "what, no" quote:Obviously I can't disclose the underlying motivation but suffice to say it has reduced a small CPU intensive bottleneck in an area that is otherwise impossible to address, we are seeing a 50% drop in CPU on an operation that is small but performed frequently in our case.
|
# ? Mar 12, 2011 10:54 |
|
I like that, "Obviously".
|
# ? Mar 12, 2011 12:04 |
|
What the gently caress are they doing where looking up stuff by process ID is so time critical it accounts for a 50% speed increase?
|
# ? Mar 12, 2011 15:50 |
|
ymgve posted:What the gently caress are they doing where looking up stuff by process ID is so time critical it accounts for a 50% speed increase? 50% speed increase of that operation, even. Whatever they're doing, they probably shouldn't be doing it. I like how the guy is defending his decision by talking about his 40 years in the industry and all the stuff he's done...
|
# ? Mar 12, 2011 16:05 |
|
Vinterstum posted:50% speed increase of that operation, even. Whatever they're doing, they probably shouldn't be doing it. I like how he's defending his decision against a member of the windows kernel team. In a more perfect world the people who implement internals of widespread systems like this will occasionally change some undefined behavior just to teach people like this a lesson and have it serve as a public warning to others.
|
# ? Mar 12, 2011 19:09 |
|
Except that working around the stupidity of others is one of the reasons why Windows is such a huge success.
|
# ? Mar 12, 2011 19:14 |
|
pseudorandom name posted:Except that working around the stupidity of others is one of the reasons why Windows is such a huge success. There's commitment to back compatibility and then there's the stuff Raymond Chen writes about. That ridiculous thread posted:Whilst I don't agree with all your points, I must say that this Documentation being outright wrong is one thing, but undefined behavior is left undefined for a reason. It's undefined because it does not matter as long as you're doing things right, it cannot be relied upon, and it may change for any reason. Declaring every internal detail in API docs breaks encapsulation just like exposing implementation details in the API itself does.
|
# ? Mar 12, 2011 19:49 |
|
Karanth posted:Documentation being outright wrong is one thing, but undefined behavior is left undefined for a reason. It's undefined because it does not matter as long as you're doing things right, it cannot be relied upon, and it may change for any reason. Declaring every internal detail in API docs breaks encapsulation just like exposing implementation details in the API itself does. I don't have precise examples, but one of the things that came up in the MS antitrust cases was that the APIs had many many undocumented but public interfaces, and that Microsoft would use them in their own products. So their products (eg Office or whatever) could do things that could not be done using only the API as described in the documentation. A lot of people reverse engineered the API features, but Microsoft would change them in a way that would break other products but not their own. When the NT code was leaked, they found tons of workarounds to prevent Office etc from breaking due to it using an undocumented feature that had been changed. In the intervening years I think Microsoft has gotten a lot better in that respect, probably as a result of open source and the realization that they need to support Windows developers as much as possible rather than seeing them as competitors and throwing them under the bus whenever possible. And MSDN has gotten really really good.
|
# ? Mar 13, 2011 00:35 |
|
evensevenone posted:I don't have precise examples, but one of the things that came up in the MS antitrust cases was that the APIs had many many undocumented but public interfaces, and that Microsoft would use them in their own products. So their products (eg Office or whatever) could do things that could not be done using only the API as described in the documentation. A lot of people reverse engineered the API features, but Microsoft would change them in a way that would break other products but not their own. When the NT code was leaked, they found tons of workarounds to prevent Office etc from breaking due to it using an undocumented feature that had been changed. I understand what you're saying about Microsoft specifically, but I'm fully in favor of punishing anyone who relies on undefined behavior equally. Apps made by the same company don't get a pass, if anything that's even more reason why they should know better.
|
# ? Mar 13, 2011 01:55 |
|
Just going to throw this out here:code:
|
# ? Mar 13, 2011 02:25 |
|
Randel Candygram posted:Just going to throw this out here: So they have a tree of 4096-byte pages, a straightforward fixed-depth sparse vector with each node taking exactly one page. What's the horror?
|
# ? Mar 13, 2011 02:49 |
|
shrughes posted:So they have a tree of 4096-byte pages, a straightforward fixed-depth sparse vector with each node taking exactly one page. What's the horror? I think some would find the vomiting of raw meat kind of horrible. Also making a comment that says "I'm not explaining this" and then never going back and fixing it.
|
# ? Mar 13, 2011 03:11 |
|
Aleksei Vasiliev posted:we obviously need a Coder Horror thread quote:This is called thinking out of the box incidentally, for those of an overly
|
# ? Mar 13, 2011 03:45 |
|
shrughes posted:So they have a tree of 4096-byte pages, a straightforward fixed-depth sparse vector with each node taking exactly one page. What's the horror? Do you often ship code detailing your meat-vomiting habits?
|
# ? Mar 13, 2011 03:54 |
|
quote:I really don't think it is possible to develop non-trivial working software However, it is possible to develop non-trivial working software systems that don't make assumptions that are trivially falsifiable.
|
# ? Mar 13, 2011 09:06 |
|
Randel Candygram posted:Do you often ship code detailing your meat-vomiting habits?
|
# ? Mar 14, 2011 00:31 |
|
tef posted:the talk is awesome, and the slide deck is so verbose you can just read it instead: As someone who has spent a lot of time sitting, thinking of a good name for something when I could've been coding instead I find this bit very encouraging. quote:Functionality should be easy to explain
|
# ? Mar 14, 2011 13:16 |
|
a framework I wrote for a previous company had some things for getters/setters for a http request (i.e post vars, charset - to handle encoding and bits). I agonized over the name and ended up with one name in particular being terrible -- but moved on as I didn't have enough time. Turns out it is one of the major complaints about it
|
# ? Mar 14, 2011 15:26 |
|
Here's a fun thing. Been working with Flash on a side project. Internally Flash uses a dialect of ECMAScript, but instead of taking the opportunity on fixing up ECMAScript, Adobe instead turns it into Yet Another Java Style Language (YAJSL). This is probably because old ActionScript was slow, and Adobe's terrible middle eastern factory line programmers can't figure out how to optimize a dynamic langage. So that's bad enough, but the real horror starts when you run into the problem that the Flash VM is different in Internet Explorer than the Everything Else VM. For instance, this works fine in any other Flash VM code:
Fixing it requires this: code:
code:
Microsoft and Adobe: Together it's like Godzilla and Mechagodzilla ravaging a city of weary developers who just want to Get poo poo Done, and would be if these loving lizards get off the lawn.
|
# ? Mar 14, 2011 17:48 |
|
Dren posted:As someone who has spent a lot of time sitting, thinking of a good name for something when I could've been coding instead I find this bit very encouraging. code:
|
# ? Mar 15, 2011 04:15 |
|
Dren posted:As someone who has spent a lot of time sitting, thinking of a good name for something when I could've been coding instead I find this bit very encouraging. Doesn't that mean you've wrote a lot of bad code? I would find that discouraging.
|
# ? Mar 15, 2011 05:38 |
|
Thermopyle posted:Doesn't that mean you've wrote a lot of bad code? I would find that discouraging. Like you only poo poo out gold nuggets?
|
# ? Mar 15, 2011 06:16 |
|
MEAT TREAT posted:Like you only poo poo out gold nuggets? No. I wasn't being disparaging anyone. I was saying that from what he said, I didn't get how it would be encouraging. Person 1: "I spend lots of time trying to come up with names" Person 2: "Spending lots of time on naming is a bad sign." Person 1: "I find that encouraging!" Me: "What?"
|
# ? Mar 15, 2011 08:04 |
|
Thermopyle posted:No. I wasn't being disparaging anyone. Dren's belief that naming is important was independently echoed, and Dren is encouraged by this.
|
# ? Mar 15, 2011 09:31 |
|
I regularly find naming to be the hardest part of development. However, I don't like the contention that being unable to name something means you don't have a good grasp on what the component's function is. While that certainly can be true I often struggle with naming something that I have a very clear idea on its role, I just can't think of a snappy way to sum that functionality up. Maybe I just have a bad vocabulary but in my experience most devs share this problem.
|
# ? Mar 15, 2011 17:45 |
|
naming things is one of the two hardest problems in computer science. the other two are cache invalidation and off by one errors.
|
# ? Mar 15, 2011 17:59 |
|
|
# ? Jun 10, 2024 10:59 |
|
This is like a daily occurrence for me (i do lots of embedded state machines)code:
|
# ? Mar 15, 2011 21:03 |