News for hackers. Stuff that matters.

dcvuob

Re:GCC 6: -Wmisleading-indentation vs. “goto fail;” on Friday February 26, 2016 @03:22PM (#11183926)
It would be really nice if instead of downvoting, someone could provide a counterargument, or comment on parts the disagree.
Re:GCC 6: -Wmisleading-indentation vs. “goto fail;” on Friday February 26, 2016 @02:06PM (#11183299)
I was giving an replacement for the if statement presented above, where both expressions are on the same line.
Re:GCC 6: -Wmisleading-indentation vs. “goto fail;” on Friday February 26, 2016 @12:51PM (#11182795)
Yes. And cast that 0 to (void), so the compiler won't complain over an unused expression.

Any C programmer will recognize what (void)0 means, do nothing.

Re:GCC 6: -Wmisleading-indentation vs. “goto fail;” on Friday February 26, 2016 @12:28PM (#11182641)
The more lines that are visible on your screen, the less you have to keep in your working memory.

Sure if you only saw a few lines at a time, then this might be a problem. But you can see 51 on a laptop. This is enough for almost all cases. And you can scroll if you need to look up something. If you stumble upon a case of multiple if statement that span several screens then no style is going to help you see it in full. In that rare case you might see a little more, at the expense of all code ever becoming less readable (if we assume Allman is more readable for the sake of this argument of course).

If for some reason your code has more than, let's say >50% cases where something spans multiple screens and needs to be seen as a whole (code which should be refactored, but let's ignore that), then you might have an argument to use your style, in all other cases you're doing premature optimization of your coding style, so to speak.

Re:GCC 6: -Wmisleading-indentation vs. “goto fail;” on Friday February 26, 2016 @11:47AM (#11182359)
Second example is very readable using Allman style:

    if( condition_a )
    {
         if( condition_b )
         {
             do_thing_a();
         } 
         else 
         {
             do_thing_b();
         }
    } 
    else 
    {
         do_something_else();
    }
Editor space is free, why not use it.
Re:GCC 6: -Wmisleading-indentation vs. “goto fail;” on Friday February 26, 2016 @11:35AM (#11182294)
Those if statement should be written using the ternary operator. In my subjective opinion, putting the expression in the same line as the if statement is awful. Objectively it is worse because you create a possibility of certain types of errors, like a hanging statement or similar. Ternary operator doesn't have those.

The second example is missing error checking. So the real code isn't that nice.

My point is that C shouldn't look like Python. Small amount of functionality should be written unambiguously and take a lot of space if necessary. Because of the nature of C, it needs a lot boilerplate, and will take a lot of screen space anyway, but that is not a problem, as we are not coding on paper.

Re:Microsoft, Google, Facebook Back Apple in Blocked Phone Case on Thursday February 25, 2016 @07:53PM (#11179138)
Terrorists cannot be innocent. /s
Re:Microsoft, Google, Facebook Back Apple in Blocked Phone Case on Thursday February 25, 2016 @05:42PM (#11178427)
If only Twitter joined them.
Re:Google launches voice typing in Google Docs on Thursday February 25, 2016 @03:45PM (#11177648)
I think it is an issue of convenience. Anecdotal evidence, I have never had trouble doing either of those for 8 hours straight (and more).

Voice will need some serious software support if it is going to take off. There is zero chance that users will learn those mnemonics, just as now almost nobody knows how to touch type. The usage will be more in the form of general commands, than specifying every action like we do it now with the keyboard+mouse.

Re:Google launches voice typing in Google Docs on Thursday February 25, 2016 @03:52AM (#11173185)
Welcome to the future (of 2013): https://youtu.be/8SkdfdXWYaI?t=9m5s https://youtu.be/8SkdfdXWYaI?t=16m22s

Don't forget to see the entire talk (28 minutes): https://www.youtube.com/watch?v=8SkdfdXWYaI

Re:The E-Cat has been replicated? on Thursday February 25, 2016 @03:21AM (#11173088)
The pdf is discussing vehicles, specifically aircraft, that would utilize LENR assuming it works.

Here is an excerpt from the pdf: This report does not explore the feasibility of LENR. Instead, it assumes that a working system is available.

Your statement: there are folks at NASA and SPAWAR that think LENR (not fusion per se) is real., is incorrect, they assume it works for the purposes of the discussion about aircraft.

You are either scamming or are being scammed. In the latter case (and I'm trying to help you here), please make an effort with some serious research and re-evalaute your opinions.

Re:Justice Department Wants Apple to Unlock Nine More iPhones on Wednesday February 24, 2016 @09:29AM (#11166922)
That is an disingenuous representation of how the attacks works. That attacks OPSEC, not the Bitlocker itself. Any full-disk encryption is "vulnerable", to this kind of attack.

The page even explains this:

https://github.com/carmaa/inception#awesome-but-why

https://github.com/carmaa/inception#unlock