|
omeg posted:He's right if you're really worried about performance. Less pointers in your data structures = better data locality = better cache performance and simpler serialization. But if you're not writing something performance-critical you don't need to worry about that.
|
# ¿ Sep 12, 2012 13:17 |
|
|
# ¿ Apr 30, 2024 04:03 |
|
an insufferable third party posted:How am I supposed to know if my API works if you haven't given me a working consumer of it? Today is going to be fun.
|
# ¿ Oct 22, 2013 13:43 |
|
Suspicious Dish posted:If a third-party is asking about your API, I think it's more than acceptable to ask for an example of a consumer for documentation and evaluation purposes. A third party is /providing/ an API, and doesn't know if it works because I haven't provided them a working client application.
|
# ¿ Oct 22, 2013 16:39 |
|
A contractor is supposed to push something up for my team to review. I'm sure there's a horror in it, but I can't tell you what it is because he can't figure out how to push changes with mercurial. How do these people get past interviews? What is this guy working on?
|
# ¿ Mar 12, 2014 04:27 |
|
if (!(foo > 0)) { .. }
|
# ¿ Mar 26, 2014 23:46 |
|
Volmarias posted:If that's the worst you're finding, you're in a pretty good place all things considered. Volmarias posted:If that's the worst you're finding, you're in a pretty good place all things considered. The function was called something like 'setBar' and it sets the value of baz if foo is <=0. It has nothing to do with bar, though bar is an actual thing. Names are slightly more appropriate than that, but not really because the name of the function still has nothing to do with what it does. Thanks outsourced developers doing things in my codebase.
|
# ¿ Mar 27, 2014 02:10 |
|
PleasingFungus posted:Except, as people discussed, that returns a different value if foo is NaN. Yes, in this case changing it to that would have it produce the correct value if foo is NaN.
|
# ¿ Mar 31, 2014 05:17 |
|
Working on a client application against a server being developed by the guys paying us to write the client. I'm 6 hours into waiting on a deployment that they didn't notify or schedule with us. Naturally, they have failed to deploy all of their environments at the same time. Is this the megathread for software deployment procedure horrors? How do you even deal with this, house an SLA in the contract?
|
# ¿ Apr 23, 2014 01:02 |
|
pseudorandom name posted:Clearly you don't understand what it is to be a founder. Founder of a thing that provides zero value. Does that mean, "I couldn't get a job at AAPL because they don't understand great ideas and people that is why I've made this revolutionary groundbreaking JavaScript framework for cloud fog usability for the modern web on tablets and mobile devices."
|
# ¿ May 20, 2014 14:57 |
|
Recent suggestions are the horror. Why would you write FooByAlgo1(Bar baz) when you could write Bar.Foo(Functor Algo1) and then just write your generic algorithm as a generic algorithm. Similarly functions of the form aFromB(B b) could all be overloads of aFrom(..) so then I don't have to read your dumb code to even figure out all of the overloads and the juniors don't think it's a good idea to copy paste your terrible code into their terrible code.
|
# ¿ Oct 14, 2014 15:43 |
|
Blotto Skorzany posted:Well for one thing, because function pointers and function objects are not functors Category theory may or may not disagree with you, but the superiority of mathematics to the pursuits or peasants is well documented elsewhere.
|
# ¿ Oct 14, 2014 15:55 |
|
Blotto Skorzany posted:Oh no, the cancer has spread to signal processing textbooks! This entry is correct and accurate. Unless you're trolling, in which case I'll use the kernel method of eating popcorn.
|
# ¿ Oct 17, 2014 20:32 |
|
Blue Footed Booby posted:It's incredibly frustrating when sites won't let you specify a custom security question, and then only provide poo poo like "what is your mother's maiden name" that's trivial to find out for anyone whose extended family is on Facebook. I legit made that argument once and one of the security guys (first generation immigrant from Uganda) challenged me to find his mother's maiden name.
|
# ¿ Oct 21, 2014 02:46 |
|
Why isn't all of our data in 3NF? Who cares about database normalization? We control the data, we can do whatever we want with it.
|
# ¿ Feb 13, 2016 04:35 |
|
Subjunctive posted:Performance? Denormalization can be cool and good. I don't want to dump the schema/data here, but performance is presently an issue. As is figuring out where the hell anything is. Performance is mostly an issue because it's impossible to reason about the data rationally, so everything is done with between 3-4 and 3-4N more subqueries than necessary. Good effort though.
|
# ¿ Feb 13, 2016 20:41 |
|
YeOldeButchere posted:Scanning an entire table will tend to do bad things to DB performance, yeah. Maybe I should bring up the genius at an old job who decided to implement an RDBMS on top of a NOSQL DB because NOSQL is better. Every query was an index, so he limited the maximum number of different queries for performance reasons.
|
# ¿ Feb 14, 2016 03:42 |
|
Munkeymon posted:What if I consider excluding people who care deeply enough about whether forms will accept their technically-RFC-compliant addresses that they'll give up and not use my service rather than excluding the comment or whatever from their email a net gain? I'm totally ok with that as long as you aren't a utility provider. I had a /real/ fun time recovering my password when the electric company's sign up email validation presumably used the correct email validation regex and their recovery page did not. I may have asked their support to leave detailed messages about how to fix their poo poo and why they should use an RFC compliant regex for their engineering staff.
|
# ¿ Feb 18, 2016 18:27 |
|
Soricidus posted:I seriously am using θ to represent an angle in some visualisation code. Why not? Because it's difficult for humans to type if they need to edit the code at some point. You might as well use a poo emoji.
|
# ¿ Feb 25, 2016 03:36 |
|
feedmegin posted:Unless the human in question is Greek, of course. People do still speak/type in the language! And if they're doing it on their time or working on a project where Greek is the lingua Franca, then great. I would never pass code through review that used non-standard characters. Standard here meaning within the language and reasonably expected natural keybindings for everyone on the project.
|
# ¿ Feb 25, 2016 14:58 |
|
Subjunctive posted:I think it doesn't hold up, or there would be an else after every branched return. Nobody has that as their house style. If people don't know that return is the end of the function, I don't think there's much to do other than practice reading code? Return is an end to a function. One of potentially many.
|
# ¿ Mar 1, 2016 09:57 |
|
Bognar posted:I always thought naming a child after yourself was a bad idea, simply in the case of having multiple children. It's like you love your first child so much that you gave them your own name, but then the second child comes along and they get... uh, well... some other name I guess, who cares you're child number 2. You could just give your 2+ child your name as well. Or you could give them all a UUID. I'm sure doing that wouldn't break any systems they'll need to put their names in.
|
# ¿ Mar 4, 2016 22:21 |
|
Blinkz0rz posted:esquire is for lawyers Its use is not protected and it traditionally was meant as a title for the educated or otherwise influential people who did not hold a proper title.
|
# ¿ Mar 5, 2016 00:37 |
|
Can someone explain the "logic" behind an API creator asking an API consumer for a working implementation of something consuming their nonexistent API to validate that it works? Shockingly this isn't the first person to do this. (So glad I'm out of this place next week )
|
# ¿ Mar 11, 2016 01:38 |
|
HardDisk posted:To me sounds like the API creator has no idea what they're supposed to be doing. That's my guess but the baffling thing is that in every case it's happened (multiple people, multiple orgs) there's a fully documented spec with example I/O. Hoping has better people.
|
# ¿ Mar 11, 2016 03:13 |
|
Suspicious Dish posted:Maybe I'm misreading this, but perhaps it's to provide example use cases that they should design their API to accommodate? API design is hard and it doesn't seem like thaaaat much of a horror to demand examples of how a consumer expects to use it. Example use cases are in the API doc though. It's not like the thing isn't specified. They just literally don't know how to test their own code.
|
# ¿ Mar 11, 2016 23:23 |
|
Plorkyeran posted:I do fundamentally like the idea of bug tracking being intimately tied to the source repo, and I really wish there were good tools for it. Fossil does it well, but it IMO isn't a very good at the whole source code management side of things. I love fossil. It only occasionally destroys all history of my projects including the working copy.
|
# ¿ Mar 18, 2016 20:05 |
|
foo.split(""[0]); Where do people come up with these crazy ideas?
|
# ¿ May 27, 2016 12:21 |
|
Using a regex is still bad because you need to at minimum perform a bunch of writes and likely an allocation. You have a fixed number of valid characters to test against, so you can just skip everything that isn't valid in constant time per character and run through with a forward and backward iterator in O(N) where N is the length of the input. Testing against both the character's upper/lower also takes constant time per test. As you need to at minimum read the whole string to check the characters, you're already at the best asymptotic time with reasonable use of memory and you can get on with your day and doing something relevant.
|
# ¿ Jun 1, 2016 17:50 |
|
Amberskin posted:Heh, are you and me coworkers perhaps? I'd ask you to name and shame, but I suspect the answer is "literally all of them." Not that it matters because the value of my account (or basically anyone else's) won't get there anyway.
|
# ¿ Jun 14, 2016 12:02 |
|
TooMuchAbstraction posted:There's a perfectly valid reason to insert random {} in your code: it creates scope blocks, so you can e.g. declare a variable that's local to that scope and invalid outside of it. It's not (usually) a common thing to do, though, since usually you'd just make a new function to contain your scope instead. Why would I create a new function and pass/copy a bunch of state when I could just use RAII and have a scoped lock to get to shared data from where I actually want it?
|
# ¿ Jun 14, 2016 21:21 |
|
Klades posted:I'm just trying to think of what has to go wrong for you to have a spot in your code where a variable could be a boolean or it could be a string representation of a boolean value. You're talking about JavaScript, so everything already went wrong.
|
# ¿ Jun 16, 2016 06:42 |
|
|
# ¿ Jun 17, 2016 12:10 |
|
VikingofRock posted:Also I think foo() in your example returns a const char[] instead of a std::string. Not sure if that's better or not; probably depends on the scenario. const char*
|
# ¿ Jun 20, 2016 00:53 |
|
boo_radley posted:I'd rather use midi to manage my infrastructure than JavaScript. I legitimately don't know the use case for node or understand why anyone would want it or decide it was a good idea to create.
|
# ¿ Jun 22, 2016 21:40 |
|
Hammerite posted:I'm 30, glad we agree this is bad of Javascript though They were only 9 years off.. The solution to the problem is to not use JavaScript. It's the solution to all problems with JavaScript.
|
# ¿ Jun 26, 2016 18:54 |
|
ToxicSlurpee posted:Good luck with that. How much stuff out there is legacy stuff heavy on ancient Javascript that nobody wants to pay to replace? I mean worst case I can go write mumps for a medical device company. At least it isn't JavaScript..
|
# ¿ Jun 26, 2016 19:12 |
|
Internet Janitor posted:Just to clarify here are you advocating the use of a bespoke language which compiles into JavaScript or are you advocating the abolishment of web browsers? While I would prefer the latter (at least for interactive applications), I will accept the former.
|
# ¿ Jun 26, 2016 21:35 |
|
Dirty Frank posted:Are you looking for a dom? ASL? I thought people looking for the dom wrote JavaScript.
|
# ¿ Jun 27, 2016 21:53 |
|
VikingofRock posted:What about for special casing to avoid dividing by zero? Don't you end up missing dividing by -0 then?
|
# ¿ Jul 16, 2016 02:33 |
|
|
# ¿ Apr 30, 2024 04:03 |
|
Internet Janitor posted:For that matter, enumerations. A distressing number of languages allow enumerations to decompose into integers and of those quite a few also allow integers to suffice as the enumeration value. The point of an enumeration is to restrict and make explicit a limited set of values which are acceptable inputs to something. If you allow coercions you completely defeat the point. Explicit conversions make it easy to serialize enums, and are totally sensible. Implicit conversion is potentially bad though.
|
# ¿ Jul 16, 2016 16:42 |