|
The point is, ladies and gentleman, that goto, for lack of a better word, is good. goto is right. goto works. goto clarifies, cuts through,
|
# ¿ Feb 13, 2017 16:18 |
|
|
# ¿ May 6, 2024 14:01 |
|
Hammerite posted:Sounds like they need to take a leaf out of PHP's book and add a -Wactually-all, haha PHP had an E_ALL error-reporting level which did not actually report all of the errors. However, PHP eventually fixed that.
|
# ¿ Feb 14, 2017 11:12 |
|
Is there no builder notation for assembling SQL queries? I'm surprised that hand-writing the string would be the state of the art.
|
# ¿ Feb 26, 2017 03:21 |
|
G.K. Chesterton posted:In the matter of reforming things, as distinct from deforming them, there is one plain and simple principle; a principle which will probably be called a paradox. There exists in such a case a certain institution or law; let us say, for the sake of simplicity, a fence or gate erected across a road. The more modern type of reformer goes gaily up to it and says, “I don’t see the use of this; let us clear it away." To which the more intelligent type of reformer will do well to answer: "If you don’t see the use of it, I certainly won’t let you clear it away. Go away and think. Then, when you can come back and tell me that you do see the use of it, I may allow you to destroy it. This, but for coding best practice.
|
# ¿ Mar 19, 2017 18:46 |
|
I believe MOD(x, 1) would also do the job?
|
# ¿ Mar 29, 2017 21:02 |
|
ExcessBLarg! posted:Yeah, that works to some extent. Part of being an experienced programmer though is having enough intuition around the problem to anticipate where the requirements are likely to change (and thus, write that portion with sufficient flexibility that it doesn't require a major refactor every time a requirement comes in), but also to avoid over complicating the design. Plus, because it's a toy problem, it's difficult to anticipate the possible toy additional requirements which might be introduced later on.
|
# ¿ Apr 2, 2017 11:00 |
|
It should be.
|
# ¿ Apr 3, 2017 18:03 |
|
Gosh.
|
# ¿ Apr 3, 2017 23:53 |
|
JawnV6 posted:I worked with a perl/SQL abomination that would build up queries. It had some definitions to help, namely That's magical.
|
# ¿ Apr 13, 2017 21:59 |
|
feedmegin posted:JS does have a 64 bit type. IEEE 64 bit floating point! Just use that 64-bit inode number directly as a float then, problem solved!
|
# ¿ Apr 19, 2017 21:09 |
|
Dex posted:i finally understand why skynet decided killing all humans was the best thing to do Because the SQL making up its innards causes it to seek revenge, or because then nobody has a NULL death date?
|
# ¿ Apr 30, 2017 20:13 |
|
Spatial posted:kill the product so we can release the corpse on time Nicely put.
|
# ¿ May 29, 2017 16:10 |
|
Snak posted:There were people in my class who would push code to master without checking if it even compiled. That's good experience for the workplace.
|
# ¿ May 30, 2017 15:31 |
|
Bongo Bill posted:'Course, in cases like that, I prefer to do something like
|
# ¿ Jun 2, 2017 09:06 |
|
redleader posted:Lol if you don't believe that scenario is possible, nay, likely. Lots of things are possible but some stories are just a little bit too perfect. Whether or not it's a real thing which necessarily happened in so many words, this is still a useful parable.
|
# ¿ Jun 6, 2017 15:26 |
|
itskage posted:So I found this yesterday: Less than 100% code coverage in your unit tests, eh? Dear me.
|
# ¿ Jun 15, 2017 17:20 |
|
idiotmeat posted:I can totally see some language introducing that as the "equals but not equal to" operator. Ah, from the same people who introduced SQL's LIKE BUT NOT, LIKE, LIKE LIKE.
|
# ¿ Jun 17, 2017 22:59 |
|
Honestly, that's the easy stuff. It's relaxing, like pruning topiary.
|
# ¿ Jun 26, 2017 23:49 |
|
Internet Janitor posted:Good news folks, pad-left has been obsoleted by ES8! Thankfully, the ES8 implementation actually truncates the output to the correct length instead of, like pad-left and left-pad, just blindly assuming that the filler string has length 1, and returning garbage if it doesn't.
|
# ¿ Jul 11, 2017 21:21 |
|
Absurd Alhazred posted:Reminds me of a bug I found in our code a few months ago: This should be a syntax error.
|
# ¿ Jul 16, 2017 11:20 |
|
How come for(;;) { ... } works, anyway? Shouldn't that at least be for(;true;) { ... }? Or does an empty statement return true??
|
# ¿ Jul 18, 2017 11:53 |
|
Gazpacho posted:The direct answer is that it works because the compiler makes it work. And the implicit result is true rather than false because a loop that implicitly terminates rather than implicitly repeating isn't much of a loop. So how come while() { ... }, with no condition, is a syntax error?
|
# ¿ Jul 25, 2017 08:56 |
|
Gazpacho posted:There are no "empty expressions" in C. I don't understand what you mean by this, aren't there at least three empty expressions, possibly four, in for (;;) { }? Does ; by itself evaluate to true? In any case, it doesn't make sense that omitting the condition in a for loop and omitting the condition in a while loop don't do the same thing. That's strangely inconsistent language design.
|
# ¿ Jul 25, 2017 20:32 |
|
Rubellavator posted:Today I broke a jasmine test that looked like this: How did that ever pass?
|
# ¿ Jul 28, 2017 11:16 |
|
Nippashish posted:I'm pretty sure Perl is entirely designed around being maximally clever. The purpose of calling ASCII operators "Texas" is so that when a Perl 6 programmer calls ASCII operators "Texas", somebody else has no choice but to ask why they call ASCII operators "Texas", which leads naturally into a delightful and exasperating conversation about Perl 6. It has nothing to do with overarching language design or consistency, it's intended to trap people for the purposes of evangelism. It's the same with any cutesy feature of Perl 5 or Perl 6. It's the most maddening way to design a programming language I've ever seen. Perl 6 Booleans have a successor method which always returns True. Perl 6 has five equality operators: eqv, ==, eq, ===, =:=. Perl 6 has a role Stringy for anything which can act like a string, Str, Uni, Blob, which apparently does nothing. It has a concept Cool which, despite being an adjective, is not a role but a class; "Cool" actually stands for "convenient object-oriented loop". Again, it is not a role, nor is it a programming construct, certainly not a loop; it's a class. "Perl 6 intentionally confuses items and single-element lists", which means that, whereas in Perl 5 any value could be used alternately as a string or a number and it was largely impossible to distinguish the two, in Perl 6 any value can be used alternately as a string, a number or a list. And a string, of course, when considered as a list, always has length 1. This is everything I know about Perl 6.
|
# ¿ Aug 10, 2017 21:47 |
|
Oh, almost forgot: it's not "loop", it's actually loopback. Yeah, like the network address. Intentionally.
|
# ¿ Aug 10, 2017 21:53 |
|
Perl code:
|
# ¿ Aug 10, 2017 23:36 |
|
TooMuchAbstraction posted:Perl also has the `unless` conditional so you can do e.g. "i++ unless i % 2". Plus it lets you do confusing triple negatives, like this! Perl code:
|
# ¿ Aug 11, 2017 16:06 |
|
fritz posted:print "that's perl everybody" if $a==$b; Careful: $a and $b are reserved globals! They're used for sorting, and changing them causes sorting to break. Perl code:
|
# ¿ Aug 11, 2017 16:22 |
|
necrotic posted:I know how it happens, but not someone does the third change and goes "gently caress that". I've all but banned the use of unless in our code base except in basic guard conditions. Affirmatives or GTFO. I think the unless keyword was a mistake but I can't even tolerate double negatives, like an if with a negative condition and an else block. Just swap the blocks and make it an affirmative condition.
|
# ¿ Aug 11, 2017 20:28 |
|
Suspicious Dish posted:but do you consider "foo != null" an affirmative or negative condition A negative condition. As in: code:
|
# ¿ Aug 11, 2017 21:23 |
|
Rubellavator posted:We have some security requirement that basically tells us we can't expose any kind of information about what went wrong and for some reason that includes http error codes. By that logic you could return 200 OK to all requests regardless of what happened. Or take the server offline entirely, I hear that's good for security.
|
# ¿ Aug 17, 2017 23:09 |
|
canis minor posted:Phh... my first name contains an ł and so far: This is a double-edged sword but I feel as if there should be an internationally recognised schema for representing human names. Even if it's just "any [perhaps normalized] Unicode string" or "an arbitrary sequence of binary data", that's fine, but I want to get us to a situation where, when a system chokes on a legitimate name, we are able to point at the system (not the name, not the person bearing that name) and say, "The system is wrong. Illegal in its non-compliance, even. You, the creator of the system, are at fault; you must fix it or suffer consequences." I know there will always be names not representable in any such schema. But we can definitely do better than the current state of the art.
|
# ¿ Aug 19, 2017 00:01 |
|
How do other package registries prevent typo squatting?
|
# ¿ Aug 30, 2017 11:37 |
|
Sedro posted:Maven has namespaced packages and uses a verification step (e.g. prove that you own the domain) before assigning those namespaces. What about typosquatting the namespaces, though?
|
# ¿ Aug 31, 2017 16:49 |
|
PhantomOfTheCopier posted:i,j non-negative and less than or equal to the length of the list Hmm, wouldn't llidx take care of that? PhantomOfTheCopier posted:Then there are circular lists... And another hmm, I would have thought a circular list was always a mistake? If the circular list goes ABCBCBCBCBCBC... and you ask to swap elements 1 and 2, is the expected result ACBBCBCBCBCBC... or ACBCBCBCBCBCB...? (Seriously, the first thing I'd do here is write a bunch of unit tests.) Doom Mathematic fucked around with this message at 19:45 on Sep 3, 2017 |
# ¿ Sep 3, 2017 19:36 |
|
I'm getting really confused here. The number 1.0, as a float32, precisely represents the real number 1, to as many decimal places as you want. Upcasting to float64 doesn't alter that. But at least two people in this thread have said the opposite.
|
# ¿ Sep 29, 2017 14:38 |
|
Jabor posted:It's not about the decimal representation at all. I don't know, what?
|
# ¿ Sep 29, 2017 14:47 |
|
Ranzear posted:
This version of the code doesn't call ComputeSomething in the case when bar is truthy. It also misses quite a few potential truthy values of bar. Buddy check failed!
|
# ¿ Oct 2, 2017 11:04 |
|
|
# ¿ May 6, 2024 14:01 |
|
It can be pretty tricky to maintain a secure footing when your threat model is "things which don't exist".
|
# ¿ Oct 10, 2017 16:36 |