|
They probably have LINUX KERNEL DEVELOPER listed on their resume too. You can confirm it by looking at the commit logs!
|
# ? Nov 19, 2015 22:32 |
|
|
# ? Jun 10, 2024 02:20 |
|
EpicCodeMonkey posted:That guy is gold: http://comments.gmane.org/gmane.linux.drivers.driver-project.devel/75387 That one is actually fine, if not quite complete. The original code looks like this: C code:
C code:
Now, I personally try to reject patches like this as a code reviewer, for several reasons. First, sometimes it's much clearer and more consistent to write something as an else clause, especially when it's at the end of a longer chain of clauses, and there's no particular reason to dispute the original author on that point. Second, it's not uncommon for future changes to need to re-indent that clause anyway, e.g. to turn it into an else if. And third, it's kindof a waste of time to debate this level of code-formatting style, and once you accept one patch like this, you're probably going to see a hundred more. But maybe some project out there appreciates it, I dunno. The larger issue here is that this person is clearly just trying to apply every suggestion made by a tool they don't understand, probably so that they can later claim "contributed many bug fixes to the android project" on their CV.
|
# ? Nov 19, 2015 22:38 |
|
xzzy posted:They probably have LINUX KERNEL DEVELOPER listed on their resume too. You can confirm it by looking at the commit logs!
|
# ? Nov 19, 2015 22:45 |
|
This guy is gonna have the last laugh when a linker decides to place a string literal at 0x00 and you guys all get hosed over!
|
# ? Nov 20, 2015 01:19 |
|
xzzy posted:No, it's stupider than that. He read the output from a linter and took what it said literally. Yet the linter wasn't smart enough to see that he was comparing two literals?
|
# ? Nov 20, 2015 03:00 |
|
pseudorandom name posted:checkpatch said Comparison to NULL could be written "!data" It actually took a minute for this to sink in for me.
|
# ? Nov 20, 2015 03:20 |
|
xzzy posted:Obfuscated code isn't necessarily bad code though, other than being completely unintelligible. You might enjoy this: How To Write Unmaintainable Code quote:To foil the maintenance programmer, you have to understand how he thinks. He has your giant program. He has no time to read it all, much less understand it. He wants to rapidly find the place to make his change, make it and get out and have no unexpected side effects from the change. quote:10. Cd wrttn wtht vwls s mch trsr. When using abbreviations inside variable or method names, break the boredom with several variants for the same word, and even spell it out longhand once in while. This helps defeat those lazy bums who use text search to understand only some aspect of your program. Consider variant spellings as a variant on the ploy, e.g. mixing International colour, with American color and dude-speak kulerz. If you spell out names in full, there is only one possible way to spell each name. These are too easy for the maintenance programmer to remember. Because there are so many different ways to abbreviate a word, with abbreviations, you can have several different variables that all have the same apparent purpose. As an added bonus, the maintenance programmer might not even notice they are separate variables. quote:22. In naming functions, make heavy use of abstract words like it, everything, data, handle, stuff, do, routine, perform and the digits e.g. routineX48, PerformDataFunction, DoIt, HandleStuff and do_args_method. quote:28. If you have an array with 100 elements in it, hard code the literal 100 in as many places in the program as possible. Never use a static final named constant for the 100, or refer to it as myArray.length. To make changing this constant even more difficult, use the literal 50 instead of 100/2, or 99 instead of 100-1. You can futher disguise the 100 by checking for a == 101 instead of a > 100 or a > 99 instead of a >= 100.
|
# ? Nov 20, 2015 03:40 |
|
KernelSlanders posted:Yet the linter wasn't smart enough to see that he was comparing two literals? Why would the linter bother checking for something that the compiler will warn about?
|
# ? Nov 20, 2015 04:54 |
|
The compiler likely doesn't know the value of "!data", given assembler/linker freedom, but it can probably assume it's not NULL on most platforms.
|
# ? Nov 20, 2015 05:24 |
|
You're all assuming he ran the linter again or looked at its output after making his brilliant fix and pasting the original linter message in as justification.
|
# ? Nov 20, 2015 05:43 |
|
Subjunctive posted:The compiler likely doesn't know the value of "!data", given assembler/linker freedom, but it can probably assume it's not NULL on most platforms. It's a bit surprising that neither clang nor gcc emit -Wtautological-compare for this. I guess I should probably file a bug.
|
# ? Nov 20, 2015 08:39 |
|
b0lt posted:It's a bit surprising that neither clang nor gcc emit -Wtautological-compare for this. I guess I should probably file a bug. It can't for anything but against explicit NULL, right? I thought that warning only tripped for > and < for some reason.
|
# ? Nov 20, 2015 08:47 |
|
I thought that comparing a string literal against NULL would have emitted that warning too, but I tried it and was kinda surprised that it didn't.
|
# ? Nov 20, 2015 08:48 |
|
Comparing a string literal against another string literal is also tautological. How does the compiler decide whether showing that warning is useful or not? I'd imagine that quite a lot of macro/template code has tautological comparisons once fully instantiated, with the expectation that those cases will be just be silently dropped where possible.
|
# ? Nov 20, 2015 08:55 |
|
There are already those sort of warnings for that sort of thing for things like integer comparisons (comparing unsigned >= 0), and I don't like them, especially when I want to write robust code that doesn't depend on whether the type is signed or unsigned to do an assertion.
|
# ? Nov 20, 2015 09:38 |
|
So I recently ran into a bug in an open source project I work on. A config setting message was printing out blank so I was looking through the code to debug it. For the most part I wasn't _super_ familiar with this portion of the code base so I've left most of it alone. The gist of the code was this: JavaScript code:
Nothing that slowed down the code, just the original author being very liberal with their use of the 'array contains' functions, extra loops, and unless statements. Also setting can only be low/med/high so not sure why they checked against med/high.
|
# ? Nov 20, 2015 10:52 |
|
Strong Sauce posted:So I recently ran into a bug in an open source project I work on. A config setting message was printing out blank so I was looking through the code to debug it. For the most part I wasn't _super_ familiar with this portion of the code base so I've left most of it alone. /(.*)=(.*)/ is the face you were supposed to make when you saw the code
|
# ? Nov 20, 2015 13:36 |
|
Strong Sauce posted:Also setting can only be low/med/high so not sure why they checked against med/high. If I'm not mistaken it changes low to high only - so if the config[x].setting isn't medium/high it changes it It also changes it if the setting is disabled...
|
# ? Nov 20, 2015 13:54 |
|
Okay so is it just me or are sites like these (I forget their official name. mailing lists? newsgroups?) mostly unreadable (without heavy annoyance) to anyone else? https://lkml.org/lkml/2015/11/19/454 http://comments.gmane.org/gmane.linux.drivers.driver-project.devel/75387 I have to scour the page for where the thread view might possibly be and even then it usually gives a weird navigation list that you have to try and work out who replied to what. And every single one of them uses their own horrible layout.
|
# ? Nov 20, 2015 15:08 |
|
The lkml interface has always seemed pretty clear, if not really attractive. Indentation in the list on the left shows reply relationships. They all have terrible search though.
|
# ? Nov 20, 2015 15:12 |
|
Gmane has been poo poo for browsing mailing list archives since day one. It looks exactly the same now as it did 15 years ago and it's never looked good.
|
# ? Nov 20, 2015 15:13 |
|
Jewel posted:Okay so is it just me or are sites like these (I forget their official name. mailing lists? newsgroups?) mostly unreadable (without heavy annoyance) to anyone else? it's not just you, those mailing list sites are all always super badly presented considering all they're really doing is showing threaded discussions.
|
# ? Nov 20, 2015 15:43 |
|
Jewel posted:Okay so is it just me or are sites like these (I forget their official name. mailing lists? newsgroups?) mostly unreadable (without heavy annoyance) to anyone else? The various web archive interfaces are awful, but nobody seriously uses them.
|
# ? Nov 20, 2015 17:19 |
|
ExcessBLarg! posted:The various web archive interfaces are awful, but nobody seriously uses them. Problem being Google still spiders them and they pop up pretty high in search results and make you think you've found good discussion on a problem you're having.. and aww gently caress it's a gmane link.
|
# ? Nov 20, 2015 17:25 |
|
Yeah, it would be helpful for Google to recognize it's a mailing list post and provide an alternate link to the Google Groups message. If you actually like Groups, that is.
|
# ? Nov 20, 2015 17:35 |
|
http://imgur.com/a/ARGjH
|
# ? Nov 21, 2015 19:18 |
|
really mad at the placement of the braces there Edit: Holy poo poo. The member declarations. Shoot me, now.
|
# ? Nov 21, 2015 20:28 |
|
I had a wild encounter in the F# subreddit and now I think I understand better the story about Babbage and the MPs.a crazy man posted:Hi all, a sane man posted:Because .NET strings implement seq<char> (AKA IEnumerable<char>), you could just iterate through the sequence, yield those chars you want to keep and yield your replacement when the forth index (3) is hit. a crazy man posted:Thanks. However, I want to devise a solution that doesn't make use of anything rather than the simplest functional language constructs (lists, chars, comparison operators, ... and so on). me posted:I'm confused. You want to access the individual chars of your string, but doing that necessarily requires knowing how the string is made out of characters. a crazy man posted:
I'm taking suggestions as to how I can possibly respond to that.
|
# ? Nov 21, 2015 21:14 |
|
NihilCredo posted:I had a wild encounter in the F# subreddit and now I think I understand better the story about Babbage and the MPs. This story is unfamiliar to me.
|
# ? Nov 21, 2015 21:18 |
|
Bongo Bill posted:This story is unfamiliar to me. Charles Babbage posted:"On two occasions I have been asked [by members of Parliament!], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."
|
# ? Nov 21, 2015 21:23 |
|
NihilCredo posted:I'm taking suggestions as to how I can possibly respond to that. "Good luck!" and then ignore the thread.
|
# ? Nov 22, 2015 03:30 |
|
Volmarias posted:"Good luck!" and then ignore the thread. But then there is always this feeling in the back of one's mind, just grating under the surface trying to make sure things are made right...
|
# ? Nov 22, 2015 04:17 |
|
YeOldeButchere posted:But then there is always this feeling in the back of one's mind, just grating under the surface trying to make sure things are made right... We're rapidly approaching a thousand pages of coding horrors, in just this one thread out of many, and you still believe thing are ever going to be made right ...?
|
# ? Nov 22, 2015 04:22 |
|
Holy crap. https://www.quora.com/What-is-a-coders-worst-nightmare/answer/Mick-Stute?srid=RBKZ&share=1 This is worth reading.
|
# ? Nov 22, 2015 13:05 |
|
Carbon dioxide posted:Holy crap. Ah yeah, the good ol' Ku Klux Komputer Klub always pullin' pranks.
|
# ? Nov 22, 2015 13:18 |
|
Carbon dioxide posted:Holy crap. Sounds suspiciously like Ken Thompson's scenario (Reflections on Trusting Trust). Does anybody know where or when this supposedly happened?
|
# ? Nov 22, 2015 13:22 |
|
Zopotantor posted:Sounds suspiciously like Ken Thompson's scenario (Reflections on Trusting Trust). Does anybody know where or when this supposedly happened? Combined with the interfering computer subplot from Stephenson's "The Big U".
|
# ? Nov 22, 2015 13:28 |
|
Zopotantor posted:Sounds suspiciously like Ken Thompson's scenario (Reflections on Trusting Trust). Does anybody know where or when this supposedly happened? I am fairly sure I also saw this on TheDailyWTF, and it feels rather apocryphal.
|
# ? Nov 22, 2015 14:48 |
|
Zopotantor posted:Sounds suspiciously like Ken Thompson's scenario (Reflections on Trusting Trust). Does anybody know where or when this supposedly happened?
|
# ? Nov 22, 2015 17:13 |
|
|
# ? Jun 10, 2024 02:20 |
|
Volte posted:Given root access to a machine it's a pretty well-known way to poison it. On the other hand, why did some random grad student have root access to the university machines in the first place? Exactly one person has sysadmin access to the CS department computers at my university: the department sysadmin. The 80s were a different time, and it's possible to imagine that the student had talked his way into getting root on just that one machine.
|
# ? Nov 22, 2015 17:35 |