Slashdot Mirror


User: AaronW

AaronW's activity in the archive.

Stories
0
Comments
2,028
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 2,028

  1. Re:What's Unique To Goto? on Empirical Study On How C Devs Use Goto In Practice Says "Not Harmful" · · Score: 2

    I was forced to take the introduction to programming class in college because the Turbo Pascal program I had used a goto for this very reason. In Pascal there was no break/continue equivalent and it would have been extremely messy in the code to not use the goto.

    It later turned out that the professor did not know Pascal at all when there were simple errors in a 2 page program that she couldn't get to compile. I only showed up for the midterms and final for that useless class. The next one was worse since the professor disallowed using repeat/until, requiring recursion for everything claiming that it was just as fast since the compiler would take care of it (it wasn't, it was MUCH slower). Recursion does have it's place. Unfortunately most of the examples I see for it are places where it shouldn't be used.

  2. Re:GOTO is a crutch for bad programmers on Empirical Study On How C Devs Use Goto In Practice Says "Not Harmful" · · Score: 1

    And that non-standard indentation will cause nothing but trouble, especially in a large project. The lack of proper indentation makes the code harder to read than just using a goto, especially if someone works on it in a modern editor that does things like handling indentation for you.

  3. Re: GOTO is a crutch for bad programmers on Empirical Study On How C Devs Use Goto In Practice Says "Not Harmful" · · Score: 1

    Try using C++ in the Linux kernel or in a bootloader, the type of stuff I work on. Everything is C for a reason. That isn't to say that C++ can't be used at the kernel level since I worked on a large C++ OS/2 driver (around 100KLOC) years ago, but it took a lot of work to make C++ work in that case and it was extremely compiler dependent (I think it only worked with Watcom 10.0b, not rev c or any other version).

  4. Re:GOTO is a crutch for bad programmers on Empirical Study On How C Devs Use Goto In Practice Says "Not Harmful" · · Score: 1

    Try 80 columns using the Linux kernel coding convention using 8-character tabs for indentation. The code grows unreadable quite fast.

  5. It also adds another useless level of indentation which can be a problem making the code difficult to read, especially in projects which follow the Linux kernel coding convention.

  6. A goto certainly makes cleanup code a lot easier, especially in my line of work on bootloaders, device drivers and other stuff. There are many cases where it is far cleaner to use a goto error_handler; in the code, especially if there are multiple locations and have all of the cleanup code in one place rather than duplicating it all over the place.

    There are other times when a goto can also make sense, for example if you have multiple nested levels of logic you want to get out of it in a hurry. It takes an experienced programmer to know when to use it and when not to. I have seen many cases where a single goto or using goto for error handling makes the flow of the code much easier to read and where it can significantly reduce the size of the code. That's not to say that it can't be abused either. I have also seen cases where it makes the code more difficult to read but in most cases where I come across it it simplifies the logic flow and helps keep the code from being cluttered.

  7. Indenting the flow can get bad if it starts to get rather deep. In my case, the code bases I work on use 8-character tabs for indenting and also limit the code to 80 columns. It quickly grows difficult to read and maintain if you have to keep indenting when a simple goto error_handler is far easier to deal with and I have found less error prone and easier to read. The flow remains easy to read since the error handler is always at the end of the function.

  8. And that gets rather ugly if you have things inside loops and more complicated logic. It becomes far cleaner to just say:
    goto error_handler;

    break doesn't work so well when you have multiple levels of loops or other complex logic.

  9. There is a time and place to use goto. It works well for handling error cases and can lead to better code.

    Instead of:

    rc = some_function()
    if (rc) {
      do lots of cleanup of earlier stuff()
      return rc;
    }

    rc = some_other_function()
    if (rc) {
      do even more cleanup()
      return rc;
    }

    I can just use:

    rc = some_function();
    if (rc)
        goto error_handler; ...
    error_handler:
      perform any needed cleanup
      return rc;
    }

    The other method would be a huge nested mess of if/else conditions.

  10. Re:Another silly decision on The Mathematical Case For Buying a Powerball Ticket · · Score: 2

    At least in the Bay Area the housing prices have recovered and are higher than ever. California recovered faster than most of the country. Even during the crash my house was still worth quite a bit more than I paid for it back in 1997.

  11. Re:Oh HELL no ... on Automakers Move Toward OTA Software Upgrades · · Score: 1

    All you need to do is disable the remote connectivity. It's trivial to do in the configuration.

  12. Re:I think we need some serious open source effort on Automakers Move Toward OTA Software Upgrades · · Score: 2

    That reminds me of BMW. You have to take the car in to the dealership if you change the battery. The new BMW I8 makes it almost impossible to work on. You need two people to open the hood and you have to know exactly what you're doing so you don't damage it.

  13. Re:Time to hack on Automakers Move Toward OTA Software Upgrades · · Score: 1

    My Tesla runs Linux, does that count?

    In the early software releases if I rebooted the main display the X logo was prominently displayed. The GUI is built using Qt. It's not open, however, since no one has figured out how to gain access to the OS (though Tesla can do that over the VPN connection the car maintains).

  14. Re:What could go wrong? on Automakers Move Toward OTA Software Upgrades · · Score: 1

    Out of curiosity I put a packet sniffer on the traffic from my Tesla. All traffic is sent over OpenVPN so it is fairly secure. NMAP reports no open ports.

  15. Re:Hmm... I thought it was *my* vehicle. on Automakers Move Toward OTA Software Upgrades · · Score: 1

    I don't think they can install an update without asking. For one thing the car cannot be driven while the update is taking place. Updates can take upwards of 45 minutes and includes updating many systems. During the update system lights will sometimes flash and various clicks and other noises are heard as subsystems are updated. It displays a message when the car is started indicating that there's an update and defaulting to installing it at 2am if you select that. Otherwise you can choose not to install it or install it at some other time. If you choose not to install it now a small icon is visible indicating that it is available.

    Usually the updates add bug fixes or new features though there are also cases where new bugs are introduced.

  16. Re:Hmm... I thought it was *my* vehicle. on Automakers Move Toward OTA Software Upgrades · · Score: 3, Informative

    All of the OTA updates to my Tesla ask me if and when to install the updates. Usually it's a no brainer.

  17. Re:Yes meanwhile.. on Google Quietly Unveils Android 5.1 Lollipop · · Score: 1

    I did that numerous times and while it helped a little it certainly did not fix the problem. I even tried a factory reset and reinstall and that didn't solve the problem.

  18. Re:Yes meanwhile.. on Google Quietly Unveils Android 5.1 Lollipop · · Score: 1

    My Nexus 7 2012 has been unusably slow since upgrading to 5.0 and 5.0.2 isn't much better. The web browser is useless. Granted, I have a lot of apps loaded, but it was far better with Kit Kat compared to Lollipop. It looks like the biggest culprit is Google Mail since I have several accounts with a LOT of email.

  19. Re:But We Need More H1-Bs! on Massive Layoff Underway At IBM · · Score: 0, Troll

    Amen to that. I've interviewed far too many people that I don't consider qualified. It's to the point where if I see certain large companies in their resumes it's a red flag. Finding GOOD tech workers is hard.

  20. Re: No shit on Wi-Fi Issues Continue For OS X Users Despite Updates · · Score: 1

    Sort of. Nagle's algorithm deals with the data, not the ACKs. Basically what is needed is Nagle's algorithm applied to TCP ACK packets which is what Apple is doing.

  21. Re:Not a laywer. on If a Financial Institution Mishandles My Data, What Recourse Do I Have? · · Score: 1

    You forgot, all the congress critters are in the pocket of the big banks. Most of the congress critters have been doing whatever they can to water down any oversight so banks and big businesses can fuck over consumers even more.

  22. Re:No shit on Wi-Fi Issues Continue For OS X Users Despite Updates · · Score: 1

    I tried dealing with the Broadcom driver on my laptop and had to give up in disgust trying to get it to compile. I upgraded OpenSUSE which included a pre-compiled driver which seems to work for the most part. Broadcom historically has not been very open source friendly. At least one of the Broadcom 10G PHY drivers in the Linux kernel was written by my employer, now a competitor to Broadcom. (see drivers/net/phy/bcm87xx.c for example).

  23. Re:No shit on Wi-Fi Issues Continue For OS X Users Despite Updates · · Score: 3, Interesting

    Several years ago I worked at Atheros working on improving their Linux driver performance for wireless access points. One of my tasks was to figure out why OS X was quite a bit faster than Linux and Windows. I tracked it down to the way OSX sends TCP ACK packets. Both Linux and Windows send a TCP ACK after every other packet whereas OS X would start to space the ACKs out if the connection was reliable. This had a significant impact with 802.11N where there is a lot of packet aggregation. I discovered that OS X would start spacing the ACKs out to every 16-32 TCP packets instead of every other packet. I wish Linux would do something similar.

    I can't comment on any other drivers or current OS X since this was a bit over four years ago.

    I can think of a couple of things that would improve Linux for wireless. First of all, spacing out the ACKs like OS X would help. Second of all, supporting transmitting a group of packets at a time, especially to a particular destination, would help a lot. This is due to the way 802.11N aggregates a lot of packets together into a single wireless packet based on the next wireless hop destination. It's much more efficient for cache utilization and for the code paths when groups of packets are handled rather than individual packets since there is a lot of queueing and dequeeuing going on inside the driver.

  24. Re:Good example of bad use of touch screens on Inside Ford's New Silicon Valley Lab · · Score: 1

    Tesla also has steering wheel controls which are highly configurable which can control the radio and climate control. There is also voice input.

  25. Re:Bay Area on Senator Who Calls STEM Shortage a Hoax Appointed To Head Immigration · · Score: 3, Informative

    The company I work for has fairly good diversity. The company is a chip company with a number of software teams for things like compilers, SDKs, drivers, the Linux kernel, bootloaders, etc. While it isn't 50:50 there are a lot of women developers and while the majority are indian there are a fair number of caucasian and other minorities as well. We hire what we can get. We have positions that have been open for months and the majority of those that we interview are of indian descent. We have a hard time finding good engineers, the key word being good. I have interviewed a lot of engineers of all nationalities who I do not consider competent. The competent ones usually have multiple offers.

    The problem with the H1Bs are that they are abused by companies like Infosys and for less skilled engineers and IT people. Some companies also seem to have an inordinate number of H1Bs like Cisco. I'm of the firm belief that we need more good engineers and that we need a lot more people graduating from college with degrees in science and engineering.