News for hackers. Stuff that matters.
Re:What we learned from rewriting our robotic control softwa... by svec on Tuesday November 03, 2015 @12:36PM (#10501102)
This quote is the big takeaway for me:

"We use Macs to drive these robots, with control software that was written in Objective-C. We made the decision to rewrite this software in Swift late last year, but only after a careful survey of the bugs that had impacted our customers over the years. That survey revealed that most of these shipped bugs would have been prevented or detected early in Swift-based code."

Apparently they were able to categorize their shipped bugs and prevent those types of bugs from happening again with Swift. That's a very professional process.

Re:What we learned from rewriting our robotic control softwa... by ska on Tuesday November 03, 2015 @02:37PM (#10501964)

   That's a very professional process.
Sad, but true. Not about the Swift part (I have no opinion there) but about the analysis and review of shipped bugs.

It should really be "that's an industry standard practice", but a huge amount of software development seems to be done in ways that don't have any systematic way to attempt to learn from mistakes.

Re:What we learned from rewriting our robotic control softwa... by sanderjd on Tuesday November 03, 2015 @06:53PM (#10503610)
This is probably a heretical opinion, but here goes anyway: while it's definitely great to take the time to do a full analysis of common classes of bugs, I don't think it is necessary to do so in order to have a good sense for what common issues a language like Swift solves. I don't need to evaluate my log of bugs to know that I have been bitten tons of times by having a null object or pointer at runtime when a compiler could have made sure I was checking. Languages like Swift and Rust (and Haskell and Ocaml and others) have protections for this and other no-brainer bug classes that I really don't think you need a big bug log analysis to see the advantage of.
Re:What we learned from rewriting our robotic control softwa... by adriand on Tuesday November 03, 2015 @07:39PM (#10503803)
> I don't think it is necessary to do so in order to have a good sense for what common issues a language like Swift solves.

That's true but when you're running a business this type of analysis makes a lot of sense. As experienced software developers we're probably all pretty wary of the "big rewrite", knowing full well that this often doesn't end up saving time in the long run but rather eats up a ton of time without delivering any new features or functionality. This analysis likely helped make the case that going forward they could expect substantial time savings, not to mention happier customers.

In any case, great article overall, very interesting.

Re:What we learned from rewriting our robotic control softwa... by AnimalMuppet on Tuesday November 03, 2015 @06:57PM (#10503626)
Sure, you can see what Swift solves, based on the experience of not writing in Swift. That doesn't tell you what new kinds of bugs Swift enables, though. It's going to take years of using it to find out. You can somewhat speed that up by doing a full analysis of the bugs you get using the new language.
Re:What we learned from rewriting our robotic control softwa... by moonchrome on Tuesday November 03, 2015 @10:08PM (#10504334)
>Sure, you can see what Swift solves, based on the experience of not writing in Swift.

That's actually not true. You can see the trivial stuff it solves from the promo materials - you don't know the full extent of what's realistically possible to encode in the type system.

I had this thought yesterday writing C++ code - I was doing some re factoring and I copy pasted the same identifier twice instead of writing data to two separate buffers. The case where this mattered was not covered by unit testing because it's an edge case in a tightly coupled part - it's a major chore to test that kind of code for little gain.

My first instinct was "just put unit test there and forget about it" but on the other hand while buffer API is the same two buffers are semantically different so I could have made them two distinct types (eg. with template argument tag) and required untyped input buffer to be wrapped in a type explicitly stating data use case - this would have made the bug obvious and compiler would catch any discrepancy.

My point is there are plenty of non-obvious ways to prevent bugs trough a strong type system.

Re:What we learned from rewriting our robotic control softwa... by tl on Tuesday November 03, 2015 @09:17PM (#10504151)
Well, you can start with all of the things that Objective C has that Swift does not that are likely to cause bugs.

For example, static analysis returns nothing where it did something before. Not calling super.viewWillAppear() in a subclass does not raise the appropriate warning in Swift.

Re:What we learned from rewriting our robotic control softwa... by noir_lord on Tuesday November 03, 2015 @02:56PM (#10502114)
Always liked

> Weinberg's Second Law: If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization

It succinctly describes the "process" everywhere I've ever worked.

Re:What we learned from rewriting our robotic control softwa... by ska on Tuesday November 03, 2015 @03:07PM (#10502198)
I've always sort of disliked that one, because there are very good reasons that it is difficult for programmers to write programs the way builders/engineers build physical infrastructure.

However, there are not any good reasons to avoid improving your process and output iteratively via feedback.

Re:What we learned from rewriting our robotic control softwa... by noir_lord on Tuesday November 03, 2015 @03:22PM (#10502332)
I always took it as the general way we throw piles of stuff on top of other stuff until eventually it's so unstable a woodpecker would knock it all over rather than as an accurate indictment of software practices which are of course different to building, software is part science, part art and part prayer.
Re:What we learned from rewriting our robotic control softwa... by organsnyder on Tuesday November 03, 2015 @03:46PM (#10502504)
> software is part science, part art and part prayer

I've never heard that phrase before—is it yours? I really like it.

Re:What we learned from rewriting our robotic control softwa... by noir_lord on Tuesday November 03, 2015 @05:01PM (#10503058)
As far as I know, I've not read it anywhere :).

Google thinks its original to me so I've not accidentally stolen it unknowingly.

Re:What we learned from rewriting our robotic control softwa... by tossandturn on Tuesday November 03, 2015 @05:32PM (#10503209)
It's all yours, my friend.
Re:What we learned from rewriting our robotic control softwa... by wcummings on Tuesday November 03, 2015 @04:39PM (#10502900)
>there are very good reasons that it is difficult for programmers to write programs the way builders/engineers build physical infrastructure

Mostly we just haven't been doing it as long.

Re:What we learned from rewriting our robotic control softwa... by gregmac on Tuesday November 03, 2015 @06:23PM (#10503470)
>> write programs the way builders/engineers build physical infrastructure

> Mostly we just haven't been doing it as long.

This is a popular analogy (among non-programmers) but I have more recently been countering it like this:

It's generally predictable how long it will take to build a house, because many have been built, and they're all more or less the same. Sure they have different layouts, number of windows, etc, but essentially it's the same materials, same tools, and same methods.

Most programs written are not similar in the same way two houses are similar. They are more comparable to the way a house is different from an airport terminal, or a water treatment plant is different from a golf course.

Once you've built many different types of programs, you get a bit better at estimating, but each new type of program poses brand new challenges. A builder used to building small houses from wood is going to be pretty bad at estimating how long it will take to build a missile silo from concrete, and even after building both, will still not be able to come up with a very good estimate for the time to build a railway line between two cities.

Also keep in mind that typically, programmers don't build the same (or even similar) program more than once: unlike builders, we have copy+paste.

Re:What we learned from rewriting our robotic control softwa... by pathelectronica on Tuesday November 03, 2015 @04:49PM (#10502964)
builders/engineers are not as perfect as some people seem to think.
Re:What we learned from rewriting our robotic control softwa... by detaro on Tuesday November 03, 2015 @03:47PM (#10502509)
Or inverted: There are very good reasons why it is difficult for builders/architects to build physical things the way developers write programs.
Re:What we learned from rewriting our robotic control softwa... by ska on Tuesday November 03, 2015 @03:51PM (#10502546)
Yes that is equally true, but with different implications.
Re:What we learned from rewriting our robotic control softwa... by svec on Wednesday November 04, 2015 @07:37AM (#10506052)
Yes, definitely! I should have said:

That's a very professional process, and it should also be an inspirational process.

Just because a lot of software development is haphazard doesn't mean that it has to be! Who cares if you use Swift or Ruby or C or Lisp, ignore the details - we should see the good, mature, "grown-up" things that other people do and copy & modify them!

Jack Ganssle (an embedded systems guru) has a great interview about being "a grown-up engineer" here: http://embedded.fm/episodes/2014/5/27/53-being-a-grownup-eng...

It applies to all software and hardware systems, not just embedded systems.

Re:What we learned from rewriting our robotic control softwa... by stefantalpalaru on Tuesday November 03, 2015 @05:03PM (#10503061)
> That's a very professional process.

There's nothing professional about choosing the wrong platform for your application and then jumping into a new proprietary language in the hope of fixing things with a rewrite.

Re:What we learned from rewriting our robotic control softwa... by drauh on Tuesday November 03, 2015 @05:38PM (#10503240)
Have you looked at the medical devices in a hospital, recently?
Re:What we learned from rewriting our robotic control softwa... by Alupis on Tuesday November 03, 2015 @06:54PM (#10503616)
> Have you looked at the medical devices in a hospital, recently?

Are you trying to imply they are Apple devices and/or becoming Apple devices? Because that's entirely opposite of what's going on at the several local hospitals (admittedly all under the same organization) near me.

Re:What we learned from rewriting our robotic control softwa... by colincsl on Tuesday November 03, 2015 @10:36PM (#10504435)
They are implying that medical devices are notoriously bad at being proprietary/closed. Hospitals would be much better off if the devices could talk to each other but it isn't feasible as-is because device manufacturers want lock-in. The current situation leads to issues like alarm fatigue where nurses effectively ignore problems due to too many devices. If they were centralized then there could be one management system that intelligently alerts the nurse of any issues.

We have a major effort at Hopkins going on right now to get around this. See this article more info: http://hub.jhu.edu/2015/10/19/hopkins-microsoft-patient-safe...

Re:What we learned from rewriting our robotic control softwa... by alwillis on Wednesday November 04, 2015 @12:27AM (#10504777)
Let's not forget that Apple announced back in June that Swift would be open sourced by the end of 2015; it might end up being a holiday present for developers.
Re:What we learned from rewriting our robotic control softwa... by s73v3r on Tuesday November 03, 2015 @08:04PM (#10503887)
There's also nothing professional about irrational hatred of a platform, or having the need to complain about another's choice of platform.
Re:What we learned from rewriting our robotic control softwa... by stefantalpalaru on Tuesday November 03, 2015 @08:48PM (#10504054)
What's irrational about disliking an environment hostile to developers? When you you do robotics, you want full control over the software, so the natural fit is some Linux variant, not OS X or iOS.
Re:What we learned from rewriting our robotic control softwa... by pjmlp on Wednesday November 04, 2015 @12:44AM (#10504824)
Hostile to FOSS developers you mean.

Many of us don't have any issues with comercial vendors.

Re:What we learned from rewriting our robotic control softwa... by stefantalpalaru on Wednesday November 04, 2015 @09:50AM (#10506916)
Many of you have no issues with the lack of quality in your work.
Re:What we learned from rewriting our robotic control softwa... by pjmlp on Wednesday November 04, 2015 @12:34PM (#10508130)
Actually, I am the opinion all types of software should suffer the same legal penalties and quality control that other industries have in place.
Re:What we learned from rewriting our robotic control softwa... by s73v3r on Wednesday November 04, 2015 @12:38PM (#10508169)
I could say that far more about FOSS developers. Many of them operate under the idea that they bear no responsibility for the software they write, and as such, have no impetus toward quality.
Re:What we learned from rewriting our robotic control softwa... by s73v3r on Wednesday November 04, 2015 @12:37PM (#10508157)
Yeah, no. I've never bought the "hostile to developers" argument. Try again.

"When you you do robotics, you want full control over the software"

And OS X gives me this.

Re:What we learned from rewriting our robotic control softwa... by stefantalpalaru on Wednesday November 04, 2015 @04:57PM (#10510089)
Maybe you don't realize that "software" includes the kernel. Is it even possible to do a real-time fork of it like people did with RTLinux, RTAI and Xenomai?

Of course it's not, because OS X gives you shit and you invested so much in it already that you have to convince yourself that it tastes good.