|
rjmccall posted:Sorry, I meant "block results that are clearly unused". The only case where that's not trivial to decide at parse-time is a function body result. In the absence of an explicit void type annotation, emitting a type-mismatch error there seems preferable to making semicolons significant. Sorry that you like to turn trivial implementation hurdles into annoyances for your users, though. Are you seriously writing while loops and getting angry when you forget the semicolon on the last statement and the code doesn't compile?
|
# ? Apr 29, 2014 09:51 |
|
|
# ? Jun 6, 2024 05:58 |
|
as someone who's had to do a couple of years' work in VB.NET, writing complex functional-style code in an environment where even its ternary operator is unreliable and type inference regularly fails, i would really like a good expression language about now
|
# ? Apr 29, 2014 10:02 |
|
shrughes posted:Are you seriously writing while loops and getting angry when you forget the semicolon on the last statement and the code doesn't compile? I don't use Rust. This semicolon thing is not a great evil. It is not devilishly difficult to master. It is, however, a silly and unnecessary wart forced by a long series of poor decisions by people whose concept of language design is just thoughtlessly copying poo poo out of languages that they consider sophisticated and cool. You will note that the history of this particular feature in Rust appears to have been: (1) Graydon wanted statements, (2) Graydon got tired of arguing about it, (3) Graydon put it up for a vote with a reasonable discussion of the merits of all the options, and then (4) the hipster brigade swarmed in saying "rah-rah expression languages are awesome".
|
# ? Apr 29, 2014 11:12 |
|
So assuming the opposite of expression language is statement language; care to name a statement language that doesn't have warts caused by that decision?
|
# ? Apr 29, 2014 11:18 |
|
Found in our iOS app:Objective-C code:
According to the profiler, this treasure of programming accounts for ~40% of our CPU time under stress (to be fair, part of it due to the fact that it's called unnecessarily often)
|
# ? Apr 29, 2014 14:16 |
|
Man, I keep forgetting how ugly Objective-C looks. That bracket notation with required named parameters makes for some hideous code.
|
# ? Apr 29, 2014 14:27 |
|
Bognar posted:Man, I keep forgetting how ugly Objective-C looks. That bracket notation with required named parameters makes for some hideous code. I think in the example it's the space after the named parameter. What's written above as: int weekday = [[calendar components: unitFlags fromDate: referenceDate] weekday] - 1; Is usually written as int weekday = [[calendar components:unitFlags fromDate:referenceDate] weekday] - 1; or more likely: NSInteger weekday = [calendar components:unitFlags fromDate:referenceDate].weekday - 1; And for Objective C the bigger horror is that the named parameters aren't required. Just very strongly recommended. I raged at work yesterday dealing with a 3rd party that had a function like: code:
rather than the more idiomatic [tracker trackEvent:@"This is my title" withValue:@"This is my value"]; the unnamed argument just brought me to a halt each time since it's so non-idomatic though allowable. (rjmccall we need a clang analyzer warning for it!)
|
# ? Apr 29, 2014 14:45 |
|
substitute posted:Yes, PHP is loosely typed, so... I'm not seeing the issue with that, or at least, I don't think the issue is what you described it as. PHP may be tolerant of using uninitialised variables, but it is still bad style to do it. Now you could argue that if some code fails to set the $page_title before creating a page then it is better for a notice about an uninitialised variable to show up during development than for the user to see a page titled "Derp!", but that's a slightly different issue. Also, what is this called? I haven't seen it before. php:<? (not a function, or class) // ... (END not a function, or class) ?>
|
# ? Apr 29, 2014 14:49 |
|
Color Gray posted:Here's one of the best examples from mine:
|
# ? Apr 29, 2014 15:07 |
Hammerite posted:Also, what is this called? I haven't seen it before. Global scope.
|
|
# ? Apr 29, 2014 15:08 |
|
nielsm posted:Global scope. No, I mean the (label) ... (END label) thing.
|
# ? Apr 29, 2014 15:31 |
|
Yeah declaring variables is good practice, but I thought this was silly last night when I came across it in some purely procedural as all hell code. Like, I think I'll get that your array vars are arrays (since they have _array) when I scroll down. I need to stop drinking. And the post assumes everyone knows our set-up -- E_NOTICE turned off immediately. The END thing was by habit because I see START whatever and END whatever all over the place all the time around here, in PHP, CSS, HTML. substitute fucked around with this message at 16:18 on Apr 29, 2014 |
# ? Apr 29, 2014 16:16 |
|
Hughlander posted:And for Objective C the bigger horror is that the named parameters aren't required. Just very strongly recommended. I raged at work yesterday dealing with a 3rd party that had a function like: Check out the deprecated sections of DOMDocument.h and other WebKit DOM classes.
|
# ? Apr 29, 2014 16:51 |
|
Hammerite posted:No, I mean the (label) ... (END label) thing. That is not part of PHP, I think he added it to show that it was in the global namespace. substitute posted:E_NOTICE turned off immediately. This is the real horror.
|
# ? Apr 29, 2014 17:09 |
|
Hughlander posted:(rjmccall we need a clang analyzer warning for it!) That's really more of a style-checker feature. We keep meaning to do a style checker; Google wrote most of one for us, we just need to extend it to Objective-C. We do have a warning for the common case of doing it accidentally, i.e.: Objective-C code:
|
# ? Apr 29, 2014 17:12 |
|
necrotic posted:
Yep, but our servers would explode from the logs otherwise. I don't deal with that stuff.
|
# ? Apr 29, 2014 17:15 |
|
Zombywuf posted:So assuming the opposite of expression language is statement language; care to name a statement language that doesn't have warts caused by that decision? Gonna be hard, because they all have the ternary ?: wart. I guess the trailing-semi magic in Rust would go away if you had to explicitly say () at the end of an expression to squash to void. code:
I'm not sure that's better, but it'd be a clearer cliché at least. I, too, wish Graydon had held the line.
|
# ? Apr 29, 2014 17:44 |
|
shrughes posted:and when your for loops are actually lambdas (or was that just do blocks?)
|
# ? Apr 29, 2014 18:08 |
|
Check out this Python string:code:
|
# ? Apr 29, 2014 18:49 |
|
Ithaqua posted:Hey, look on the bright side: You learned some new stuff about Roslyn today. Might I also recommend running FxCop/Code Analysis on the application? It'll return a billion problems of varying severity (like naming convention violations), but you can configure it to suppress the less important stuff. While I'm on my Coding horrors bully pulpit, let's talk SCM/DevOps types. With some gentle prodding management has agreed to hire a dedicated SCM/DevOps/Release Manager type. Basically someone to help us go from 'manual builds everywhere' to well...poo poo that doesn't suck. CI, repeatable automated builds and deploys, etc. I've worked with good and bad SCM's in the past, but I'm having difficulty coalescing interview questions that'll help me quantify a good SCM vs. a bad SCM in an interview. I've been a rump SCM guy in the past, setting up CruiseControl servers, MSBuild and nAnt automation, as well as unit test plans in the past, but I'm feeling overwhelmed as far as how I can tell the difference between a douche and someone who will help us dig ourselves out of our process hole in the span of a 1 hour interview.
|
# ? Apr 30, 2014 04:50 |
|
Verloc posted:Thank you for your helpfulness, optimism, and PM'd Roslyn code snippets. This shop is stuck in the dark ages, but that Roslyn snippet you sent me will soon be the beating heart of a silent catch detector that'll go a long way towards keeping me from slipping off of that balance point of functional alcoholism. First problem: Hiring a "devops" guy. I've seen no compelling reason for this role. Devops is about increasing collaboration and communication between developers and infrastructure. If you need automated builds and deployments, start allocating time to do it. If you can't convince management that the time investment is worthwhile, you're already doomed. Who's going to know how to deploy your software better than the guy who's writing it? Who's going to know about the environments that run the software better than the guy who's setting them up? A CI build will take you, at worst, a day to get running (usually it's more like 10 minutes). Depending on the tooling you choose and how complex the deployments are, an automated release will take you a few days to get going, but after it's up and running, you'll probably barely ever have to touch it. Why is this a full-time position again? Also, if you're not opposed to spending some money on licensing and you're already invested in MS technologies, Microsoft's release management package works beautifully.
|
# ? Apr 30, 2014 14:07 |
|
Ithaqua posted:First problem: Hiring a "devops" guy. I've seen no compelling reason for this role. Devops is about increasing collaboration and communication between developers and infrastructure. If you need automated builds and deployments, start allocating time to do it. If you can't convince management that the time investment is worthwhile, you're already doomed. Yeah, don't hire dev ops, just get yourself a Full Stack Developer.
|
# ? Apr 30, 2014 14:55 |
|
Ithaqua posted:Who's going to know how to deploy your software better than the guy who's writing it? Who's going to know about the environments that run the software better than the guy who's setting them up? Possibly someone with expertise and experience in deploying and managing production environments? I'm not saying he needs a dedicated devops person, but having devops responsibilities evenly distributed among developers is far from the being the ideal situation for all circumstances
|
# ? Apr 30, 2014 16:05 |
|
To me, the whole point of a DevOps role is that you need a person (a) Good at development and systems administration and (b) Doesn't write code so they can focus on operations instead. Having a developer be responsible for deployments is not really DevOps. If you can accomplish all of your company's goals without any dedicated DevOps personnel, then you probably don't need a DevOps team to begin with. You can do continuous deployment without a DevOps team. The whole 'DevOps' concept is better suited to large companies that not only have a lot of infrastructure to run, but also a lot of rigidly separated departments that need walls broken down to facilitate getting poo poo done.
|
# ? Apr 30, 2014 16:22 |
|
Devops is about how you structure your entire company. If you have a fairly traditional setup and think you can just rub some devops on it you are going to fail.
|
# ? Apr 30, 2014 16:43 |
|
Just got some new code from the India team that nobody has been reviewing for the last 3 monthscode:
There's so much other scary poo poo in this codebase, such as using a singleton like a local variable in a web service. eg: code:
|
# ? Apr 30, 2014 16:54 |
|
You hire devops/scm/releng people not because they have generic quirks making them able to do unique tasks, but because they're *interested* in the field. So they look for ways to improve, investigate other tools and processes, willingly wear a pager, measure things, etc. WRT interview questions, I'll try to get some examples from the FB mobile release team once they're done with F8 today (and possibly drinking for 24 hours).
|
# ? Apr 30, 2014 17:15 |
|
Ithaqua posted:A CI build will take you, at worst, a day to get running (usually it's more like 10 minutes). Depending on the tooling you choose and how complex the deployments are, an automated release will take you a few days to get going, but after it's up and running, you'll probably barely ever have to touch it. Why is this a full-time position again? Because the last guy made a lot of blasé assumptions?
|
# ? Apr 30, 2014 18:02 |
|
Ithaqua posted:First problem: Hiring a "devops" guy. I've seen no compelling reason for this role. Devops is about increasing collaboration and communication between developers and infrastructure. If you need automated builds and deployments, start allocating time to do it. If you can't convince management that the time investment is worthwhile, you're already doomed. I don't find that to be the case at all. Most of our developers don't need to care about how applications are deployed or scaled. They're welcome to participate in those decisions / actual implementation and we absolutely encourage it (devopzzzz) but we don't require it of them. We build tooling around our infrastructure allowing them to deploy applications and services themselves so they can continue to work on their projects without being bothered with configuring CI jobs, deployment scripts, etc.
|
# ? Apr 30, 2014 18:51 |
|
QuarkJets posted:Check out this Python string: Isn't it meant to only delete if the table row survives the join to other_table? Unless that's unnecessary or just unintended.
|
# ? Apr 30, 2014 18:53 |
|
dexter posted:Most of our developers don't need to care about how applications are deployed or scaled. Whoa, what? What kind of software do you guys build?
|
# ? Apr 30, 2014 18:54 |
|
Zombywuf posted:Devops is about how you structure your entire company. If you have a fairly traditional setup and think you can just rub some devops on it you are going to fail. Devops was invented by managers at google who didn't like 10% time, since only full developers get it and devops don't. [/cynic]
|
# ? Apr 30, 2014 19:05 |
|
Today's horror: most of the heap-size management code in the Android GC. Mein leben.
|
# ? Apr 30, 2014 19:10 |
|
revmoo posted:The whole 'DevOps' concept is better suited to large companies that not only have a lot of infrastructure to run, but also a lot of rigidly separated departments that need walls broken down to facilitate getting poo poo done. Subjunctive posted:You hire devops/scm/releng people not because they have generic quirks making them able to do unique tasks, but because they're *interested* in the field. So they look for ways to improve, investigate other tools and processes, willingly wear a pager, measure things, etc.
|
# ? Apr 30, 2014 19:53 |
|
revmoo posted:Whoa, what? What kind of software do you guys build? Web applications; I say most because new people working on an already deployed application don't need to care about those things. If someone's creating a new application or service then they're absolutely involved in the deployment.
|
# ? Apr 30, 2014 20:00 |
|
Found this today:code:
|
# ? Apr 30, 2014 21:08 |
|
Alien Arcana posted:Found this today: Heh, if this is C++ and operationSuccess is as uninitialized as I suspect it is, it's not even guaranteed to be set to true because of undefined behaviour.
|
# ? Apr 30, 2014 21:12 |
|
Edison was a dick posted:Heh, if this is C++ and operationSuccess is as uninitialized as I suspect it is, it's not even guaranteed to be set to true because of undefined behaviour. If it were 0 that would be the case too. Presumably it's supposed to end up set to true only if several of these operations succeed.
|
# ? Apr 30, 2014 21:21 |
|
$5 says operationSuccess is initialized as being true and the operation is able to silently fail without actually throwing an exception. Edit: it's worse if there are multiple operations because you can get a case where the first fails silently (returns false but the execution succeeded so no throw) but the last succeeds so any later test you do on the value incorrectly returns true. Powerful Two-Hander fucked around with this message at 00:29 on May 1, 2014 |
# ? May 1, 2014 00:24 |
|
|
# ? Jun 6, 2024 05:58 |
|
Hello, I've come to enforce the idea that all physics code is incomprehensible. I have tremendous respect for the people who can take a random paper and turn it into a working implementation, but I can't say that I'm at all fond of 950 line monstrosities like this.C++ code:
|
# ? May 1, 2014 02:32 |