Sponsored Content

Bio

Dean Wampler specializes in Scala and “big data” analytics using the Hadoop ecosystem of tools. He is a Principal Consultant at Think Big Analytics (http://thinkbiganalytics.com) and the co-author of Programming Scala and author of Functional Programming for Java Developers, both from O’Reilly Media. Dean has a Ph.D. in Physics, but he’s mostly recovered.

Strange Loop is a multi-disciplinary conference that aims to bring together the developers and thinkers building tomorrow's technology in fields such as emerging languages, alternative databases, concurrency, distributed systems, mobile development, and the web.

If you're interested in other upcoming videos from Strange Loop, the full release schedule is here and all slides are here. If you want to be notified about Strange Loop announcements in the future, sign up for the mailing list.

The principle that I use, which I think holds for all these examples, is: a software solution lies in the middle between the problem domain (user stories, requirements, etc) and the solution domain (database, functional, OO, ORM, REST, CORBA, etc). The closer to the problem domain, the better solution it is albeit less efficient (in general) and vice versa.

It's easy to see how this applies to the goto statement.

In regard to the object middleware and the idea of functional 'wrappers', I think that's a completely wrong idea. I don't think the purpose of functional programming is to remove the need for object middleware (or object models) but the idea is to replace object models with a functional models that claim to have better composability, reusablity and closer representation of the problem domain but definitely not in order to gain efficiency. For efficiency you just need to be closer to the solution domain, or in other words, closer to the machine and not use functional nor object programming but C or assembly.

It seemed that a lot of the advice was based on edge cases. Yes, there are edge cases where a goto makes sense, 99.5% of the time it makes code harder to read and can introduce subtle bugs (e.g. jumping over cleanup code). Yes, writing raw SQL can make your app faster. But raw SQL is harder to understand then a well defined method name. If you need to raw SQL in spots to get the speed that you need then use the ORMs ability to drop down to the native level in that one section.

And remember that these "premature optimization" are going to be maintained by the new intern and you don't want him thinking that a goto would be perfect to fix that stack overflow.

InfoQ Weekly Newsletter

Join a community of over 250 K senior developers by signing up for our newsletter. If you are based in the EEA, please contact us so we can provide you with the protections afforded to you under EEA protection laws.

Is your profile up-to-date? Please take a moment to review and update.

Email Address

Note: If updating/changing your email, a validation request will be sent

Company name:

Keep current company name

Update Company name to:

Company role:

Keep current company role

Update company role to:

Company size:

Keep current company Size

Update company size to:

Country/Zone:

Keep current country/zone

Update country/zone to:

State/Province/Region:

Keep current state/province/region

Update state/province/region to:

Subscribe to our newsletter?

Subscribe to our architect newsletter?

Subscribe to our industry email notices?

You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.

We notice you're using an ad blocker

We understand why you use ad blockers. However to keep InfoQ free we need your support. InfoQ will not provide your data to third parties without individual opt-in consent. We only work with advertisers relevant to our readers. Please consider whitelisting us.