|
LMAO at people who have few enough servers that names matter Or aren't just creating and destroying them as needed with stateless clones of services
|
# ? Nov 10, 2014 22:18 |
|
|
# ? Jun 3, 2024 22:08 |
|
Malcolm XML posted:Or aren't just creating and destroying them as needed with stateless clones of services Most places I see are just coming out of the dark ages and aren't anywhere near mature enough for doing something like that. It's a good thing to aspire to, though. The idea of CI builds and automated tests are still mind-bogglingly modern to them.
|
# ? Nov 10, 2014 22:40 |
|
The nutbar that used to be the senior admin around here likes to use disaster names and rather presciently picked tsunami in November 2004. Wouldn't be so bad but the idiot didn't rename it before calling in for tech support in early January the next year to getting something set up. Tech support was, of course, in Indonesia.
|
# ? Nov 10, 2014 22:49 |
|
Munkeymon posted:The nutbar that used to be the senior admin around here likes to use disaster names and rather presciently picked tsunami in November 2004. Wouldn't be so bad but the idiot didn't rename it before calling in for tech support in early January the next year to getting something set up. Tech support was, of course, in Indonesia. Congratulations (?), you have managed to get the server-name derail back on topic.
|
# ? Nov 10, 2014 23:04 |
|
Also I ran into some servers named after my little ponies today and I think I want to kill someone.
|
# ? Nov 10, 2014 23:07 |
|
Soricidus posted:Congratulations (?), you have managed to get the server-name derail back on topic. The best server names I've come across were when someone st the college's IT department set up the four mac servers (they used to make actual servers!) with the names of the four horsemen. Logging into death was often the highlight of my day.
|
# ? Nov 10, 2014 23:32 |
|
But seriously, don't be annoying. Just name your machines (front,app,dev,db) plus a number if there are multiple.
|
# ? Nov 10, 2014 23:42 |
|
Ithaqua posted:Most places I see are just coming out of the dark ages and aren't anywhere near mature enough for doing something like that. It's a good thing to aspire to, though. INSTANCE_018 is down? Issue a reboot command and call me in the morning. like honestly there is no other way to build a large distributed application architecture CI and automated tests are orthogonal to this the one server where we broke this law is the one that's causing us the most pain, natch
|
# ? Nov 10, 2014 23:45 |
|
One of my clients has a system that serves media content for off-site advertising displays. Different types of content get put into different media playlists which the displays then cycle through. Some of the content is loaded manually, some pulled automatically, e.g. from a facebook feed or so. So a task runs every 30 seconds to check if any content for any playlist has changed, and if so, create a new playlist. All reasonable and straightforward. So I've been asked by their IT guy to investigate why their datacentre has sent them a bill for 5TB of traffic between their front-end server and db server. It turns out that the contractor who wrote all of this chained Linq queries in a dumb way, so instead of just returning the latest playlist entry from the db to compare against, it returns all playlist entries, and then takes the latest one from that. Over 12000 rows in the playlist table. Total table data size is around 96MB. So, it generates around 100MB of traffic from the db every 30 seconds, instead of around 500KB. And that's not all. While going through the code to see what's going on, I come across the following: C# code:
Then, we have this: C# code:
beuges fucked around with this message at 11:04 on Nov 11, 2014 |
# ? Nov 11, 2014 10:19 |
|
Malcolm XML posted:INSTANCE_018 is down? Issue a reboot command and call me in the morning. Agreed. Servers are cattle, not pets.
|
# ? Nov 11, 2014 15:12 |
|
Welcome to my hell.
|
# ? Nov 13, 2014 05:53 |
|
what the gently caress is that? Did someone lose a bet?
|
# ? Nov 13, 2014 07:20 |
|
Looks like a standard vendor supplied driver to me. You are really hosed because of this: RESET_HDMI_PHY(); RESET_HDMI_PHY(); RESET_HDMI_PHY(); i.e. the hardware is just a broken piece of poo poo.
|
# ? Nov 13, 2014 08:24 |
|
I already know that.
|
# ? Nov 13, 2014 09:24 |
|
I had one of these Pivos XIOS DS boxes for a while, I think they were running Amlogic M1? It was not too horrible all in all, but it was never stable. Everytime they merged in some new Amlogic drivers *something* would be broken in some way.
|
# ? Nov 13, 2014 11:56 |
|
Overly complex drivers for hardware not made correctly? Sounds like a embedded Linux project to me! That's not the worst I have seen either. At least it's readable.
|
# ? Nov 13, 2014 15:45 |
|
I name all of my machines after stars. Aldebaran was the first, then I had Deneb, Mizar, Polaris, Fomalhaut... My first dual-core machine was Sirius (a double star), now I have a netbook called Procyon. Well, actually nowadays I'm lazy and I name my systems "thing": my iPhone is iThing, my work computer (MacBook) is ThingBook, etc.omeg posted:I loving hate Windows security API. So many ways to get poo poo wrong. e: I swear I'm answering your PM tonight hackbunny fucked around with this message at 18:08 on Nov 13, 2014 |
# ? Nov 13, 2014 18:04 |
|
i just loving hate all the code this guy writes. loving full ofC code:
C code:
C code:
Everything is a mixture of spaces and tabs. Or no spacing. I once saw like a 100 character line of code full of un-necessary casts and pointer arithmetic without a single space. C code:
Illusive Fuck Man fucked around with this message at 21:43 on Nov 13, 2014 |
# ? Nov 13, 2014 21:34 |
|
I may suck at coding, but I'm glad I suck at coding alone.
|
# ? Nov 13, 2014 21:47 |
|
Illusive gently caress Man posted:i just loving hate all the code this guy writes. loving full of
|
# ? Nov 13, 2014 22:08 |
|
Illusive gently caress Man posted:
I don't get stuff like this. Are people allergic to whitespace or something? You need to let those variables get some air, man. Otherwise the code will get moldy.
|
# ? Nov 13, 2014 22:09 |
|
C code:
|
# ? Nov 13, 2014 22:12 |
|
_aaron posted:I cannot stand poo poo like this. I know it's not even a big deal, it's just irrationally annoying. Ok, I give up. Why are the first two lines bad? Is it because of the inconsistent whitespace? The names? What? It seems like not enough context to convey anything terrible to me, so I am getting really worried about not being able to tell whats wrong.
|
# ? Nov 13, 2014 22:44 |
|
Corla Plankun posted:Ok, I give up. Why are the first two lines bad? Is it because of the inconsistent whitespace? The names? What? The comments are both useless. You can already tell exactly what log.h is for, and i = 0 is overwhelmingly used as a counter. They're both cases where a comment would have been better if the lines were doing anything but what they are doing.
|
# ? Nov 13, 2014 22:46 |
|
A colleague of mine does something similar. He'll first outline the different steps a method has to do in comments, then write the code. Which, in general is fine, except he leaves all the comments in, and never adds any actually useful comments. So all his code looks like this:code:
It's not the worst thing in the world, but it's utterly pointless, and it's everywhere.
|
# ? Nov 13, 2014 23:13 |
|
I'm still going through it, but you guys probably noticed Microsoft open-sourced a bunch of .NET stuff yesterday: https://github.com/dotnet/corefx Haven't found any horrors yet, but mostly I've been trying to find funny comments or something. Not much so far.
|
# ? Nov 13, 2014 23:16 |
|
That's actually something advocated by Steve McConnell in Code Complete. He calls it the Pseudocode Programming Process. In the linked article, Jeff Atwood explains why he doesn't like it. Anyway, I agree that it's a pretty dumb way to write comments, but at least your colleague isn't totally crazy.
|
# ? Nov 13, 2014 23:19 |
|
hackbunny posted:e: I swear I'm answering your PM tonight Don't sweat, I'm in no hurry
|
# ? Nov 13, 2014 23:28 |
|
carry on then posted:You can already tell exactly what log.h is for Maybe it's for taking logarithms
|
# ? Nov 13, 2014 23:34 |
|
There's a line in zlib's adler32.c that reads /* the derivation of this formula is left as an exercise for the reader */. gently caress you, Mark Adler. The job of a comment is not to tell the reader to figure it out himself.
|
# ? Nov 14, 2014 02:30 |
|
Corla Plankun posted:Ok, I give up. Why are the first two lines bad? But that style of commenting quickly becomes a headache when a group of people have to maintain that code. When the code changes, the comments have to be updated to reflect the changes, otherwise they become inaccurate. Or someone has to make the decision to delete the superfluous comments, which is extra work and might offend someone. It's also kind of defeating. The purpose of comments is to call attention to portions of code that are counterintuitive or whose purpose is not obvious. Basically a comment says "pay attention here" to the reader. If everything's commented, things that actually need to be called out are lost in the noise. Also, generally speaking, well written code should be fairly clear and unambiguous in meaning most of the time, so excessive commenting is a sign that someone is not comfortable with their ability to write clear code. Of course, it's a fine thing to do on a toy project if you're just starting to learn a language/platform and it aids in the learning process.
|
# ? Nov 14, 2014 03:11 |
|
Illusive gently caress Man posted:i just loving hate all the code this guy writes. loving full of You sound like you desperately need to institute mandatory code reviews gating your source contrahahaha you just code directly in prod don't you.
|
# ? Nov 14, 2014 03:29 |
|
Kazinsal posted:There's a line in zlib's adler32.c that reads /* the derivation of this formula is left as an exercise for the reader */. But how else will you learn?
|
# ? Nov 14, 2014 03:58 |
|
Volmarias posted:You sound like you desperately need to institute mandatory code reviews gating your source contrahahaha you just code directly in prod don't you. Tbqh there is no 'prod' because this is kind of a proof of concept project. it's a 4 person team and when it works someone just tags the commit 'it works' but the plan is somehow that we will be able to demonstrate and let people use this in a few months? I would love some kind of code review or automated testing but that would be like a whole job for somebody to set up and organize and none of us even know how to set up Jenkins sooo gently caress
|
# ? Nov 14, 2014 04:40 |
|
Kazinsal posted:There's a line in zlib's adler32.c that reads /* the derivation of this formula is left as an exercise for the reader */. Mark Adler is a mathematician, not a programmer.
|
# ? Nov 14, 2014 06:04 |
|
Kazinsal posted:There's a line in zlib's adler32.c that reads /* the derivation of this formula is left as an exercise for the reader */. If I saw that I'd assume it was a tongue-in-cheek way to say "I have no idea how I came up with this poo poo"
|
# ? Nov 14, 2014 06:07 |
|
The canonical unhelpful-yet-accurate comment is of course // what the gently caress?.
|
# ? Nov 14, 2014 07:08 |
vOv posted:The canonical unhelpful-yet-accurate comment is of course // what the gently caress?. Don Mega fucked around with this message at 09:18 on Nov 14, 2014 |
|
# ? Nov 14, 2014 08:56 |
|
Since this is the coding horrors thread, I'm sure most of you know about Duff's device already. But have you seen Stroustrup's device (PDF)? C++ code:
|
# ? Nov 14, 2014 10:19 |
|
|
# ? Jun 3, 2024 22:08 |
|
GrumpyDoctor posted:
Looks like an early-out optimization to avoid a function call to strcmp in the presumably-common case where first chars differ. Usually means "strcmp prolog/epilog showed up in a profile once" (possibly on a previous project, and is carried forward superstitiously). Often an unnecessary optimization, but I wouldn't say it was a horror.
|
# ? Nov 14, 2014 11:41 |