Slashdot Mirror


Your Java Code Is Mostly Fluff, New Research Finds

itwbennett writes In a new paper (PDF), researchers from the University of California, Davis, Southeast University in China, and University College London theorized that, just as with natural languages, some — and probably, most — written code isn't necessary to convey the point of what it does. The code and data used in the study are available for download from Bitbucket. But here's the bottom line: Only about 5% of written Java code captures the core functionality.

411 comments

  1. Makes sense to me by Anonymous Coward · · Score: 5, Insightful

    I'll admit I just read the summary article and not the paper itself, but I wouldn't say that this is overly surprising.

    Right off the bat due to this preoccupation we Java types seem to have with accessor methods (which I think if we admit, do something besides just set or get a private member variable like 1% of the time, why the hell we still do this I don't know..), and the frequent necessity for hash, clone, and equals methods, most of which is auto-generated, you end up with a bunch of small methods that do very little but up the code count.

    Beyond that, I think good design usually works out this way. You (or at least I like to) build up in layers, each layer using the previous layer at a higher level, until you get to the top where you have a few seemingly simple bits of code that pull it all together. When you get big complex functions doing a bunch of stuff vs the described small functions adding little bits of functionality along the way, I think you are doing things wrong.

    That's not to say people (and this is common in Java) go way overboard and end up with huge chains of methods that just pass the buck and complex control structures where you need a debugger to figure out whats going on, but if done right it can make for easily maintained and readable code.

    1. Re:Makes sense to me by maligor · · Score: 2

      I'll admit I just read the summary article and not the paper itself, but I wouldn't say that this is overly surprising.

      Right off the bat due to this preoccupation we Java types seem to have with accessor methods (which I think if we admit, do something besides just set or get a private member variable like 1% of the time, why the hell we still do this I don't know..), and the frequent necessity for hash, clone, and equals methods, most of which is auto-generated, you end up with a bunch of small methods that do very little but up the code count.

      Beyond that, I think good design usually works out this way. You (or at least I like to) build up in layers, each layer using the previous layer at a higher level, until you get to the top where you have a few seemingly simple bits of code that pull it all together. When you get big complex functions doing a bunch of stuff vs the described small functions adding little bits of functionality along the way, I think you are doing things wrong.

      That's not to say people (and this is common in Java) go way overboard and end up with huge chains of methods that just pass the buck and complex control structures where you need a debugger to figure out whats going on, but if done right it can make for easily maintained and readable code.

      To me it seems meaningless. You write the 'fluff' to actually make the code maintainable/easily readable (or the opposite). If you want to be totally effective in terms of written commands, you should write machine code directly.

      What I think is curious is what their fluff algorithms would think of c obfuscation contests.

    2. Re:Makes sense to me by Anonymous Coward · · Score: 1

      The problem with Java is more so with programmers than with the language. It is absolutely possible to write compact, concise java code without this much fluff. But a lot of the mentality in the Java world is that for everything we need a DTO class, a bunch of setters, getters and every single data structure needs a class of its own where in a lot of cases a hash map would do just as well and without the fluff. This gives Java programmers such a bad name. Also I disagree with you that tons of abstractions are a hallmark of good design. Like with everything a sense of taste is everything. Beautiful code can be recognized by getting the abstraction level just right. Encapsulated enough for client code to use it easily but simple enough that client code doesn't need 50 lines of boilerplate just to use the damned thing.

    3. Re:Makes sense to me by Anonymous Coward · · Score: 1

      When I was in grad school, we did a fun class exercise of using the techniques from on-chip indirect branch predictors to predict everything about a program. Loads, stores, values, locations, arithmetic ops -- everything. Bottom line was that (without any special tuning) on the test suite we had, we could predict everything about every machine instruction execution roughly 85% of the time. It's no surprise that a higher level look would push this number higher.

    4. Re:Makes sense to me by Anonymous Coward · · Score: 0

      Right off the bat due to this preoccupation we Java types seem to have with accessor methods (which I think if we admit, do something besides just set or get a private member variable like 1% of the time, why the hell we still do this I don't know..)

      Accessor methods separate interface from implementation. Sure the implementation is quite often to just get/set a member variable, but that implementation detail should not be exposed by the interface. C# has much nicer syntax that basically does the same thing but in the 99% case you can skip the full declaration of the accessors and don't even have to declare the member variable. You get the benefits of not exposing implementation details in the interface, but the declaration is nearly as short as the naked member variable. Java is just being stuck up about providing syntactic sugar like that. The result is tedious syntax. I for one don't need a research paper to tell me that.

    5. Re:Makes sense to me by Anonymous Coward · · Score: 0

      factory factory factory

    6. Re:Makes sense to me by Anonymous Coward · · Score: 1

      I've mentioned it frequently, but I'll mention it again.

      I'm not fond of Java for much of the same reason I'm not fond of C++ or OBJC, or other OOP cruft tacked onto languages like Perl, PHP, and Javascript.

      There is WAY too much code dedicated to preventing mistakes or working around previous kludges, often to work with code written by someone else, so just about every damn program writes a "wrapper" or "framework" for every library they use, instead of just using the library as-is. The entire "Not Invented Here" problem is prevalent and responsible for a lot of chaff in code.

      There's no way we're going to get everyone to learn programming by learning x86 or ARM assembler first. So we should mandate that at the very minimum everyone know the common core aspects of C and Javascript. If you know C or Javascript, it's very easy to apply concepts from those languages to more OOP parts like OBJC, C++, and the higher level Javascript stuff.

      But frequently a lot of "chaff" comes from trying to do something in code that probably shouldn't.

      To give you an idea, I'm fond of building stuff in Javascript that I could have written easier in straight HTML. The reason I don't, has a lot more to do with the dynamic nature of what I build, and I won't use a third-party library to do it, as what I want to accomplish is often simple and writing the same thing using a framework library would just bloat the code excessively.

      In the same line of thinking, when I build stuff in C/C++ the first thing I do is check if what I want to do has already been done, and IF I should re-implement it or if I can fix the library to do what I want. If I can't fix it, then I won't use it. I'm not going to wrap the functionality for the sake of "maybe it will get fixed later"

      This is a problem with "DLL" files, and is even worse on Linux and BSD, as there will be not only old versions of libraries on the system, there will be a "system" version, a user-installable development version, and a software-installable version, and you end up having to recompile damn near everything three times to update everything.

      The concept of "shared libraries" has lead to a lot of chaff in software. At one time disk space was at a premium, so you could only afford one copy of the library on the system, but every piece of software you use since like 1998, installs it's own copies of shared libraries anyway. In some cases, this allows for a bit of future-proofing by replacing distributed libraries with system libraries that are newer, but that isn't what happens. Because of ABI changes (eg different compilers, different system kernels, or whatever) no libraries are ever used as alternatives, and in fact result in a lot of malware. For the sake of security we should really be statically compiling all core functionality, and only using third party libraries for "replaceable parts" of software. For example plugins that aren't initialized until implicitly activated, and the software can operate without it. Going back to the FFMPEG example. Many games do not let you record video or take screen shots, but having a plugin that lets the software pass off such CPU or GPU-intensive work to the most appropriate hardware makes sense.

      The number one reason MMORPG's are so full of hackers, bots, and RMT trash, are because we let other software run while the MMORPG is running. We will never be able to secure a MMORPG without first getting rid of the ability for other software to run on the system.

    7. Re:Makes sense to me by Maxo-Texas · · Score: 2, Interesting

      I read the article but not the study and the article states an unstated amount of the "fluff" is required to execute the code.

      So I'm thinking

      int a; is being treated as "fluff"

      And perhaps even

      public void longersubroutinename (int longerparametername) is mostly treated as "fluff".

      i.e.
      p v srA (int l) is much shorter. The rest is just fluff. Sure it names it human readable, but it's fluff!

      But I'm only guessing here. The percentage seems way too high to be anything sensible tho.

      I'm betting their "essential 5%" would be illegible and wouldn't execute / lacks declarations of variables or something else goofy.

      --
      She was like chocolate when she drank... semi-sweet at first and then increasingly bitter.
    8. Re:Makes sense to me by Maxo-Texas · · Score: 1

      Tried to download the code to confirm but atlassian said I was denied. May be slashdotted.

      --
      She was like chocolate when she drank... semi-sweet at first and then increasingly bitter.
    9. Re:Makes sense to me by theshowmecanuck · · Score: 4, Insightful

      Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
      -- Fowler

      --
      -- I ignore anonymous replies to my comments and postings.
    10. Re:Makes sense to me by Arkan · · Score: 1

      (...)accessor methods (which I think if we admit, do something besides just set or get a private member variable like 1% of the time, why the hell we still do this I don't know..), (...)

      Lookup "encapsulation": this is why your class members can't be declared public as long as they're not final.

      If you're writing a one-off code chunk, so be it: you'll be the only one to use and debug it. But you'll soon learn that a lot of "one-off" soon become "pre-release" and "sold to the customer as done, tested and readily available".

    11. Re:Makes sense to me by delt0r · · Score: 1

      Its not just java, it just used that as an example. Their claim is all programs.

      --
      If information wants to be free, why does my internet connection cost so much?
    12. Re:Makes sense to me by RabidReindeer · · Score: 1

      The problem with Java is more so with programmers than with the language. It is absolutely possible to write compact, concise java code without this much fluff. But a lot of the mentality in the Java world is that for everything we need a DTO class, a bunch of setters, getters and every single data structure needs a class of its own where in a lot of cases a hash map would do just as well and without the fluff.

      DTOs became obsolete/redundant when ORM switched to POJOs. All acronyms discounted for a limited time only.

      You REALLY don't want to use a hash map in place of fixed data structures. You not only lose most of the type safety, you lose stuff like being able to do compile-time checking for mis-spelled property names.

      If that's acceptable to you, then I recommend that you forget Java and switch to a language that doesn't care about compile-time checking such as Perl or Python.

    13. Re:Makes sense to me by Phreakiture · · Score: 1

      Hell, just look at "Hello world" in Java to see part of the problem. You have to create a class, then create a method main() within that class, then use a very lengthy absolute path to the method to send out put to the screen (System.out.println()). On top of that, both your method and class definitions require a slew of keywords to prefix them, because the defaults are not useful in this context.

      On accessors, I think a lot of that problem is groupthink. "We do it that way because that's the way we do it" is the mindset. Unfortunately, this has been reinforced by various frameworks, toolkits, standards and other accessories.

      There are two approaches I have seen in Python, Perl and LISP that are kind of cool (though please don't misconstrue this to be saying that these languages don't have other problems worthy of critique).

      One is to overload the accessors, naming the accessor the same as the variable it accesses, and if you call it with an argument, it sets it and returns same; calling it without an argument returns the current value. As an example, if you have a variable 'foo', then instance_variable.foo() would return whatever is currently the value of foo, and instance_variable.foo('bar') would set the value of foo in that instance to 'bar' and also return 'bar' (unless it ends up being massaged by the accessor).

      The other is to use a general accessor, often named param() or property() or something the like. It takes one or two arguments; if one, it is the name of the variable to be accessed; if two, the second argument is a value to set. Otherwise, it works the same as in the first approach.

      Common LISP (using CLOS) very strongly encourages the first approach, because all you have to do to create a very basic accessor (i.e. one that does not massage or validate) is say that it exists, and it does. You only need to write code for it if you need to do something specific in terms of validation or formatting.

      In the end, I am not surprised that Java code is mostly fluff. This stems from a failure of the language to have sane defaults. The good news is that the IDE can write a lot of that for you, but if the IDE can write it, the question remains: why does it need to be written at all?

      --
      www.wavefront-av.com
    14. Re:Makes sense to me by hattig · · Score: 1

      Coming from a Java background, I have found it very refreshing to start coding Clojure (which is a lisp family language that runs on the JVM).

      It does appear to me that it becomes possible to write extremely compact code in Clojure compared to the equivalent Java code.

      Also, the language really encourages you to just deal with the built in "primitive" collections (obviously behind the scenes they aren't primitive, but at the syntax/function level they are) - sets, maps, vectors, lists, etc for your data structures and passing data around. Java, even with Apache/Google collections help, is often a load of collection herding, shuffling and copying, which comes for free with Clojure (and will become a lot more concise with Java 8's Lambdas too).

      Modern programming practices (separation of concerns, patterns, etc) also means that code often has a lot of the same boilerplate structure around it, with a little functionality in the middle. The benefit is, of course, maintainability and clarity.

    15. Re:Makes sense to me by minstrelmike · · Score: 1

      I support a web system (LAMP stack) written in Perl 10 years. I fell for the library-ization idea of "good" practices when I started. After the three of us have sorted thru each other's code for 10 years and settled onto a somewhat standard approach, the library approach is dead. In a well-designed system, at least for database entry and reporting, there isn't much cause to have multiple functions shared between programs. All the stuff for this set of tables or this functionality ought to be included in this form/report right here and probably not ever used anywhere else.

      And if a function is used elsewhere, then it is probably overloaded with parameters which then have to be tracked and managed. That cost in maintenence has not been worth the "advantage" of not writing an almost similar function twice in two different places.

      I saw that with Oracle Designer. It was going to generate forms from tables. The reason we abandoned it is because you cannot generate relational forms, only single table forms. One of the odd things was there were 1100 parameters you had to set. But we looked at it and realized that was unavoidable. I can easily write code to display a web form based on table descriptions (version #1). I can create fields for dates vs text vs numbers and can have restrictions on values if those are in the database table/field descriptions somehow. But if I want to let the user choose colors for the forms and different sizes of fonts for the labels and different whatevers, well you end up with 1100 options to set.

      There is a cost to abstraction, and it's expensive in java.

  2. Your Article Is All Fluff, Reader Finds by kaputtfurleben · · Score: 5, Insightful

    This article uses a lot of words to say absolutely nothing.

    1. Re:Your Article Is All Fluff, Reader Finds by msauve · · Score: 5, Insightful

      I think they're advising that you remove all error checking, help messages, and logging, since that's not required for "core functionality."

      --
      "National Security is the chief cause of national insecurity." - Celine's First Law
    2. Re:Your Article Is All Fluff, Reader Finds by Anonymous Coward · · Score: 0

      I condensed the summary even further to get along the core meaning of it:

      javaFluff = code*0.95

    3. Re:Your Article Is All Fluff, Reader Finds by Anonymous Coward · · Score: 5, Funny

      Comments and descriptive variable and method names should also go, we're much better with "void x(int c) { a.b(c); x.b.g.y(c) }", as the real coders do not maintain code, they just write it. And the disk space is so expensive that even linefeeds should be avoided whenever possible.

    4. Re:Your Article Is All Fluff, Reader Finds by IamTheRealMike · · Score: 4, Insightful

      Plus other bits of code actually required to make it run.

      They also say that they think the same findings would hold for C++. So whilst it's a bit hard to know if this technique is useful without reading and pondering the paper, it isn't saying much about Java specifically.

      That said - we all know Java is a very simple and verbose language. That has some advantages like ultra-fast compiles, but lots of disadvantages too. So here I'm gonna point out Kotlin, which is a new JVM language with transparent Java interop (in both directions). It's a lot more concise and expressive than Java, whilst simultaneously having a stricter type system. The neat thing about Kotlin is, it's developed by JetBrains so you get completely seamless integration with their refactoring IDE. Also there is a Java-to-Kotlin converter feature that lets you turn a Java file into a Kotlin file instantly, and you can convert a codebase on a class-by-class basis. So you can start using the features of the new language right away. Also, it runs on Java 6, so it's Android compatible.

    5. Re:Your Article Is All Fluff, Reader Finds by Anonymous Coward · · Score: 0

      Oh, and don't forget those comments! After all, the code documents itself right? Right?

    6. Re:Your Article Is All Fluff, Reader Finds by fustakrakich · · Score: 1

      Well yes, it is about Java, the first language to mix coding with literature.

      --
      “He’s not deformed, he’s just drunk!”
    7. Re:Your Article Is All Fluff, Reader Finds by Anonymous Coward · · Score: 0

      Your code has bugs in it. You've attempted to treat a function as a struct, not once, but twice.

    8. Re:Your Article Is All Fluff, Reader Finds by roman_mir · · Score: 2

      I think what they are trying to say is that when you are buying a car you are mostly paying for fluff and not for the bare essentials.

      The bare essentials in a car is a drive train, the engine, maybe, MAYBE the gas tank and the steering wheel and the gas pedal.

      Everything else is fluff you are paying for. Wouldn't you rather just pay for the bare necessities and the hell with the fluff?

      (oh, and if you want to eat an apple you have to have an apple tree somewhere, which is also mostly fluff since only the fruit is edible and the tree is not, so what the fuck, nature?)

    9. Re:Your Article Is All Fluff, Reader Finds by goose-incarnated · · Score: 4, Insightful

      Well yes, it is about Java, the first language to mix coding with literature.

      It wasn't the first. LaTeX :-)

      --
      I'm a minority race. Save your vitriol for white people.
    10. Re:Your Article Is All Fluff, Reader Finds by jfbilodeau · · Score: 1

      Are you sure you're not thinking of Pascal?

      --
      Goodbye Slashdot. You've changed.
    11. Re:Your Article Is All Fluff, Reader Finds by Anonymous Coward · · Score: 0

      Logging is essential to provide long-term maintenance for deployed software. Any researcher that says this is fluff has never had to support a running app in the field.

    12. Re:Your Article Is All Fluff, Reader Finds by fustakrakich · · Score: 1

      Only on Easter

      --
      “He’s not deformed, he’s just drunk!”
    13. Re:Your Article Is All Fluff, Reader Finds by msobkow · · Score: 1

      Not to mention comments, variable declarations, accessors, factories, etc. Each of which servers a purpose if you have to extend, re-engineer, or maintain code.

      --
      I do not fail; I succeed at finding out what does not work.
    14. Re:Your Article Is All Fluff, Reader Finds by Atzanteol · · Score: 1

      This is just me probably - but WTF is with languages making semicolons optional? Require them or don't allow them. Making them optional is a pain in the ass for somebody who is used to adding them since it will cause me to sometimes use them and sometimes not. I *hate* having this inconsistency in my code...

      I've never quite understood the hate for the semicolon - but I type it so reflexively now that maybe I don't realize how difficult it is for newbs?

      --
      "Ignorance more frequently begets confidence than does knowledge"

      - Charles Darwin
    15. Re:Your Article Is All Fluff, Reader Finds by Anonymous Coward · · Score: 0

      I think they're advising that you remove all error checking, help messages, and logging, since that's not required for "core functionality."

      Remove all 4 limbs. Not required for core functionality.

    16. Re:Your Article Is All Fluff, Reader Finds by Anonymous Coward · · Score: 0

      Syntax error, missing ';'

    17. Re:Your Article Is All Fluff, Reader Finds by Anonymous Coward · · Score: 0

      Kotlin is interesting, but when I looked into it I didn't care for some of the syntax. For example, if you're trying to make a language that's removing a bunch of boilerplate and unnecessary crap, why would you still require parentheses on methods (especially methods that take no arguments)?

      Another JVM language worth mentioning is Mirah, which has Ruby-like syntax but uses the Java API with some syntactic sugar (no runtime jar). You still get static typing but it can usually infer the type without explicit declaration, and you skip a lot of the Java boilerplate stuff because of the Ruby syntax. Optional parentheses (but valid when needed for clarity or to resolve ambiguity), optional semicolons, blocks marked with begin/end or then/end instead of braces, stuff like that. I find nicer to type and still easy to read, especially compared to Java.

      Something similar for native code is Crystal, with another Ruby-like variant syntax that generates native code and interoperates with C libs. This one actually has something of a runtime and implements things like Ruby's Dir and File classes. It's new and language features are in flux but it's got promise.

      The Ruby inspiration won't appeal to everybody, but I like it, especially with static-typed languages that don't suffer from real Ruby's performance.

    18. Re:Your Article Is All Fluff, Reader Finds by RabidReindeer · · Score: 1

      I think they're advising that you remove all error checking, help messages, and logging, since that's not required for "core functionality."

      Now I know where my old manager went.

    19. Re:Your Article Is All Fluff, Reader Finds by Anonymous Coward · · Score: 0

      I had the discussion in job. OVERHEAD. But my code could do things unexpected without being changed, so it qualified as eternal encapsulation, etc... I do see Java as marshmallowy compared to the steel of C++. But it sounds like fluff too. :-)

    20. Re:Your Article Is All Fluff, Reader Finds by rdnetto · · Score: 1

      Hey, why make it human readable at all? We could encode the program in instructions of word each, and limit the no. of available registers so that they could be represented by a simple 6-bit integer. We could even generate such code from the existing, inefficient code using a compiler...

      --
      Most human behaviour can be explained in terms of identity.
  3. No comment by Anonymous Coward · · Score: 0

    I guess it's time we started reducing the amount of comments, in order to rectify this.

    BAN ALL COMMENTS! (And white-space)

    1. Re:No comment by Anonymous Coward · · Score: 0

      I guess it's time we started reducing the amount of comments, in order to rectify this.

      BAN ALL COMMENTS! (And white-space)

      And pity those that have to maintain the code.
      Yeah fuck all those comments in the code. Utterly useless.

    2. Re:No comment by Anonymous Coward · · Score: 0

      I guess it's time we started reducing the amount of comments, in order to rectify this.

      BAN ALL COMMENTS! (And white-space)

      Back when I was in school... My first programming class REQUIRED 50% comments. They ran your source though their line counter and if it didn't have the minimum required comment percentage they wouldn't grade the program.

      Seemed like a good idea at the time...Actually, it STILL seems like a good idea after 30 years...

    3. Re:No comment by Cederic · · Score: 1

      Sure, if you want your outsourced dev team writing // add 1 to i
      i = i + 1;

      Yes, I've seen this.

    4. Re:No comment by geoskd · · Score: 2

      Seemed like a good idea at the time...Actually, it STILL seems like a good idea after 30 years...

      Good quality code should be largely readable in and of itself. comments to be included only where needed to clear up unavoidable complexity. Consider the following code:

      // if value is decreasing fast enough
      if( LastZASValue - ZASValue > ZASFraction )
      {
      if( DrivingHigh )
      {
      StageUp( CurrentValue );
      }
      else
      {
      StageDown( CurrentValue );
      }
      }

      You'll notice only one line in 10 is a comment, but the intent of each line is very clear in and of itself because of the clear choice of function names, and variable names. The only line of comment is used to create a human readable explanation of what the if statement is testing for, since it is not necessarily clear from the math itself. (Pardon the lack of indentation, I dont feel like fighting with HTML/Slashdot at the moment)

      --
      I wish I had a good sig, but all the good ones are copyrighted
    5. Re:No comment by HornWumpus · · Score: 0

      WTF? Terrible.

      Fast enough for what?

      What is ZAS?

      Why are you using ZASFraction when you are testing a difference? Shouldn't it be ZASdifference or a ratio test?

      DrivingHigh?

      StageUp? StageDown? KSP automation?

      CurrentValue? How is CurrentValue related to ZASValue?

      D- at best in school, rejected from source control at code read in industry. I'd hate to be supporting your shit.

      --
      John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
    6. Re:No comment by Anonymous Coward · · Score: 0

      Well... the values seem to be decreasing fast enough, but it could use more ZAS.

    7. Re:No comment by bobbied · · Score: 1

      There is a LOT of context missing from your little example, but never fear, a few comments would/could clear that up.

      Look, the bulk of what I end up putting into my code as "comments" is what seems pretty obvious to me, but I spend a lot of time implementing code based on industry specifications (IEEE, RFC's and others). When doing such work, it's usually a good idea to leave behind a way to link back to the specification being implemented (for my sake and for the sake of the programmer behind me) so it's easy to find.

      I also tend to opine about each method's reason for existence, including what inputs it expects, what exceptions it might throw and what output you can expect. One thing I make a point to document in function and class headers is any place where this code may have some hidden affect on something, especially something you didn't pass in. I do this in the header, mainly because it's easer for the programmer that comes behind me, but also because we use doxygen to convert all this stuff into documents for later reference.

      No, Comments are a necessity for my job and I think if you think about it, yours too. Maybe not as detailed as what I go though, but a very good discipline for a coder.

      --
      "File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
    8. Re:No comment by parenthephobia · · Score: 1

      WTF? Terrible.

      Fast enough for what?

      What is ZAS?

      Why are you using ZASFraction when you are testing a difference? Shouldn't it be ZASdifference or a ratio test?

      You require an essay on why that particular variable was used? If I write area = PI * radius ** 2, do I need to explain why I used pi instead of e?

      At some point you have to accept that your comments can't start with Euclid's elements and work up from there: you have to assume the reader has some prior knowledge. Once you accept that, it's just a question of where you draw the line.

      If this code is about ZASes and their staging, and you don't know what ZAS is, perhaps you need to familiarize yourself with what the code is about at a high level before you can expect to be able to understand lines picked at random.

      D- at best in school, rejected from source control at code read in industry. I'd hate to be supporting your shit.

      Meanwhile, in the real world, code like this gets checked in to source control in professional development environments all the time.

    9. Re:No comment by HornWumpus · · Score: 1

      Yes people check in bad code all the fucking time.

      Assuming prior knowledge of what code does is exactly what you are not supposed to do. You would know that if you weren't so full of yourself.

      You were the one who posted shit code for all to see, claiming it was self commenting.

      After hearing your defense grade is changed to F. You don't understand why you should comment.

      --
      John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
  4. This just in. by Anonymous Coward · · Score: 0

    Java is 95% boilerplate and 5% project-specific. We already know this. This is what Java is. Lots and lots and lots of long strings of stock API objects separated by dots.

    1. Re:This just in. by Anonymous Coward · · Score: 0

      Just to be safe, I'm switching to machine language anyway.

  5. Same for any code by Ubi_NL · · Score: 4, Insightful

    In my experience, 80% of my code deals with checking for user error and thing like that (i.e not enter a string where i expect a number, does this socket really exist). This is important functionality, but indeed, it is not 'core'...

    --

    If an experiment works, something has gone wrong.
    1. Re:Same for any code by Dutch+Gun · · Score: 5, Insightful

      Agreed. As the saying goes: "The devil is in the details".

      It's often very easy and quick to write the "core" functionality, but dealing with exceptions (both in workflow and code), one-offs and special rules, shifting requirements, scope creep, etc, etc... It may not be core, but it's a huge amount of work to write it all. I remember a saying that went something like "80 percent done... now you've only got 80 percent to go", meaning that the perception of being "nearly finished" is much different than the reality.

      It's especially bad when you're racing to meet a milestone with payment tied to specific functionality (I've seen this in the videogame industry), and just barely write enough code to more or less hit that "easy" initial 80 percent, but never get that "last 80 percent" until the end of the project. It ends up as a hellish crunch-mode disaster at the end of the projects, with managers not understanding why the project seems to implode near the end.

      --
      Irony: Agile development has too much intertia to be abandoned now.
    2. Re:Same for any code by Anonymous Coward · · Score: 0

      Agree! That's why I'm so excited abut Swift. All those IF statements for error checking disappears with Optionals.

    3. Re:Same for any code by Nemosoft+Unv. · · Score: 1

      Actually, what I found out is that with most applications you spend an awful lot of code on fetching and displaying data. A typical web applications that uses a database comes mostly down to:

      • Fetch parameters
      • Build query
      • Fetch data
      • Do something with the data, like concatenating first name/last name, make a 'pretty' date, add totals (this would be the core functionality of that page)
      • Build HTML

      Even when you use a framework this is still 90% of the code. There are some frameworks that allow for direct display of SQL queris but that is usually not possible because you have to do something to make the data *readable*. My all-time 'favorite' is dates; going from '2015-02-11' to 'February 11, 2015' and back.

      --
      "Fix it? It has been disintegrated, by definition it cannot be fixed!" - Gru in Despicable Me.
    4. Re:Same for any code by quantaman · · Score: 4, Insightful

      I agree that a certain level of fluff is essential, but some also comes from the language itself. Getters/setters are a great example, that's a lot of fluff that almost vanishes in a language like python without detracting from maintainability or stability. Errors are a more subtle example, what kinds of errors are possible given the language and API? At what level does the API want you to handle errors? How much code do you need to handle those errors properly? This can greatly influence the volume of necessary fluff.

      --
      I stole this Sig
    5. Re:Same for any code by Anonymous Coward · · Score: 0

      You bring up a good point. Sanity checking and input sanitizing is a universal requirement, yet it's often so badly implemented or just non existent. Every implementation is roll-your-own or tacked on as an afterthought.

      Considering how much work we put in to UI consistency, you'd think someone would have developed a standard set of libraries or techniques to use a jumping off point.

      I'm surprised how many developers don't understand the idea of "Assume all user input is hostile"

    6. Re:Same for any code by Drethon · · Score: 1

      But not very fluffy...

    7. Re:Same for any code by Anonymous Coward · · Score: 0

      There is no need to have any "getter/setter" in Java anyway. It's just a paradigm that stuck to Java people because of JavaBeans.

      Java can have public instance variables, just like C++ or python or whatever other sane language you can think of.

    8. Re:Same for any code by Anonymous Coward · · Score: 1

      Getters and Setters are an odd case. They exist more to protect that section of the code from other sections of code or from one programmer against another. They don't do anything for the overall end user features of a program.

      Getters
      * Use to ensure valid values are always returned
      * To trigger lazy initialization
      * For dependency injection
      * For an easy inspection point to see what accesses a variable
      * To hide internal data types so you can improve the underlying algorithms and data structures without changing anything else

      Setters
      * To insure only valid values are stored
      * To limit changing a variable to specific sections of the code
      * For an easy inspection point to see what changes a variable
      * As a way to always trigger other changes whenever something is changed
      * To hide internal data types so you can improve the underlying algorithms and data structures without changing anything else

      Both of them are never required, but in massive code bases they provide essential protection from unexpected bugs and barriers to rippling changes. No one knows the entire code base and developers are too lazy to read and follow documentation, assuming it was written and kept updated in the first place. Though never core code, they provide a level of sanity while at the same time are crazy to write. You don't realize you need them until you don't have them.

    9. Re:Same for any code by jellomizer · · Score: 1

      I have found that everytime I try to write one, my project keeps on throwing brand new twists that makes it harder each time. They are things that do the trick as well just as forcing a format on a text box. However its usage isn't always obvious and sometimes will require additional work.

      The part I would really like to see is the UI and the BackEnd were able to have one code for the sanitization checking.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    10. Re:Same for any code by DraconPern · · Score: 1

      Not using exceptions?

    11. Re:Same for any code by Anonymous Coward · · Score: 0

      Actually, what I found out is that with most applications you spend an awful lot of code on fetching and displaying data. A typical web applications that uses a database comes mostly down to:

      Because that's all that typical web applications do. That's all the web is for these days, capturing and displaying data for databases. Nothing actually happens in web applications.

      But ... wait for it ... most applications are not web applications. Those applications do a hell of a lot of other fancy stuff...

      BTW, most frameworks these days are so generalised they are virtually useless. They don't end up cutting down the amount of code, artefacts, configuration or XML (which is used as all three these days) because the frameworks need so much crud to tell them how to get the framework to work the way you want them to in your application for your purposes. So much so, a lot of the time you might as well go back to coding in the raw language.

      Expect most "programmers" these days don't know languages (even Java, PHP or Javascript) - they only know one or two frameworks.

    12. Re:Same for any code by Anonymous Coward · · Score: 0

      You're wrong if you write code whos core functionality is preventing input errors...

    13. Re:Same for any code by Tablizer · · Score: 1

      Time to blow up the HTML stack for CRUD programming and rethink browsers and fat clients. Desktop CRUD was much simpler. We devolved.

    14. Re:Same for any code by MondoGordo · · Score: 1

      This +1

    15. Re:Same for any code by Anonymous Coward · · Score: 0

      Every time I have to type
      public SomeType Foo
      {
          get
          {
              return _foo;
          }
          set
          {
              if (_foo == value)
              {
                  return;
              }
              _foo = value;
              OnPropertyChanged("Foo");
          }
      }
      SomeType _foo;

      I die a little inside.

  6. Peanuts by Anonymous Coward · · Score: 5, Insightful

    No. This is what happens with a language with an extremely verbose API and extreme boiler-plate requirements. The best Java developer in the universe isn't going to be able to get around this.

  7. The alternative by halivar · · Score: 4, Insightful

    Imagine a language with no fluff, no cruft, no boilerplate. Everything is essential and concise. You have something akin to either assembly or too-clever Perl. The fluff is necessary. The fluff provides context, readability, and maintainability.

    1. Re:The alternative by Trepidity · · Score: 3, Insightful

      I agree you can get too clever with concise syntax, but Java really does not seem like it's at optimal point on that tradeoff. Some really common things are very verbose, to the extent that it harms readability imo.

    2. Re:The alternative by Anonymous Coward · · Score: 0

      It's called Maths.
      Math is exact, solid, reliable and universal.

      You can learn someone advanced math without them even knowing a spoken language through simple demonstrations built-up over time.
      Something that is often not counted as a second language, actually IS a second language, and the most universal language at that.

    3. Re:The alternative by arth1 · · Score: 1

      Imagine a language with no fluff, no cruft, no boilerplate. Everything is essential and concise. You have something akin to either assembly or too-clever Perl. The fluff is necessary. The fluff provides context, readability, and maintainability.

      It also provides its own bug opportunities. Indeed, from looking at what Coverity finds, most defects wouldn't have existed without the fluff.

      I'm not advocating that people migrate to assembly or perl, but whenever you cannot point at just where something happens, you have overused abstractions.

    4. Re:The alternative by itzly · · Score: 2

      I always write my code in tar.gz format, you insensitive clod.

    5. Re:The alternative by Grishnakh · · Score: 1

      This has no relationship to assembly at all. If you were to rewrite a Java program in assembly, you'd have to replicate *everything* the language does yourself. You'd have even more boilerplate.

      The whole point of a high-level language is to avoid having to redo the same work for every project, or having to redo something that someone else could have done for you, and to express what you want the computer to do more concisely. Instead of, for instance, looking up the memory location of an array member and incrementing it, you just type "myarray[i]++". Doing that in assembly would take a lot of typing.

      The fact that Java requires so much boilerplate really defeats the purpose of using a high-level language. You shouldn't have to do all that stuff; it should be built-in to either the language (like polymorphism is built into OO languages like C++, whereas in C you end up manually setting up function tables), or built into the standard libraries, so that you don't need to do much to make use of that work.

      Requiring developers to add a lot of boilerplate makes for *worse* readability and maintainability, because that's more work for them to do, and more things that can go wrong.

    6. Re:The alternative by Daniel+Hoffmann · · Score: 1

      No, what you end up having is Lisp.

    7. Re:The alternative by Selur · · Score: 1

      expandability rarely goes hand in hand with simplicity when looking at the whole code,..

    8. Re:The alternative by angel'o'sphere · · Score: 1

      SmallTalk would be a better example, ad it is a high level language ;) and is more or less keyword less, has an extreme high code densitiy.
      Unfortunately it is out of fashion right now, very very slowly gaining momentum again.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    9. Re:The alternative by bromoseltzer · · Score: 1

      Perhaps you are thinking of APL?

      --
      Fiat Lux.
    10. Re:The alternative by stox · · Score: 1

      Rob Pike and I came to the conclusion that you can get too concise in a language. The example was APL.

      --
      "To those who are overly cautious, everything is impossible. "
    11. Re:The alternative by bromoseltzer · · Score: 1

      Or perhaps TECO, the world's most perfect text editor? A TECO command string is famously like random keystrokes. I suppose comments were possible, but I don't remember using any.

      --
      Fiat Lux.
    12. Re:The alternative by Anonymous Coward · · Score: 0

      Something that is often not counted as a second language, actually IS a second language, and the most universal language at that.

      For something to be considered a language to the language-people it needs fluff. Everything they judge about language proficiency evolves around the fluff.

    13. Re:The alternative by phantomfive · · Score: 1

      The fluff is necessary. The fluff provides context, readability, and maintainability.

      That's what comments and code-contracts are for. Well-defined interfaces. Extra lines of code gives bugs more lines to hide in.

      --
      "First they came for the slanderers and i said nothing."
    14. Re:The alternative by phantomfive · · Score: 1

      Indeed, from looking at what Coverity finds, most defects wouldn't have existed without the fluff.

      Really?

      --
      "First they came for the slanderers and i said nothing."
    15. Re:The alternative by bluefoxlucid · · Score: 1

      It's not that; the author is patently insane.

      The author is saying that "if (a

      Crap dangling around a program isn't just necessary for it to run. All those keywords, function calls, common APIs, and the like tell the program what to do with the data you're telling it to manipulate.

    16. Re:The alternative by mean+pun · · Score: 3, Insightful

      Extra lines give the code checking and refactoring tool more information.

    17. Re:The alternative by EmeraldBot · · Score: 1

      It's called Maths. Math is exact, solid, reliable and universal.

      You can learn someone advanced math without them even knowing a spoken language through simple demonstrations built-up over time. Something that is often not counted as a second language, actually IS a second language, and the most universal language at that.

      Math is not a human language. If you contend it is, try expressing emotions with it.

      --
      "Set a man a fire, he'll be warm for the rest of the night. Set a man afire, he'll be warm for the rest of his life."
    18. Re:The alternative by bluefoxlucid · · Score: 1

      I used to write in a language that I had reduced to strings of numbers. Instead of writing out the full command, I had listings of pairs of numbers.

    19. Re:The alternative by weilawei · · Score: 1

      If it were so reliable and universal, Mr. Kurt Gödel wouldn't have had such a big argument with Mr. David Hilbert.

      Just nitpicking, since we ARE talking about math as a whole, here. You didn't specify any little bit of it.

    20. Re:The alternative by shoor · · Score: 1

      Actually, I think you can have 'fluff' in assembler, though when writing assembler you're usually very focussed on some very specific thing that needs to be done, and sometimes every CPU cycle counts, so in practice, yes, you'll see less fluff.

      I have just enough experience with Perl that I think I know what you're talking about with 'too-clever Perl'. There must be some great examples of 'too-clever APL' out there unless the mag tapes and IBM 2311s they were saved on have all Gone South by now.

      --
      In theory, theory and practice are the same; in practice they're different. (Yogi Berra & A. Einstein)
    21. Re:The alternative by Marginal+Coward · · Score: 1

      Math is not a human language. If you contend it is, try expressing emotions with it.

      May I use factorials?

    22. Re:The alternative by Mr.CRC · · Score: 1

      On the contrary, "myarray[i]++" is a one-liner in 2 out of 3 of the assembly languages that I've tinkered with.

    23. Re:The alternative by EmeraldBot · · Score: 1

      Math is not a human language. If you contend it is, try expressing emotions with it.

      May I use factorials?

      Whatever you deem as math is fair game. But you won't be able to; math has no way of expressing human emotions.

      --
      "Set a man a fire, he'll be warm for the rest of the night. Set a man afire, he'll be warm for the rest of his life."
    24. Re:The alternative by Marginal+Coward · · Score: 1

      7734!

    25. Re:The alternative by lister+king+of+smeg · · Score: 1

      Rob Pike and I came to the conclusion that you can get too concise in a language. The example was APL.

      Everything should be made as simple as possible, but not simpler.

      --
      ---Saying gnome 3 is better than windows 8 not so much a compliment as it is damning with light praise.
    26. Re:The alternative by Marginal+Coward · · Score: 1

      (Let's see if Mr. Spock gets the joke this time, with a second joke thrown in. ;-)

    27. Re:The alternative by Anonymous Coward · · Score: 0

      Python requires a lot more fluff to stay maintainable, the amount of unit tests needed for large projects written in a mainly dynamic language is a lot bigger than for Java.

    28. Re:The alternative by Anonymous Coward · · Score: 0

      Does this line include a null pointer check for the array? Or a range check for the offset? What about the logic to remove these checks if they are unnecessary?

      There is a lot more behind that line of Java or most other languages than just incrementing a value at some memory location. You could be right for a low level language like C, however even there you run into type modifiers that change how the array can be accessed.

    29. Re:The alternative by EmeraldBot · · Score: 1

      (Let's see if Mr. Spock gets the joke this time, with a second joke thrown in. ;-)

      Well... But... Okay, I can't argue with that. Point taken... 1134 was how I learned it :P

      --
      "Set a man a fire, he'll be warm for the rest of the night. Set a man afire, he'll be warm for the rest of his life."
    30. Re:The alternative by Marginal+Coward · · Score: 1

      Thanks for being a good sport. Actually, with "7734", I guess I'm showing my age. That was the preferred form on the early TI calculators which had 7-segment LEDs. But I see now on my more modern LCD calculator that it has hooks on the 7's, which doesn't render as well as your "1134".

    31. Re:The alternative by Anonymous Coward · · Score: 0

      Totally untrue. Functional languages get very concise without being unreadable. Have you seen good Clojure code?

    32. Re:The alternative by Anonymous Coward · · Score: 0

      This shows that you have little experience in assembler, Perl, or attempting to write code in situations where you can get rid of fluff (e.g, with macro systems, or where you write your own DSLs.)

      The fluff tends to obscure meaning.

      Yes, there is a point where lack of fluff becomes a problem (APL comes to mind), but even with that, it's not clear that adding fluff is a good idea. Research shows that the number of bugs per line of code is roughly constant, independent of language. Your fluff is a bug creator. And - would you seriously be more likely spend less time properly comprehending a 2000 line Java program or a 60 character APL program? I'm not at all sure the winner would be Java - and that is from somebody that think APL is going too far.

    33. Re:The alternative by Anonymous Coward · · Score: 0

      Common research finding: Programs in languages at different verbosity levels tend to have the same number of bugs per line. And while I suspect there are more bugs per line in very succinct languages, I also suspect there are fewer per function point. It would match my experience (which includes over a decade on each side of the fence.)

    34. Re:The alternative by Anonymous Coward · · Score: 0

      Math is not a human language. If you contend it is, try expressing emotions with it.

      You can use math to define languages, and languages can express human emotions. Your statement is akin to saying that you can't live in bricks. True; but you can live in a house built of bricks.

    35. Re:The alternative by phantomfive · · Score: 1

      I'm sure you had something interesting to say there, but half your comment got eaten.

      --
      "First they came for the slanderers and i said nothing."
    36. Re:The alternative by Anonymous Coward · · Score: 0

      Want to create a new instance of SomeClass on an AVR microcontroller circa 2008 using WinAVR (the GCC toolchain for AVR microcontrollers)? Try:

      *SomeClass foo = (* SomeClass)malloc(sizeof(SomeClass));

      Maybe I'm just weird, but that seriously traumatized me.

      (posting as AC, because I'm sure I made a C++ syntax error in the cast & it's too late to spend 10 minutes researching the exact syntax just for the sake of this example).

    37. Re:The alternative by epine · · Score: 1

      There must be some great examples of 'too-clever APL' out there unless the mag tapes and IBM 2311s they were saved on have all Gone South by now.

      Learning APL as my first high level programming language (at age 18) was one of the best things I ever did.

      The vast majority of "cleverness" in APL one-liners involved exploiting deep mathematical identities which were completely obvious once mentally unpacked. If you used the language enough, you started to recognize certain chunks of symbols as idioms, and you could pretty quickly guess which mathematical mother sauce had been tarted up with carrots and pine nuts. You practically felt your IQ growing as you gained fluency.

      The human mind is amazingly sophisticated as some very difficult tasks (ask anyone who has ever studied human vision) but at the same time we stumble over double negatives (to say nothing of triple negatives) which involves nothing more than determining the parity of a small integer.

      Anyone who has ever assembled a BBQ knows just how badly the human brain handles the dihedral group D_4. If every piece in the kit was marked with its symmetry code, there would be far fewer BBQ assembly nightmares (like not initially noticing a small asymmetric drill hole in a strut that is otherwise completely reversible).

      And why is it possible to tell someone to head north, turn right, go a bit, turn left, go another bit, turn left again, pass the church, then turn right and look for your destination and not have the person immediately know the direction of the final street? It's vastly easier than many other mental functions that we do do effortlessly.

      APL makes one small step of logical necessity which involves one giant leap of man's brain: that we really can be taught not to be ignoramuses about the orientation of a multidimensional array after it is transposed in three different ways as it works it's way through an expression operating along different subsets of axes.

      The bad kind of cleverness is relying on something that's kind of arbitrary about your data structure or its arrangement. "Well, in that case, it just falls through to the zero that terminates the following data object after walking a few extra bytes." (Don't suppose that assembly language coders working with just a few hundred bytes of RAM or ROM didn't regularly do exactly this kind of thing.)

      You never get that kind of thing in APL, because that language is stripped down to mathematical essentials and almost completely devoid of weird-arbitrary-thingness.

      If your application domain was full of weird arbitrary thingness, APL was a pretty poor match as a choice of programming language. You wanted to use APL to solve problems where some kind of deep order was in there screaming to rise to the surface.

      You might think something was kind of too cleverish on first pass, but 90% of the time your final verdict escalated from clever to deep.

      Everything I programmed in APL assumed that the vast majority of working data lived in system memory, like some kind of calculator on steroids. It was far from a great systems language.

      It's because of my early experience with APL that I began permanently immune to certain kinds of fuzzy thinking. The only way to program a computer to pass the Turing test where it's as bad as the human mind at simple parity or tracking compass directions or mapping BBQ parts onto D_4 is to use neural networks that mimic the construction of the human brain.

      Do you really think that Robocop cares if he's holding a book upside down? There might be situations where a book balances better with the fat side on the right, regardless of text orientation. When he gets to the mid point, he rotates the book 180 degrees and starts flipping the pages in the opposite direction.

      Is he being too clever, or is he just being sensible, without the encumbrance of a ridiculous human perceptual asymmetry?

      Human cognitive limitations are rather Byzantine

    38. Re:The alternative by Blackman-Turkey · · Score: 1

      Math is not a human language. If you contend it is, try expressing emotions with it.

      <3

  8. Re:Peanuts by Anonymous Coward · · Score: 0

    I'd seriously argue the opposite is true.

    Huge god classes and omni-functions are what you get from people who just need it to pass the test / quick inspection and don't care about reliability or ongoing maintenance. Well written code should be a bunch of small encapsulated bits that build on each other rather than gigantic doAllTheThingsNowBecauseTheButtonWasClicked() methods.

  9. 95% might be good enough for most... by bigsexyjoe · · Score: 5, Funny

    But I shoot to make 100% of the code I write fluff.

    1. Re:95% might be good enough for most... by fustakrakich · · Score: 1

      Does it have feet, and big eyes?

      --
      “He’s not deformed, he’s just drunk!”
    2. Re:95% might be good enough for most... by DoofusOfDeath · · Score: 1

      But I shoot to make 100% of the code I write fluff.

      Can you explain that some more?

    3. Re:95% might be good enough for most... by Anonymous Coward · · Score: 0

      Considering the utterly heartrendingly pointless projects most people work on in the corporate world...this is the reality for many corporate slaves out there.... ...at least at a higher level of abstraction than this article addresses....

    4. Re:95% might be good enough for most... by BarbaraHudson · · Score: 2

      But I shoot to make 100% of the code I write fluff.

      Can you explain that some more?

      He probably could, but then he'd be taking away from the fluff in his code to add it to here.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    5. Re:95% might be good enough for most... by Anonymous Coward · · Score: 0

      But I shoot to make 100% of the code I write fluff.

      Welcome to management!

    6. Re:95% might be good enough for most... by Anonymous Coward · · Score: 0

      Use Modula 2

  10. Code as Poetry? by pubwvj · · Score: 1

    There is a old phrase about code being poetry. Java's the flowery kind rather than that Haiku.

  11. Re:Peanuts by MightyMartian · · Score: 0

    Mod up +10000. Most of the "modern" languages seem to have this addiction to overly verbose libraries and obscenely long syntax. Do we really need method names that could constitute a simple sentence?

    --
    The world's burning. Moped Jesus spotted on I50. Details at 11.
  12. This sounds silly ... by gstoddart · · Score: 4, Insightful

    A couple of important points to keep in mind here. First, the MINSET itself is not executable; itâ(TM)s merely the smallest subset of the code which characterizes the core functionality. Some of the other 95% of the code (the chaff) is required to make it run, so itâ(TM)s not useless.

    So, we can do a computer transform on it to make it into something a computer can express efficiently, but we ignore the fact that the other 95% of the code is the error checking and other shit which you can't do without.

    The whole premise of this "study" has nothing to do with code, how to write it, or what that entails.

    I once had a co-worker who kept telling me that lisp or scheme would magically make it so you just wrote a two line program -- something like "getReady; justDoIt".

    When I asked him who the hell would write "getReady" and "justDoit", he seemed to think it would be some magic step which sorted itself out. The hard parts don't just magically happen. I can write main() in C which says "getReady(); justdoIt();" -- that doesn't mean that I don't need to implement those parts.

    This sounds equally stupid.

    Since when have coders started subscribing to wishful thinking where you just wave your hands and the computer does all the hard stuff?

    --
    Lost at C:>. Found at C.
    1. Re:This sounds silly ... by Anonymous Coward · · Score: 3, Funny

      Wow, your co-worker sounds like an idiot. Everyone knows in lisp it would be (justDoIt (getReady)). It's the functional paradigm that makes it magic and that makes it ONE line not two.

    2. Re:This sounds silly ... by Grishnakh · · Score: 1

      A C call to "strnlen" is required to make your program run, but if you wrote your own version of that standard library function, which did the exact same thing, *that* is useless. A program which simply calls that function uses the functionality without actually making it part of the program (the source part), simply by including a library and calling it. That function could be considered "boilerplate" if you made your own version and included it in every program you wrote, instead of using the library; it's necessary, but it's wasting space and should be replaced with the library version.

      All that error-checking is necessary too, but by now, shouldn't we have high-level languages where most of that stuff is handled automatically?

      Since when have coders started subscribing to wishful thinking where you just wave your hands and the computer does all the hard stuff?

      Since they stopped writing everything in assembly language, that's when. That's why we invented standard libraries and high-level languages: so we wouldn't have to reinvent the wheel constantly. Do you write all your programs in assembly, doing polymorphism by manually setting up virtual function tables and jumping to them with jump instructions? Or do you program in an OO language like C++ and just use its built-in polymorphism features?

    3. Re:This sounds silly ... by gstoddart · · Score: 1

      All that error-checking is necessary too, but by now, shouldn't we have high-level languages where most of that stuff is handled automatically?

      Ah ... of course ... magic unicorns make it so you can type one command, and the system will identify all possible outcomes, and properly take action for you.

      I have yet to be convinced that programming has reached the point where the language can cover all possible outcomes and do it correctly.

      You're either writing something someone else has written, or you're writing trivial stuff.

      I'm just not buying that the 95% of the code these guys claim are chaff is just saying "if we reduced code to just nouns, and magic happened so the code just did what we meant it would be awesome".

      From what I read in TFA, that just sounds like wishful thinking, and ignoring the reality about writing code -- you need to actually do something in your code, and that includes error checking. Not just "because it's magic".

      --
      Lost at C:>. Found at C.
    4. Re:This sounds silly ... by gstoddart · · Score: 1

      So you're apparently pasting part of your comment from Microsoft Word into Internet Explorer

      You're apparently stupid. Slashdot can't implement unicode, and that was pasted from the actual fucking article.

      As what is clearly a Microsoft-only jerk posting about computer programming, I can't take you seriously.

      LOL, and that confirms it ... you are a complete idiot.

      I'm about as far as you can get from being Microsoft-centric.

      But, hey, don't let reality stop you from spouting your silly bullshit.

      I leave the coding to the kiddies nowadays. But I have yet to be convinced that these magic programming languages where you don't write anything or have to do error checking actually exist, or are useful for anything real.

      Seriously, grow up, shut up, and get over your dumb self. You're not nearly as smart as you think you are.

      --
      Lost at C:>. Found at C.
    5. Re:This sounds silly ... by Anonymous Coward · · Score: 1

      "All that error-checking is necessary too, but by now, shouldn't we have high-level languages where most of that stuff is handled automatically?"

      No, we shouldn't. I can't imagine how one would write a function where I could take a single function call in absolutly all scenerios and just call
      if( isEverythingFine(data)) { //do stuff
      }

      Error checking tends to be problem specific, and if you're writing code to re-solve problems which have already been solved, you're doing it wrong. Now, if you're talking about functions to check specific errors, those already exist.

    6. Re:This sounds silly ... by Anonymous Coward · · Score: 1

      getReady. destroyHumans.

    7. Re: This sounds silly ... by Anonymous Coward · · Score: 1

      generation of underemployed Americans + social coding = heaps of verbose but redundant wrapper libraries

    8. Re:This sounds silly ... by grahamwest · · Score: 1

      I read the paper and their premise seems to be that MINSETs can be browsable/searchable and good enough to let programmers figure out whether a given function is worth investigating further. Basically they're a better replacement for text search and class browsing.

      I'm skeptical about that, especially looking at their examples, but I can't dismiss it outright. I think it might interact in a favourable way with metaprogramming techniques, whether C++ templates or Lisp macros, but that's just speculation.

      --
      Graham
    9. Re:This sounds silly ... by BarbaraHudson · · Score: 1

      Well, maybe you want to make a version that can also use a terminating character other than 0x00 (say 0x0d or 0x0a, or 0xff or whatever arbitrary value you are using). And you're too lazy to remember the difference between strlen and strnlen (or you want to avoid someone mistakenly using one for the other), so you make your own strlen that takes a pointer to the buffer, maxlen spec and parameter for the terminator.

      Or you could go crazy with c++ and use default arguments for greater flexibility.

      int strlen(char* str, int len = DEF_STRLEN_MAX, char ch = DEF_STR_TERMINAL)

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    10. Re:This sounds silly ... by Anonymous Coward · · Score: 0

      Haskell helps in this area. Function signatures can handle different data values as well as parameter counts. You'd have different a function for each error case and the main function for the core feature, all with the same function name.

    11. Re:This sounds silly ... by Grishnakh · · Score: 1

      And you're too lazy to remember the difference between strlen and strnlen

      If you're too lazy for that, you're too lazy to properly code your own version and make it as bug-free and well-tested as the standard library version. That's why we use standard libraries: there's fewer bugs when the code has been thoroughly tested by others, rather than writing your own which is bound to have new bugs.

      If you have some weird special requirement, you can just write a wrapper function to handle that, and save a lot of time.

      Finally, strnlen is just an example; that's really a pretty simple function, and probably only amounts to a handful of lines of C code. A better example might be any of countless Qt C++ classes. Should you write your own string class, or use an existing one from Qt or Boost? Writing your own is dumb. Same goes for writing your own XML parser.

    12. Re:This sounds silly ... by Anonymous Coward · · Score: 0

      Just reading the abstract, and then skimping a bit to find the methodology, the study has a fundamental flaw in the definition of the MINSET.

      While in natural language it may be true (though possibly not) that you can characterize the meaning of a sentence with a SET of lexemes, which implies the lexemes' semantics are position-independent (which it is not), the same cannot be said about algorithms.

      But suppose you somehow derive position-independent lexemes out of the position-dependent keywords of the Java language, somehow capturing data dependencies and the like into the lexemes themselves, and in that way capture the essential semantics of the code, then you define a MINSET based on those lexems.

      While you could attempt that, it's not what the study does. The study defines the MINSET as a set of *unique* lexemes, meaning without repetitions, position-independent pieces of sintax that identify functions within the set. But they make no attempt at verifying the correctness of such a metric, they just apply it blindly, without verifying that the MINSET actually represents functionality, which is what they claim, they only prove uniqueness - and only within the sample they took - and proceed to spend 75% of their paper analyzing poisoned results.

      Taking that into account, of course it's no surprise that the bigger the function the smaller the MINSET - since it will have more in common with other functions. But it does not in the least mean that all the common lexemes don't form part of the essential functionality of the code - that's a giant leap they cannot make so negligently. In fact, the most obvious sign of such a mistake is that they were forced to filter out short functions. Why? Are short functions meaningless? I have many two-liners that make up the core concepts of my code, so I beg to differ.

      Those a fatal methodology flaws. They make the whole study complete crap.

    13. Re:This sounds silly ... by BarbaraHudson · · Score: 1

      Why is it "bound" to have bugs? I've used my own versions in one multi-threaded server that's been running for more than half a decade with zero memory leaks.Got rid of the STL and rolled my own classes (actually, mostly just got rid of classes and used straight C). And yes, it included an XML parser. And don't get me started on templates.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    14. Re:This sounds silly ... by Redmancometh · · Score: 1

      "All that error-checking is necessary too, but by now, shouldn't we have high-level languages where most of that stuff is handled automatically?"

      It is handled automatically. If I do Integer.parseInt(n) where n is a string gathered from user input, and reads "122s5" it throws a numberformatexception.

      Just catch the exception and inform the user that he needs to knock that shit off. Or just let the user type a letter into that field in the first place.

    15. Re:This sounds silly ... by Grishnakh · · Score: 1

      Writing all your own stuff is simply more likely to have bugs, plus take a lot of time, rather than just reusing other libraries which are in use by countless other people and projects and have been vetted by them.

      I'm not a big fan of the STL, however. I'd much rather use Qt's classes.

    16. Re:This sounds silly ... by gstoddart · · Score: 1

      The study defines the MINSET as a set of *unique* lexemes, meaning without repetitions, position-independent pieces of sintax that identify functions within the set. But they make no attempt at verifying the correctness of such a metric

      LOL, so, essentially it generates pseudo-code from real code and throws away all the boring stuff that makes it work?

      --
      Lost at C:>. Found at C.
    17. Re:This sounds silly ... by Anonymous Coward · · Score: 0

      you just wave your hands and the computer does all the hard stuff?

      Between the improvements in SAT solvers and automated proof assistants, I think we're slowly getting there. Of course, someone still has to write the specifications, but generating certified code more or less automatically won't be out of reach forever.

    18. Re:This sounds silly ... by Anonymous Coward · · Score: 0

      Since microsoft added support for Kinect to visual studio...

    19. Re:This sounds silly ... by foreverdisillusioned · · Score: 1

      To defend your coworker here for a moment, I think he was talking about the general concepts of abstraction and DWIM (do what I mean). It is indeed true that Common Lisp and (perhaps to a slightly lesser extent) Scheme do this better than just about any other programming languages out there partially because it supports stuff like weak (actually, optionally strong) typing and first class functions long before 'modern' scripting languages popularized them, but mostly because by essentially having one single syntactic structure -- (DoThis To This Stuff) -- you are able to easily use self-analyzing and self-modifying code via macros. Since you brought up "it" in your post, I think a good and interesting example is Paul Graham's "anaphoric" macros from his book On Lisp ( http://www.paulgraham.com/onli... ) :

      Macro definition of "aif": (defmacro aif (test-form then-form &optional else-form)
      ‘(let ((it ,test-form))
      (if it ,then-form ,else-form)))

      Now, the regular if is uses an (if this then_do_this else_do_this) form. Paul's macro functions exactly as if except the word "it" is now automatically variable referring to the value returned by 'this' in the preceeding if usage example. Thus, an example usage of aif:

      (aif [really_friggin_long_to_type_and_computationally_expensive_thing] (print it) (print "null value error"))

      The "it" variable is lexically scoped only within the aif, and in Lisp variables can be "shadowed" by interior redefinitions an arbitrary number of times (basically, once you hit the relevant ")" the higher-up definition of "it" takes over once again), so you can chain together consecutive or nested aifs seemlessly. And of course you can build aands, awhiles (very useful), etc. Note that usage of macros do not result in runtime slowdowns, only (potentially) compile-time slowdowns. Also note how simple of an example this is--look at how short that macro definition was. And once you train yourself to comprehend the ()s, it's perfectly and easily readable.

      Common Lisp's generic functions (i.e. methods, except not hopelessly hobbled and limited in scope) are another good example of JustDoIt style programming. Also note that you can override the default definition of any operator/function so that, if you really felt like it, you could replace if's definition with aif.

      None of this gets you out of actually defining what "it" is in JustDoIt (you are stuck with that in any language), but if done properly this kind of flexibility and abstraction results in code that is both more readable and more modular / maintainable. And it's a fast language, DAMN fast if you know what you're doing. Faster than Java, if you turn on the proper optimizations. No need for an interpreter--most of the heavy lifting can be done at compile time.

      Just to show I'm not a total fanboy, almost all of the Lisps suffer from "good enough" syndrome and crotchety old man syndrome. The concept of M-Expressions (i.e. infix syntax, i.e. not having to use ()s all over the damn place) was abandoned because S-Expressions turned out to be so incredibly powerful. Power is good, but if you make it mandatory you jack up the learning curve unnecessarily, as well as make some things harder to read or as well as requiring more keystrokes to program... although I must say if you do pattern X more than once, you can always abstract out whatever pattern X is--just as aif abstracts out the pattern of evaluating an expression and then binding the return value to a disposable variable. That's the blessing/curse of Lisp. It's so easy for a journeyman Lisper to fix the warts in the language that no one ever fixes them in the language spec itself, and that unnecessarily scares off the noobs.

      That, and there is just way, way too much fad-ism in computer languages... of which Java's popularity is possibly the best example.

  13. Source Versus Machine Code? by Bob9113 · · Score: 4, Insightful

    Really? Are they just pointing out that source code is meant for human readability, and the actual instructions are more concise? Is anyone surprised by this? Even a quick compression test shows me 80% reduction without even removing the most obviously human-oriented stuff like comments and long variable names.

    Can I get some of this research grant money? I've got a theory about sparse matrices mostly containing zeros.

    1. Re:Source Versus Machine Code? by pz · · Score: 1

      Kolmogorov complexity.

      --

      Put my fist through my alarm clock with its ding-dong death inside my ear. - The Blackjacks.
    2. Re:Source Versus Machine Code? by Anonymous Coward · · Score: 0

      Really? Are they just pointing out that source code is meant for human readability, and the actual instructions are more concise?

      I don't see it as a critique of high-level programming. It's more a critique of too-high-level-programming. Abstracting code to classes and interfaces does not make a bad software engineer a good one. A good engineer would design the same program in C and it'd be more efficient and more intentful (sorry) without any design-pattern or OOP bullshit.

    3. Re:Source Versus Machine Code? by Anonymous Coward · · Score: 0

      Can I get some of this research grant money? I've got a theory about sparse matrices mostly containing zeros.

      LOL Now THAT's effing funny! Best chuckle today. :)

      Cheers

      P.S. It would be NULL values, wouldn't it? Not zeroes?

  14. The 90/10 law was discovered years ago by JoeyRox · · Score: 3, Insightful

    90% of the time is spent executing 10% of the code. But when something goes wrong you want that other 90% of the code to be there so that you don't l lose 100% of your work :)

    1. Re:The 90/10 law was discovered years ago by Anonymous Coward · · Score: 0

      It has always been a truism for optimizers that you spend 90% or your time in 10% of the code, and optimizers therefore tend to focus on that 10% (which is generally deep inside nested loops). This has nothing to do with anything being "fluff" or even code to deal with something going "wrong". The other 90% of the code deals with ingesting/analyzing the inputs to figure out what needs to be done and how to setup the computation. It only runs once and then lets the main processing loop chew on the work once it has been setup.

      I think the more interesting question would be: "how much dead code exists"? I ask this because of the old joke about Java: "What do you call 2 Java developers in a room together? Answer - A new framework!" Java has more "frameworks" than other other language I know. My experience with these frameworks is that they all aspire to be all things to all people, which means that for any given task, they have huge amounts of overhead that do not apply to the specific application. Hence the question of dead code.

  15. Re:Peanuts by Altus · · Score: 5, Insightful

    Yes

    --

    "In America, first you get the sugar, then you get the power, then you get the women..." -H. Simpson

  16. Waste in Housing by lordeveryman · · Score: 5, Insightful

    Did you know that only about 5% of the average house is actually load bearing? The rest is just fluff. Why are we wasting so much valuable material in houses?

    1. Re:Waste in Housing by gstoddart · · Score: 4, Funny

      So your neighbors don't have to see your junk.

      --
      Lost at C:>. Found at C.
    2. Re:Waste in Housing by HyperQuantum · · Score: 1

      And only a small part of a car is used for moving you from point A to point B. Who needs heating, windshield wipers, music, or even seats?

      --
      I am not really here right now.
  17. Not surprisingly, SOC code is mostly fluff by Anonymous Coward · · Score: 0

    After reading the article, the research looks interesting, but it also based on code written in the Summer Of Code (SOC). So is it the Java that's most of the fluff or the samples? I would venture to say you could basically get the same information out of compressing the code, or equivalently, that the technique is basically a compression technique, and that SOC code compresses better than code written by more 'expert' coders.

    1. Re:Not surprisingly, SOC code is mostly fluff by digsbo · · Score: 1

      It should be apparent to an experienced software engineer that over time, better engineering teams will reduce the fluff. That doesn't happen in a SOC project. It happens over several years of iterative development, and tightening up of requirements.

  18. The alternative by Anonymous Coward · · Score: 2, Insightful

    If every single program in the universe contains the same boilerplate strings... They are indeed unnecessary. Java is just about the worst for this. Python requires drastically less redundant meaningless fluff.

  19. Re:Dictatorial U.S. Government by JazzHarper · · Score: 1

    In answer to your off-topic questions, no and no.

  20. What will change now? by Ravaldy · · Score: 1

    I'm curious as to why this matters. When I write functions I write lots of other code that doesn't pertain specifically to the objective but is required to provide stable reusable code. E.g. Re-working the data that was input so it can fit within the mold that is the core isn't representative of what the program's objectives BUT is required to achieve the final goal. Same goes for the interface and the validation routines. They don't depict the core function of the software but are critical to the successful use of said core code.

    Am I surprised by the 5%? The answer is no. In most of my projects, lots of work goes into presentation and input validation. After all, making machine compatible with people isn't always easy.

    1. Re:What will change now? by JazzHarper · · Score: 0

      I'm surprised that it's as high as 5%. I still have visions of layers of adapter classes, which serve absolutely no purpose other than to appease Java. It's been six years since I've touched the stuff and I still have a bitter Java taste in my mouth.

    2. Re:What will change now? by Ravaldy · · Score: 1

      Was the article talking about compiler level code or IDE level code. I though they were talking IDE level code. If so 5% is ok, otherwise I'm with you.

    3. Re:What will change now? by StormReaver · · Score: 4, Insightful

      I still have visions of layers of adapter classes, which serve absolutely no purpose other than to appease Java.

      Those adapter classes exist to make interfaces with lots of methods easier to manage. I've learned and forgotten many languages over my 30 years of programming, but Java is one of those elegant languages that makes programming pleasant. The only thing I truly hate about it is the stupid memory limits imposed by its early life for applets. That one thing makes desktop programming more irritating than it needs to be.

    4. Re:What will change now? by Anonymous Coward · · Score: 0

      You can change the memory limits to something other than the defaults when working with desktop programming. I used to do that for a lot of the code our company wrote.

  21. I always new this was the case with Java by Anonymous Coward · · Score: 0

    but I am a C/C++ guy so I was seen as biased!

    1. Re:I always new this was the case with Java by hcs_$reboot · · Score: 1

      On the other hand, what makes Java powerful compared to C/C++ is its optimizer. Provided that, among other things, there's no [directly accessible/modifiable] pointer in Java, the compiler gets much more room for deep and complex optimization.

      --
      Slashdot, fix the reply notifications... You won't get away with it...
    2. Re:I always new this was the case with Java by 0123456 · · Score: 1, Insightful

      And it still runs like a pig, thanks to garbage collection, lack of unsigned types, and the need to go through Java bytecode to generate the final host code. I remember the joyous days of running software that did encryption in Java rather than calling a native library, and ran at least ten times slower than it would have in C.

    3. Re:I always new this was the case with Java by hcs_$reboot · · Score: 1

      And it still runs like a pig, thanks (...) lack of unsigned types (...)

      Not sure the lack of unsigned types shall have a huge consequence on Java performance...

      --
      Slashdot, fix the reply notifications... You won't get away with it...
    4. Re:I always new this was the case with Java by Anonymous Coward · · Score: 0

      If you need to multiply two values in the 0 to 2^64-1 range it's around a factor 4. But maybe it doesn't count as "huge consequence on performance" nowadays if it isn't more than 20 times slower...

  22. Fantastic insight into the blatantly obvious by Anonymous Coward · · Score: 0

    Now perhaps the "researchers" can tell us something that isn't totally obvious from a single glance at Java code. Extreme verbosity has always been one of its worst points.

  23. Re:Peanuts by codeButcher · · Score: 1

    No. This is what happens with a language with an extremely verbose API and extreme boiler-plate requirements. The best Java developer in the universe isn't going to be able to get around this.

    Well, arguably Project Lombok is a small but good start.

    --
    Free, as in your money being freed from the confines of your account.
  24. Boilerplate and readibility by Iamthecheese · · Score: 1

    For Java, or any other language, removing a lot of boilerplate code would drastically increase the cost of code maintenance. If there's a linked library I already know which functions it includes and I'm free to pick and choose when modifying the code. Furthermore its inclusion allows commonality between code segments.

    Of course spaghetti code is bad and plugging in arbitrary lines without understanding them tends to create spaghetti code. But what would be way worse is reducing every program to its core functionality.

    Other extra lines of code serve to make a program easier to maintain. Separating functions where you don't really have to, following some expansionary coding rules, and the like create a little inefficiency to avoid creating a good deal more inefficiency for other reasons. Then there are API's, as someone else mentioned, and comments. Good code should contain a large percentage of nonfunctional lines.

    --
    If video games influenced behavior the Pac Man generation would be eating pills and running away from their problems.
    1. Re:Boilerplate and readibility by dwpro · · Score: 1

      removing a lot of boilerplate code would drastically increase the cost of code maintenance.

      I can't disagree more with this perspective. Anything that can be considered boilerplate (I think getter/setters on properties are a perfect example of this) should have a default implied behavior and be explicitly overridden when suitable situations arises. I gain nothing from having boilerplate code taking up mental and screen real estate when there's nothing out of the ordinary about how these elements will behave in a given context.

      --
      Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. -- Susan Ertz
    2. Re:Boilerplate and readibility by Anonymous Coward · · Score: 0

      Scala is a good example of how you can eliminate most of Java's boilerplate code and write code that's elegant & almost Haiku-like in its simplicity for someone who's mastered Scala, at the cost of a STAGGERING learning curve for someone who's still learning it simply because Scala bends over backwards to leave so much implied & explicitly-unsaid.

  25. Re:Peanuts by Anrego · · Score: 2

    Indeed.

    I love Java, but not even a diehard fanboy will argue that it isn't excessively verbose and loaded with boilerplate code. The amount of code attributed to various getters, setters, and comparison methods alone often eclipses the actual functionality of a class. Not to mention doing just about anything with most Java APIs involves all kinds of intermediary wrapper objects.

  26. Most of anything is fluff by gurps_npc · · Score: 1
    Every single job I ever had, since part time summer jobs to my current job was 90% simple and 10% interesting.

    I learned how to do 90% of the work in a week, but the other 10% you never finishing learning how to do. Of course, that last 10% is the difference between a professional/expert and a rank amateur.

    I think this is due to the mental capacity of human beings. If the job is so complex you can't learn how to do most of the work quickly, then we split the job into two or more sub-jobs.

    The same guy that plants the food no longer transports it or cooks it. Why? Because those jobs have gotten so complex.

    But back to the main point, the simpler stuff may not get the applause, but it is still a large part of the work. Just because someone doesn't think that declaring the variable counts as relevant to the program, it doesn't mean it shouldn't 'count'.

    --
    excitingthingstodo.blogspot.com
  27. Zip it! by PhilHibbs · · Score: 1

    Until we can read and write in huffman encoding, that's the way programming languages will always be.

  28. Is this a Java problem? by rubypossum · · Score: 4, Informative

    It seems like the Java ecosystem is fine tuned for producing a high signal to noise ratio as far as intent of code is concerned. So much of the ecosystem stresses templates, massive IDEs and other automated tools that make the production of thousands of lines of unnecessary boilerplate incredibly easy. Besides, isn't this the nature of Java anyway? It seems like it's designed to produce the most verbose code possible in the hope that if everything is explicit more bugs can be diagnosed since the compiler has more to work with. It's almost a troll article, seriously, it's like the guy is just tryiing to piss people off.

    --
    I have a theory that the truth is never told during the nine-to-five hours. - Hunter S. Thompson
    1. Re:Is this a Java problem? by LQ · · Score: 1

      It seems like the Java ecosystem is fine tuned for producing a high signal to noise ratio as far as intent of code is concerned. So much of the ecosystem stresses templates, massive IDEs and other automated tools that make the production of thousands of lines of unnecessary boilerplate incredibly easy. Besides, isn't this the nature of Java anyway? It seems like it's designed to produce the most verbose code possible in the hope that if everything is explicit more bugs can be diagnosed since the compiler has more to work with. It's almost a troll article, seriously, it's like the guy is just tryiing to piss people off.

      I suppose you didn't read the article where it says "while this study only looked at Java code, the authors expect these finding would hold true for other languages, particularly C and C++, due to the similarities of the languages." I assume they only analysed a large body of Java code because it is easily parsed. And note they say C too, not just C++.

  29. Re:Peanuts by gstoddart · · Score: 4, Insightful

    Hmmm, I don't know MakeRocketLauncherGoNow() vs Foo() ... yeah, I think having the code read like sentences makes a lot of sense.

    If the onus is on human readability, that simple sentence is more than I've seen many coders put in comments.

    --
    Lost at C:>. Found at C.
  30. perhaps in the academic world by Anonymous Coward · · Score: 1

    Sure, I could throw out a huge amount of the java code I write.

    I could use import package.* instead of import package.classname . And for the code I'm writing I could put all of my classes in the same package and eliminate importing any of them.

    Next I could also throw out all the logging and error handling.

    There's also the ditching of the corner cases, which aren't "core functionality" either.

    But that's not exactly useful for anything other than an academic project now is it?

  31. Re:Peanuts by sycodon · · Score: 4, Insightful

    Any decent code written to be readable and maintainable has lots of "fluff". That's what makes it readable and easy to maintain.

    Much preferable to the mishmash of one line wonders that do ten different functions.

    --
    When Fascism comes to America, it will call itself Anti-Fascism, and tell you to give up your guns.
  32. Yep, figures by ugen · · Score: 1

    I am sure it depends on a chosen technology, though (partly because technology defines selected group of authors).

    This percentage would probably go up to low %20-30s in C++/Objective C and the like and well over %50 in C. Assembly would surely be virtually %100.
    I wonder what Perl or Python would get, though (probably would fare only a bit better than Java)

    Pure speculation, of course.

    1. Re:Yep, figures by Anonymous Coward · · Score: 0

      Oh wait....

      "Secondly, while this study only looked at Java code, the authors expect these finding would hold true for other languages, particularly C and C++, due to the similarities of the languages."

    2. Re:Yep, figures by Anonymous Coward · · Score: 0

      This percentage would probably go up to low %20-30s in C++/Objective C and the like

      Until you realize that string manipulation is boilerplate, as are all the hooks for unit-testing and utility functions and the like, so you're probably down to sub-5% easily;

      and well over %50 in C.

      and in addition to string manipulation, unit-testing hooks, and utility functions, you get to include your object-oriented abstractions here as well, probably pushing core functionality down below 1%.

      It's almost like you've never written programs in all of those languages listed.

  33. Re:Peanuts by arth1 · · Score: 1

    Yes

    try (this.that->matter(opinion).is())

     

  34. Re:Peanuts by Anonymous Coward · · Score: 1

    Yes we do. How many times have you fatfingered variable ll, when you meant variable l1 (or something similar).

    Making code painfully clear may not be essential to original coder, but is vital to future users and maintainers, not to mention the benefit for learners.

    So the answer is Hell Yes! we need verbose code.

  35. Re:Peanuts by Qzukk · · Score: 4, Insightful

    You forgot the MakeRocketLauncherGoNowFactory, the MakeRocketLauncherGoNowFactoryFactory, the MakeRocketLauncherGoNowException, the ...

    --
    If I have been able to see further than others, it is because I bought a pair of binoculars.
  36. Reduction by Anonymous Coward · · Score: 0

    A lot of what mathematicians do is reduction. In math, you've got the time to arrive at a formula that's elegant. Software is math; but in software, the next train wreck coming down the tracks usually runs you over before you can think about elegance. It doesn't seem too odd to me that they'd find room for reduction. Either that or they're just noticing that Java has a lot of boilerplate, in which case it's even more of a "duh!" study.

  37. Re:Peanuts by supton · · Score: 5, Insightful

    Ok, here's the deal, sometimes readability is in fact a function of how succinct something is, not how verbose it is. In human (verbal) languages and in cross-cultural communication we refer to this as high-context and low-context language. In code, a parallel could be applied. Succinctness is not a value in itself (read Paul Graham's defense of Lisp vs. Python, I disagree with Graham), but it can often be a good means to an end when context surrounding your identifier choice is clear as freakin' day.

  38. Well, not any code by Anonymous Coward · · Score: 0

    OpenSSL, for instance.

  39. Java is not written like other languages by buchner.johannes · · Score: 5, Insightful

    But contrary to python or ruby code, for example, most Java code is not written by hand. No one ever writes import statements for example. Eclipse is so excellent at understanding Java code structure that the writing efficiency is comparable. It brings other benefits too -- I have found re-factoring of large code bases is substantially easier in Java than any other language. This is thanks to the strong structure implied by the language, which can be exploited by tools. In other languages this is prohibited, e.g. Ruby, where every word can mean something different and you can not know until runtime, or C when cluttered with macros.

    --
    NB: The message above might reflect my opinion right now, but not necessarily tomorrow or next year.
    1. Re:Java is not written like other languages by Anonymous Coward · · Score: 0

      Try Visual Studio and C#... I developed on Java until I realized that I am 20-30% more productive when using a better IDE, better package architecture (Nuget), and a more maintained language programming language with a smaller amount of quirks

    2. Re:Java is not written like other languages by Albertosaurus · · Score: 1

      It's not the writing that's the problem. It's having to read 10K lines of boilerplate. Know any IDE's that'll automate that for me?

    3. Re:Java is not written like other languages by BitZtream · · Score: 0, Troll

      better package architecture (Nuget)

      Just for reference, by saying this, you've made it clear you don't have much experience.

      The problem you kids have as developers is that you think using package managers to download and do the dirty work automatically for you is a good thing.

      Its not until you cost a business a bunch of money because your package manager did a bunch of stupid crap, or they deleted the version you're using and dependent on that you learn why the rest of us don't. Occasionally a developer will figure it out after they realize they spend 80% of their time updating their project to match changes to the constantly updating packages they depend on rather than using one thats known to work reliably and sticking with it.

      I won't even go into the fact that you think code completion makes you a better developer while ignoring that you don't actually know what the methods you use do because you never bothered to look at the documentation for them ... you just happened to notice a name that looked like what you wanted. God, dealing with developers like that has cost me ridiculous amounts of time in my career, and while code completion can be useful to a skilled developer, for the other 99.999999% of developers, its way more of a problem than any benefit that comes out of it.

      In short, your post just shows that you're a newb.

      --
      Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
    4. Re:Java is not written like other languages by Anonymous Coward · · Score: 0

      Competent developers use automated testing and CI to figure out if a package upgrade broke your system. They also build on top of other people's work and keep up with the strategic vision of other projects. Maybe you should try SOLID, CI, and unit testing in the company you work for and the new be software developers will become competent software developers and your projects will not break all the team.. (The same guy you are bashing for lack of competence)

    5. Re:Java is not written like other languages by puzzled_decoy · · Score: 2

      Wow.... this is way overboard in the other direction.

      There is nothing inherently wrong with package managers, the problem is their misuse. You can specify a required version, lock a package, auto-update packages, whatever with any decent package manager. Your problem isn't with the package manager, it's with the people who don't know what they're doing.

      And code completion is fantastic! Not only can I use it to find the usable methods names I can't quite remember, but I can actually attach docs to them. That's right, when code completion comes up I can easily read the associated documentation.

      Look, there are a lot of developers who don't really know what they're doing. Your beef is with them, not with the available tools. Having good tools and knowing how to use them is one of the essential parts of being a developer- and this includes package managers and code completion.

    6. Re:Java is not written like other languages by Anonymous Coward · · Score: 0

      "Its not until you cost a business a bunch of money"

      REALLY in your organization mistakes like that can propogate so far without detection and repair?

      So in other words you don't have much AT ALL in the way of quality control.

      "In short, your post just shows that you're a newb."

    7. Re:Java is not written like other languages by psyclone · · Score: 1
      IntelliJ IDEA is even better. I don't even look at import statements anymore or even think about what libraries I'm using.

      If you copy/paste some code from another class, all the dependencies are added automatically to the new class.

      Even adding a new library to a Maven project is trivial in IntelliJ. You just start typing the name in the pom and a list of libraries and versions pop up, defaulting to the most recent stable release.

      Getter/Setter/Constructor/toString/equals/hashcode -- they're all auto-generated for you as needed.

      It is annoying that all this "fluff" exists in the language, but a good IDE hides it; getters/setters are collapsed to a single line; import statements hidden by default, endless customization in how your code looks so you can ignore the fluff and focus on the important stuff.

    8. Re:Java is not written like other languages by Anonymous Coward · · Score: 0

      It is funny that you are citing my comment without allowing my posts.. yet I am sure, that your dev shop needs to get out of the stone age and get some unit testing and CI in place to avoid that newb problem you got hurt by. It was not the newb that created that problem.

      ATTN Meta-moderator:
      I had a chance to click on BitZtream non-anonymous user name and read old comments calling a bunch of people idiots. Can you address this hateful gentlemen? Mommy.. mommy, help me... offensive incompetent should-be-fired software development micro-manager moderating my comments for using Nuget instead of upgrading external components by hand to patch component bugs.

    9. Re:Java is not written like other languages by buchner.johannes · · Score: 1

      All of the features you mention are present in Eclipse. But whether you use IntelliJ IDEA or Eclipse, it does not matter to me. The killer feature on Eclipse, for me at least, is Mylyn.

      --
      NB: The message above might reflect my opinion right now, but not necessarily tomorrow or next year.
    10. Re:Java is not written like other languages by phantomfive · · Score: 1

      better package architecture (Nuget),

      Ha! Your post was actually believable up to there.

      --
      "First they came for the slanderers and i said nothing."
    11. Re:Java is not written like other languages by BlackPignouf · · Score: 1

      That.
      I'm a Ruby programmer, but had to begin working on a Java project last year.
      As a Vim user, I was just horrified at the amount of "Bar bar = foo.getBar();" I had to write by hand.
      I began to use Eclipse (with Vrapper) and suddenly everything was less painful.
      When I code Ruby with Vim now, I'm surprised when I change a method and don't see red markers appear in my code.

    12. Re:Java is not written like other languages by Anonymous Coward · · Score: 0

      Plus code completion removes the temptation to use.... abrupt?.. names. I now have a tendency to use fairly long method names like DoSomethingLikeThisToThat rather than DSLTTT. Makes the code much more readable at a glance. Same with local variables, gone are the days when you saw loads of single or double letter names, now we can use more verbose identifies without any major RSI worries.

      HUZZAH!

    13. Re:Java is not written like other languages by delt0r · · Score: 1

      I was under the impression that such tools exist for most programming languages.

      --
      If information wants to be free, why does my internet connection cost so much?
    14. Re:Java is not written like other languages by swilver · · Score: 1

      You read the boilerplate? Damn...

    15. Re:Java is not written like other languages by swilver · · Score: 1

      ...or the GIT integration... which is miles ahead of what IDEA offers.

    16. Re:Java is not written like other languages by swilver · · Score: 1

      No, they don't.

      The program language has to be suited for such tools. The better you can reason about a language the better these tools can be, and Java really nailed that one. That's why you can refactor large code bases with it and have some level of confidence that you didn't break something.

    17. Re:Java is not written like other languages by rdnetto · · Score: 1

      But contrary to python or ruby code, for example, most Java code is not written by hand.

      If most of the code is generated, then the language is broken - the generation should be integrated into the compiler, so as to both formalize the rules of generation, and also to reduce the amount of code that needs to be read when debugging. A good example of this is the property syntax in C# - you can just define it as {get; set;} and the compiler fills in the boiler-plate. Even C's macros are superior to the Java approach of just dumping the generated code among the rest of the source.

      --
      Most human behaviour can be explained in terms of identity.
  40. Re:Peanuts by msauve · · Score: 1

    10 PRINT "HAVE YOU TRIED BASIC?"
    20 INPUT $X
    30 IF $X <> "YES" GOTO 50
    40 PRINT "WHY AREN'T YOU USING IT?"
    50 PRINT "YOU SHOULD, IT HAS NO LIBRARIES AND SHORT KEYWORDS."
    60 END

    --
    "National Security is the chief cause of national insecurity." - Celine's First Law
  41. Re:Peanuts by Anonymous Coward · · Score: 0

    I'd seriously argue the opposite is true.

    Huge god classes and omni-functions are what you get from people who just need it to pass the test / quick inspection and don't care about reliability or ongoing maintenance. Well written code should be a bunch of small encapsulated bits that build on each other rather than gigantic doAllTheThingsNowBecauseTheButtonWasClicked() methods.

    Oh, you mean what the knuckle dragging functional programmer produces? I'm a C programmer of days gone by and I can tell you that I sometimes long for the day when all this OO inheritance, hexarchy stuff coupled with the various design patterns would just GO AWAY! Not that I don't see it's purpose, but because most of the implementations I've seen in real programs are all about dealing with the exceptions and gotchas created by the ill conceived designs that where poorly implemented. Then you start in with all the enforcing of OO concepts in languages like Java and lord howdy you get some real garbage.

  42. Re:New research find's water wet by popo · · Score: 5, Insightful

    Yes, but the point is silly anyway.

    The notion that everything that isn't core functionality is "fluff", gives the impression that it is non-essential.

    Let's say I have a weather application that reports meteorological data for a specific zipcode. Let's say that I have a super slick user interface, and I display animated weather graphics in HD.

    Fluff?

    Not at all. A spartan application which displayed a bunch of plaintext data might have zero downloads. Sexy, eye candy might equate to 20 million downloads.

    Which raises the question: What is the actual point of this app? Is it to display weather information?

    No. The point of this app is to get downloaded.

    So what's "core" again?

    --
    ------ The best brain training is now totally free : )
  43. Obvious headlines are increasingly obvious by Anonymous Coward · · Score: 0

    This might be slightly off-topic, and if you actually RTFA it's significantly deeper than the headline, but of late (as in, for a couple of years) it seems a lot of software-related research just points out things that when distilled to a few lines are blatantly obvious to anyone in the field.

    This week alone, this is the fourth time I've seen a paper mentioned where this was the case, and I don't work or have anything to do with academia. This one isn't quite as bad as the following example, though:

    Yesterday I encountered two separate PhD research papers (they were a year old already, though) covering Wi-Fi security that I gave a read front to back. Both of them stated nothing new that anyone working in-depth with Wi-Fi wouldn't know, and the core points of the papers were already clearly documented by others (though not academics...) long before these researchers came around.

    I am just a lowly engineer without a PhD and who has never published anything, but the more I encounter these things, the more I feel a lot of the academics in computer science are just prettifying the rather obvious into paper format, without adding anything new, just for the sake of claiming academic prowess. Yes, I have met people who have proclaimed superiority due to their published papers, and when you read those papers you can only go "no shit, sherlock".

    People will be people, of course - I also know someone with a PhD in ethics who got through college being paid for getting into other people's email accounts, for example - but I've never had this "academics are bloody useless" feeling with any other field (though I am obviously less versed in those other fields, so maybe I just don't realize it).

  44. 95% of research is fluff, research shows by engineerErrant · · Score: 2

    This sounds like the same hand-wavy BS that spawned our current infestation of Agile consultants.

    They aren't even trying to be scientific here; this is just baldfaced click-bait, likely commissioned by some unproductive company who wants to look like a "thought leader." What are they even defining as "wheat" and "chaff"? Who decides which lines of code are which? Who decides who gets to decide that? What does it even mean to describe what code "does"?

    Smart people can disagree about best practices and what constitutes "good" code - ultimately, I think most of it boils down to personal taste rather than any notion of objective correctness or big-picture productivity. Personally, I feel most productive in Java - but that's because of an interlocking mesh of many subtle reasons and has nothing to do with how many bytes my code files take up.

    1. Re:95% of research is fluff, research shows by Anonymous Coward · · Score: 0

      I've seen enough developers who seem to think that Spring and Hibernate are necessary to write HelloWorld(). I'm sure the percentages are pulled out of the air but the point is valid.

  45. Absurd thesis by kcwhitta · · Score: 1

    The original paper is here: http://arxiv.org/pdf/1502.0141... What they effectively do is create a set of all the tokens and punctuation in a method and then compress that set to include only those tokens that are "useful". They then compare the length of this set with the original method. I don't see how this is any more useful than compiling the method, looking at its bytes, and stating this method is mostly chaff since it can be reduced into a single 0 and 1, i.e. its BINSET is {0, 1}.

    An example threshed set they provide for java bubblesort is: int, length, =, array, ., for, (, 1, 0, , ;, if, ++, ), {, [, j, 1, ., |, ], temp, }. If you're a programmer, you can probably see how silly this is just from looking at that set.

    1. Re:Absurd thesis by Qzukk · · Score: 1

      That is absolutely absurd! How can they measure the fluffiness if they don't even bother considering all the XML required to get hello world to work in [insert Java framework here]?

      --
      If I have been able to see further than others, it is because I bought a pair of binoculars.
    2. Re:Absurd thesis by Megane · · Score: 1

      Any regular reader of thedailywtf.com would also include the support classes like BubbleSortFactory, BubbleSortFactoryFactory, automated testing support, etc. Who needs regular fluffy when you can have enterprisey fluffy!

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
  46. Re:Peanuts by phantomfive · · Score: 4, Insightful

    Any decent code written to be readable and maintainable has lots of "fluff". That's what makes it readable and easy to maintain.

    In my experience with real-life code bases, the more 'fluff,' the less readable and harder to maintain it becomes. If your hypothetical example of the on-line wonder has a problem, it is easy to rewrite. If a thousand-line program has a problem, it's harder to replace, even if (especially if?) it used many design patterns.

    My point there is, the more lines of code you have, the harder it is to maintain. I don't think that's controversial.

    Flexibility and maintainability come from well-defined interfaces between sections of code. It doesn't come from adding fluff.

    --
    "First they came for the slanderers and i said nothing."
  47. Re:Peanuts by Anonymous Coward · · Score: 0

    This is what happens when you replace talented coders with some H1-B visa shithead that is payed a few shekels a week.

    Ok hotshot, show us your non verbose Java program.

  48. Re:Peanuts by CosaNostra+Pizza+Inc · · Score: 2

    Yes, if you want your code to be human readable and self-documenting. If you want something with little or no fluff, maybe go the assembly language route?

  49. Not really the problem with Java by swan5566 · · Score: 1

    Really it is a culture who have been mining in a pit for so long that they reason that getting to China is the easiest way out. They might be right.

    --
    In debates about Christianity, there are two groups: those looking for answers, and those looking to just ask questions.
  50. Re:Peanuts by wonkey_monkey · · Score: 1

    You should have added a semicolon to one of the PRINT lines, just to confuse people.

    --
    systemd is Roko's Basilisk.
  51. A new without a delete? by Sowelu · · Score: 1

    Even comments about C++ have memory leaks.

  52. "Fluff" by Anonymous Coward · · Score: 0

    Why don't these idiot researchers analyze how much fluff is in assembly code.

  53. Re:Peanuts by angel'o'sphere · · Score: 3, Insightful

    You don't need (and no one does do it) a RocketLauncherFactory if you only have one RocketLauncher type.

    However such a Factory is quite useful if you happen to find a 'rocket' used in 'rocket launchers' and you need either an instance or a description of a launcher that actually can use that rocket.

    Also factories are quite interesting as you can sent them usually 'orders'. That means if you order a few rocket launchers you can make sure when you unwrap them, that there is an assorted set of ammunition in the case as well.

    But if you hate Factories and Exceptions ... no one can help you.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  54. Re:New research find's water wet by plopez · · Score: 2

    I wouldn't call all of that eye candy. Dynamic graphics can display a huge amount of information really quickly. Your example, ironically, is where 'eye candy' is really useful.

    --
    putting the 'B' in LGBTQ+
  55. Your Java Code Is Mostly Fluff by hcs_$reboot · · Score: 1

    Your Java Code Is Mostly Fluff

    Nope. Not mine. Coming from C and C++, I know what I'm doing.

    --
    Slashdot, fix the reply notifications... You won't get away with it...
  56. Java's purposely verbose by Sarusa · · Score: 1

    The purpose of java is to keep legions of mediocre corporate coders from doing too much damage to each other, and it does pretty good at that. Tediously spelling everything out is one way to try to force some context for code you don't see often. Think COBOL.

  57. Re:Peanuts by Anonymous Coward · · Score: 0

    Verbocity is a small problem for someone writing code initially. Almost entirely mitigated by a decent IDE.

    On the other hand, excessive terseness is a HUGE problem for a different person trying to modify that code later or interact with it.

    You've heard the joke about Perl haven't you? A write-only language?

  58. commentFactory by Anonymous Coward · · Score: 0

    http://docs.spring.io/spring/docs/2.5.x/api/org/springframework/aop/config/SimpleBeanFactoryAwareAspectInstanceFactory.html

    Sample line of code using this:

    RootBeanDefinition aspectFactoryDef=new RootBeanDefinition(SimpleBeanFactoryAwareAspectInstanceFactory.class);

  59. Well... by bradley13 · · Score: 1

    Three things:

    - First, Java is needlessly wordy - consider the necessity of explicity writing getters/setters for any class where you want access control. What a pile of code for nothing.

    - Second, you can write cryptic code or you can write understandable code. Understandable code involves a few more newlines, so what?

    - Lastly, depending on your developers, yes, you can have overly long code. Someone who re-implements the same functionality 10 times instead of defining an abstract class and implementing it once - such developers exist. if you have one in your team, I do feel sorry for you. How prevalent is this? No idea...

    Of course, TFA wasn't really about any of this. It is about a semantic analysis that determines the number of unique concepts in a method, reducing it to a "minset" which is no longer executable. This is an interesting theoretical analysis, but doesn't have a lot to do with real programs designed to actually perform actions with those concepts. Some methods are wordy because you want them to be clear, others are wordy because of what you are doing, and still others are wordy because of characteristics of the language you are working in.

    --
    Enjoy life! This is not a dress rehearsal.
    1. Re:Well... by david_thornley · · Score: 1

      Will people get over this desire to have getters and setters all over the place? Write public member functions for what the class should be doing, not what it consists of.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  60. Waste of research time and money. by Narcocide · · Score: 1

    Well, I could have told you this for free. I think in some cases, particularly legacy codebases, 5% is pretty generous too.

  61. Fluff piece makes readers overlook core point by Anonymous Coward · · Score: 2, Interesting

    Well, no. They're doing none of that.

    From a quick skim through the paper, they more or less conclude that java program text compresses really well, since it's full of redundancy, scaffolding, and so on, and so forth. I'd say they need quite a few words to beat around the bush and imagine all sorts of more or less related things, but this is the core of their findings.

    This finding is fairly obvious since well-known, certainly compared to certain other languages, but now in some light science sauce made with questionable methodology. That last bit again from skimming.

    The piece written around it is equally fluffy and even the things mentioned to "improve" on this mostly involve writing more code, of which we already have a lot containing a large percentage of this "chaff".

    The real question is whether or not this scaffolding is a waste of time. One might say obviously yes, yet the market says no:

    There's a large market for (mediocre and therefore easily replacable) java programmers, and by extension a lot of money in grinding out this scaffolding, since without java programs are not complete and therefore won't do anything.

    Another point: There is also a large market for PHP "programmers" grinding out excreable code in an excreable language, with lots of padding to make up for obvious deficiencies in the fabric of the language -- as in PHP such things are very rarely the result of deliberate design choices, as they not unlikely are in java, instead usually the result of some incompetent code contributor missing a point or other while adding yet another misfit misfeature.

    There are other languages around that more easily facilitate much more concise code (such as lisp, mentioned as 'List' in the paper) but those aren't half as popular.

    Thus, if there is wisdom in markets and crowds, then this chaff must add some desirable property to the services of (mediocre) programmers. Therefore, the obvious follow-up on noting that this here programming language is rather verbose, the search for expressivity, is not something the market puts a premium on.

    IMO these people were having a good time crunching source in some number crunching tool and are mostly in search of more funding. This too is not unusual in that environment. IOW, dime-a-dozen study trotting out a well-known fact for great funding. What else is new in academia?

  62. Re:New research find's water wet by fustakrakich · · Score: 0

    I think they are saying is that most of the code is really comments and should be marked as such. In other words, your weather app doesn't need to contain Shakespeare or Tolstoy to function, even with a pretty face. Though it would be interesting to hear it lament the dark and stormy night.

    --
    “He’s not deformed, he’s just drunk!”
  63. Re:Peanuts by angel'o'sphere · · Score: 4, Insightful

    Why are people always brining up the die hard fanboy argument?

    The least thing to say about it: it is un polite! What do you expect me now to answer? As a non fan boy but serious java developer I have to say ...???

    Sorry, I don't have to need to defend myself all the time why I use a certain thing.

    I use a Mac, for good reasons. I use an iPhone for other good reasons. I use Java, but I also use C++, I don't use C, for good reasons.

    And after 35 years in the industry I can tell you: I'm very disappointed. The stuff that rules the world is run by marketing. Not by fan boys.

    Not to mention doing just about anything with most Java APIs involves all kinds of intermediary wrapper objects. That is complete nonsense.

    Starting a post with a general insult and then making a wrong claim is poor sportsmanship imho.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  64. Re:Peanuts by msauve · · Score: 1

    Assembly has all those mnemonics and equates and macros and directives. ITYM machine language.

    --
    "National Security is the chief cause of national insecurity." - Celine's First Law
  65. To quote Bob Fitch... by ehud42 · · Score: 2

    "all programs can be optimized, and all programs have bugs; therefore all programs can be optimized to one line that doesn't work"

    --
    I'm in my right mind and I have the answer to everything!
  66. Re:Peanuts by wisnoskij · · Score: 1

    This, of course it is only 5%. IT is easy for a program to write code with 0 white space, and variable/function names that go like this (a, b, ...., a0, a1, a2, ....). But People should NEVER write code like that. Yes I would save you at least 95% of the disk space it would otherwise use up, but no one would ever be able to debug or change, or add anything to the code. And it would simple never even work, you would never get a finished working program.

    --
    Troll is not a replacement for I disagree.
  67. Obligatory SOTI by Anonymous Coward · · Score: 0

    http://www.somethingofthatilk.com/index.php?id=135

    'nuff said.

  68. Re:Peanuts by Anonymous Coward · · Score: 0

    Sure for morons like you that should be janitors and not let near keyboards.

  69. "tossed out simple methods" Bzzt. Wrong. by Anonymous Coward · · Score: 0

    If I break my core functionality down into simple methods ( less than 50 tokens ), as one is meant to, then their silly method will toss those methods out, so it is ignoring my core functionality and measuring nothing.

    FFS.

  70. Re:Peanuts by Anonymous Coward · · Score: 0

    Please don't complain about verboseness and boilerplate until you've used Ada. The need to constantly cast from an access type to an Instance to an access type to an Instance'Class, or vice versa, depending on what one function returns and another function needs as a parameter, is maddening!

  71. Re:Peanuts by firewrought · · Score: 3, Insightful

    Most of the "modern" languages seem to have this addiction to overly verbose libraries and obscenely long syntax. Do we really need method names that could constitute a simple sentence?

    Long names are fine and even valuable. The real gremlin is in overly-abstracted API's, code generators, verbose XML configuration files, and other tools/libraries that have sacrificed usability while pursuing long feature lists and total control over a particular problem domain.

    It is, in a funny way, the opposite usability trajectory that Gnome and many others in the UX crowd followed when they went off and started zealously reducing features in the name of simplicity.

    Personally, I think that the underlying design principles should be the same whether you're designing application interfaces to be used by the general public or whether you're designing API's to be used by developers: in both cases you're trying to take something complicated and make it simpler. Sure, add those new/advanced features when you can, but do so in a way that doesn't raise the learning curve for the most common use cases.

    --
    -1, Too Many Layers Of Abstraction
  72. Re:Peanuts by Anonymous Coward · · Score: 0

    Hmmm, I don't know MakeRocketLauncherGoNow() vs Foo() ... yeah, I think having the code read like sentences makes a lot of sense.

    If the onus is on human readability, that simple sentence is more than I've seen many coders put in comments.

    Agreed, and all non-local variables should be named likewise, e.g., $imageCounter v. $ic. I have been coding for more than tweny years and you learn to name things according to what they do and not random strings of letters, because even you may have to go back and edit the code several years later and if things aren't coherent and easy to follow you'll end up spending a longer amount of time fixing or extending code than if you used sensible names for functions and variables.

    Before someone says, "It takes too long to type longer names," the answer is yes, the first time you type it, but copying and pasting long names takes just as long as it does for short names; or autocomplete if you have a good IDE. Give me a break! Don't be a dumbass coder. If you aren't going to document well or comment worth a damn, then you better use decriptive names.

  73. That's interesting, if primarily useless by mhkohne · · Score: 1

    The first response to this kind of it is 'So what?'. They made up a metric and found that in Java it's 5%. Whoop. They didn't even examine any other languages to see if the metric varies (if they had, perhaps it would be in someway interesting, though I doubt it would be particularly enlightening.)

    There's nothing you can do with this information. Total waste of time.

    --
    A thousand pounds of wood moving at 300 feet per minute. Don't get in the way.
  74. apply tags by Anonymous Coward · · Score: 1

    ALL SHALL SEE ME AND DESPAIR

  75. Re:Peanuts by codealot · · Score: 2

    Your claim smacks of hyperbole, but that aside I've also had to use code from developers who like to name their methods x(), f1(), t2() you get the idea. I can't tell if they're too lazy to type more than that, or they are striving to make all code fit in a 40-column window (ala GW-Basic), or they hate the idea that anyone else would ever try to read and comprehend their code.

    There's got to be a nice balance.

  76. Accidental Complexity by ryan.onsrc · · Score: 1

    This is old news folks.

    Frederick P. Brooks Jr. wrote an excellent paper (No Silver Bullet: Essence and Accidents of Software Engineering) back in 1987 (link: http://www.cs.nott.ac.uk/~cah/...) that highlights how so much of the complexity that exists in software is *accidental*. This problem is in no way specific to Java, but the language and the supporting eco-system of conventions, libraries and the various supporting "enterprise" tools certainly contribute to the situation. As a language that champions OOP (note: the paper calls out OOP specifically), it makes sense that Java's mainstream-status would lend itself towards being a poster-child for Accidental complexity.

    Having worked in the software industry, on various Java code bases, for the past decade: I have observed this curious phenomenon first-hand, repeatedly. It really is quite unfortunate, as it is very possible to write elegant, and concise Java code: one simply has to adopt a more functional programming style and limit mutability within their code. The problem is: most Java developers who appreciate the value of functional programming and immutable design, have already moved on to other languages that have a syntax, standard library and an eco-system that is centered around these principles. I've moved on to Scala largely for this very reason: I grew tired of spending an hour frantically searching through a mountain of convoluted procedural code and XML configs: just to to see why a boolean flag I set was not "seen" by a particular class method.

    1. Re:Accidental Complexity by Anonymous Coward · · Score: 0

      lunchbox.burrito

    2. Re:Accidental Complexity by ryan.onsrc · · Score: 1

      At first I was dismayed at how my comment was getting no love ... but then sure enough ... :-)

  77. Contrast with Perl by Anonymous Coward · · Score: 0

    Which is supremely expressive, but ends up looking like line noise an hour after you write it.

    1. Re:Contrast with Perl by Mike · · Score: 1

      So Java is 95% crap, and Perl is 100% delicious. I can go along with that.

      Besides, the only Perl code I've seen that looks like line noise were the winners of the Obfuscated Perl Contest(s).

      Well-written Perl code does not, unless you're shortsighted enough to look down upon the extremely useful and important variable sigils.

    2. Re:Contrast with Perl by macpacheco · · Score: 1

      I'm more of a Python guy myself, but the big issue with both, is there's no standard for browser side python or perl. We need that to hope those get rid of java. Python and/or perl on the server side, easy.

  78. Re: Peanuts by Anonymous Coward · · Score: 0

    Well said. The code is to the largest part for the human not the computer or the compiler.

  79. Re:Dictatorial U.S. Government by Anonymous Coward · · Score: 0

    I've tried contacting as many law firms as possible but none would take my case.

    You are a liar and a spammer. Please rot.

  80. Re:New research find's water wet by Anonymous Coward · · Score: 0

    Actually, I don't think they're talking about comments. They even concede that the 95% of the "chaff" is "required to make the code run". So that doesn't sound like comments.

  81. Congradulations! by Anonymous Coward · · Score: 0

    The researchers from UC David et al officially win the No Shit Award!

  82. Meh by Anonymous Coward · · Score: 0

    I'm not sure anyone is surprised. Most people have been saying this for years... even Java "experts"

  83. Re:Peanuts by Anonymous Coward · · Score: 0

    Because You have to type them. Not whole method name, but sometimes a part of it. And read them, too. It really taxes my eyes to read a long method name over and over again.

  84. 95% of Java code is fluff, so... by edxwelch · · Score: 1

    can we say that 95% Java coders are fluffers?

  85. UI code is bulky by tambo · · Score: 1

    PKZIP.EXE and PKUNZIP.EXE, together, are about 80 kilobytes.

    The current version of WinZip for Mac is 26 megabytes, or 26,000 kilobytes. That's a 32,500% size increase for the same basic functionality.

    However, I don't see a lot of people preferring the command-line versions. Why? Because it's easier to drag-and-drop a bunch of files into a dialog box and select an output location and folder, than to type all of that crap into the command line WITH the right flags AND no typos.

    Things like menus, options / configuration panes, and nicely formatted help documentation are also preferable to "pkunzip.exe -?", and then remembering that you have to pipe the output to MORE in order to read the six pages of help text spewed out to your terminal window.

    UI code is bulky, because it's extraordinarily detail-oriented. Think of all of the operations that your application UI has to support: windows, and resizing, and hotkeys, and scrolling, and drag-and-drop, and accessibility features and visual themes and variable text sizes and multithreaded event loops and asynchronous event handlers and standard file dialogs and child window Z-ordering and printing and saving application configuration info... etc.

    If our IDEs didn't include visual UI designers and auto-generate like 99% of that code for us, app development would be horribly stunted AND much more preoccupied with hunting down bugs in UI code.

    But all of this UI code is bulky and verbose and nitpicky because the UI is extremely important for any modern app. Thousands of apps exist that feature excellent functionality that is impossible or painful to utilize because the UI sucks.

    --
    Computer over. Virus = very yes.
    1. Re:UI code is bulky by 0123456 · · Score: 1

      UI code is bulky, because it's extraordinarily detail-oriented. Think of all of the operations that your application UI has to support: windows, and resizing, and hotkeys, and scrolling, and drag-and-drop, and accessibility features and visual themes and variable text sizes and multithreaded event loops and asynchronous event handlers and standard file dialogs and child window Z-ordering and printing and saving application configuration info... etc.

      Is that really 28MB of code, or is that 1MB of code and 27MB of bitmaps, sound files, and other crud?

    2. Re:UI code is bulky by tambo · · Score: 1

      > Is that really 28MB of code, or is that 1MB of code and 27MB of bitmaps, sound files, and other crud?

      That's true - media resources are bulky, and thanks to plentiful storage and bandwidth, we don't have nearly the pressure to constrain these sizes that we did in 2000.

      However, if you review just the code base for Winzip, I can guarantee that well over 95% of it is UI code as I mentioned above, and much less than 5% of it is the actual data compression/decompression "core functionality."

      Here's another example: Media rendering. The actual codec for DVD media is tiny - DeCSS can be printed on a T-shirt! - and the entire source code package for the LAME MP3 codec is like one megabyte - but media rendering apps tend to be huge. And I'm not even talking about bloated monoliths like iTunes; VLC is pretty stripped-down, and it's still 33 megabytes. The logic that it needs to *show* you the decoded video in a proper UI is extensive.

      --
      Computer over. Virus = very yes.
    3. Re:UI code is bulky by drinkypoo · · Score: 1

      Here's another example: Media rendering. The actual codec for DVD media is tiny - DeCSS can be printed on a T-shirt!

      No. That's just the DRM. DVDs are MPEG2 streams. You will find that an MPEG2 decoder is substantially more complex than DeCSS.

      VLC is pretty stripped-down, and it's still 33 megabytes. The logic that it needs to *show* you the decoded video in a proper UI is extensive.

      VLC is the opposite of pretty stripped-down. It does everything, including ripping DVDs and transcoding video.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    4. Re:UI code is bulky by tambo · · Score: 1

      > You will find that an MPEG2 decoder is substantially more complex than DeCSS.

      First, "complexity" and "size" are completely different concepts, and we're only discussing codebase size here. Of course, extremely complex code can be very small (see also: MD5, RSA, etc.), and extremely bulky code can be very routine. The auto-generated code for instantiating all of the controls in a window can be thousands of lines long, but they're very bland and mundane instructions. ("Create a button at coordinates x1, x2, y1, y2; set its border, background color, font, and caption; hook it up to these event handlers...")

      But just to reinforce the point: Here is a full MPEG 2 decoder. It's about 130kb, uncompressed.

      VLC is the opposite of pretty stripped-down. It does everything, including ripping DVDs and transcoding video.

      First, it's certainly stripped-down as compared with other media rendering packages: Windows Media Player, WinDVD / PowerDVD, and of course iTunes.

      Second, those features - ripping DVDs and transcoding videos - are not only expected in modern media player packages; they also utilize the same set of core functionality. Just like ordinary playing, ripping and transcoding are basically uses of the output of the codec - the software is just delivering the codec output somewhere other than the screen, like to a storage device, or as the input to a different codec.

      --
      Computer over. Virus = very yes.
  86. Re:Peanuts by Anonymous Coward · · Score: 0

    MULTIPLY cobol BY verbosity GIVING verbosity-in-cobol-sucks.

  87. Re:Peanuts by bugs2squash · · Score: 2

    My complaint about perl (and for that matter clojure too now) is that so many symbols have special meaning. and sometimes it is context dependent too. If your code contains $#`'~_ all over the place it makes it hard to read for anyone not intimately familiar with it. Sure, there are some well used conventions like _ for anything or triangle brackets for collections of types, but there comes a point where using a symbol to convey really important and subtle meaning is far harder to read than just putting in a keyword. All I can say is thank god Unicode was not invented earlier or there woudl have been 1000s of other characters involved.

    --
    Nullius in verba
  88. Re:Peanuts by Anonymous Coward · · Score: 0

    Yes

    1

  89. Re:Peanuts by Anonymous Coward · · Score: 0

    Programming isn't a dick measuring contest whereby the largest dick is indicated by the code that requires the most fore-knowledge to understand. I would hate to work with you, or after you, because I'm sure you write terrible code that you're convinced is uber elite.

  90. 5% captures functionality, 95% makes it functional by tentative · · Score: 1

    You can probably guess what a *correct* code does from 5% of it. But the other 95% are very much needed for those 5% to actually do that correctly.

  91. Functional Shakespeare by netsavior · · Score: 2

    These violent delights have violent ends
    And in their triump die, like fire and powder
    Which, as they kiss, consume

    ->
    Boy meets the wrong girl, they die for love.

    ->
    Boy, girl, dead.

    ->
    people.forEach(die)


    I mean, sure it gets the job done, but man, might as well just pay someone in India to write and read it.

  92. Re:New research find's water wet by jd2112 · · Score: 1, Troll

    Yes, but the point is silly anyway.

    The notion that everything that isn't core functionality is "fluff", gives the impression that it is non-essential.

    Let's say I have a weather application that reports meteorological data for a specific zipcode. Let's say that I have a super slick user interface, and I display animated weather graphics in HD.

    Fluff?

    Not at all. A spartan application which displayed a bunch of plaintext data might have zero downloads. Sexy, eye candy might equate to 20 million downloads.

    Which raises the question: What is the actual point of this app? Is it to display weather information?

    No. The point of this app is to get downloaded.

    So what's "core" again?

    No, the point of the app is to display adds to the user.

    --
    Any insufficiently advanced magic is indistinguishable from technology.
  93. Re:Peanuts by Anonymous Coward · · Score: 0

    If your hypothetical example of the on-line wonder has a problem, it is easy to rewrite.

    Not necessarily true. What if that one liner is difficult to understand? What if it has subtle behavior that your rewrite has to replicate, but doesn't because, say, it was originally implemented by a tiny 1 character sub-clause of a 300 character regular expression?

    Obviously having too much over-engineered fluff has its own issues when something simpler should have been used. Can't we at least agree that there's a middle ground? Only a sith deals in absolutes.

  94. Re:Peanuts by shoor · · Score: 1

    'having the code read like sentences' was one of the goals of COBOL wasn't it?

    I studied COBOL in college, and the best Professor in the Department was a big fan, but I rememder it as being generally perceived as 'uncool'. (And I was the guy who, when given a choice of which language to write a project in, would write it in Univac 1100 assembler. This was before 'C' became widely known or implemented.)

    --
    In theory, theory and practice are the same; in practice they're different. (Yogi Berra & A. Einstein)
  95. Re:Peanuts by xfade551 · · Score: 1, Redundant

    This is Java we're talking about... we're looking at com.Vendor.Factory.Library.Sublibrary.RocketLauncher.MakeRocketLauncherGoNow();

  96. your 'article' is as well by s1d3track3D · · Score: 1

    your 'article' is as well...

    (repeated because /. doesn't think my title conveys my message clearly.)

  97. Re:Peanuts by Anonymous Coward · · Score: 0

    H1-B visa here, this shithead made 500k last yeat, get your facts straight.

  98. Missing the point by jrand · · Score: 1

    A lot of the comments seem to be defending the necessity of the "chaff." That seems to miss the point of the article. The authors aren't criticizing the extra code (much of which IS necessary to make the code functional, readable, and maintainable), they're suggesting that recognizing that only a small subset of the code defines the core functionality can be used in interesting ways. Programmers already take advantage of this in a variety of ways: we have auto-complete in our IDEs, we use web frameworks that write a lot of glue code so we can focus on the problem at hand, and we (sometimes) use newer languages that remove the need for a lot of scaffolding code.

    Their application section gives an idea of what they really have in mind: natural language programming for simple tasks, search for common tasks across diverse code bases, and summarizing code functionality using auto-generated "minsets." There are probably a lot of other tasks we could accomplish if we were reliably able to distill a large block of code to its semantic core.

  99. Re:New research find's water wet by mwvdlee · · Score: 2

    In an ideal world where everything always works, you could easily ditch 90% of your code that deals with exceptional situations, none of that is core code.
    In the real world however, that 90% of extra code isn't nearly enough to catch even half the poop the monkeys will throw at it.

    --
    Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
  100. Nonsense by Anonymous Coward · · Score: 4, Interesting

    the code written, in the summer of 2012 the researchers downloaded 1,000 of the most popular Java projects from Apache, Eclipse, GitHub, and SourceForge. From that they got 100 million lines of Java code and tossed out simple methods (those with less than 50 tokens).

    So they tossed methods that were wrtten well. (methods that only do one thing) So if you wrote a simple 2 line validation of an input field. Field must be populated. Field must match regex. They tossed that as chaff?

    1. Re:Nonsense by lgw · · Score: 5, Interesting

      So they tossed methods that were wrtten well. (methods that only do one thing) So if you wrote a simple 2 line validation of an input field. Field must be populated. Field must match regex. They tossed that as chaff?

      Why the Hell should you have to write code over and over to validate that a reference isn't null, or an int is positive, or other such cases. Sure that's all part of the interface contract anyhow, right? For that matter, why is "allowed to be null" the default rather than an exceptional special case. Why isn't there a simple operator that decorates a parameter as "nullable" with a single character.

      Why not simply

      public Foo foo;

      No getter or setter needed, by default it can't be null. For those odd cases where null actually means something useful, then just write:

      public Foo? foo;

      This goes double for C#, where "?" is already established as the "nullable" decorator.

      Worth noting that many Java coders use Lombock to effectively achieve this already, just with auto-generated getters and setters, since we lack the courage ad/or authority to just have public members instead of pointless getters and setters.

      And, above all else, give us a way to declare that the returned value can't be null, and auto-throw if it is, so the caller never has to check!

      --
      Socialism: a lie told by totalitarians and believed by fools.
    2. Re:Nonsense by david_thornley · · Score: 1

      Public data members make it much harder to reason about a class, or maintain any invariant. Getters and setters are almost as bad as public variables. In well-designed classes, the functions exist for the designed interface, and very often variables don't actually by themselves matter to the interface.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    3. Re:Nonsense by Greyfox · · Score: 0
      Ugh it took me about a year to lose the Java accent when I started doing a lot of C++ stuff about a year ago. Getters and setters seem to indicate that you're planning to do a lot of run-time introspection in your class, and I'm leaning toward run time introspection being bad in most cases. Every time I've seen it used outside of framework code, it's always by some professional programmer who just learned about runtime introspection and is looking for a nail for that hammer. He's also afraid to commit to any functionality in any single object, because then his objects won't be generic enough to dynamically change their behavior to do anything at run time. And I don't mean "anything" in a general sense of things his objects might actually have been programmed to do. I mean "anything" like literally any object could change its behavior to do literally anything at run time. His code is nearly impossible to maintain and is thoroughly obnoxious. I'm actually talking about one specific guy, and I think he knows who he is. If you're reading this, I have a frowny face just for you. >:-(

      Ahem.

      Anyway, yeah, things shouldn't need to do things with object internals as much as Java programmers seem to think that things will need to do things with their object internals. I'm leaning toward not writing accessors until I actually need them and then asking myself if I need to access specific information elsewhere, does the data actually belong in that class. In java's defense, if you asked most professional programmers about interfaces and design by contract, you'll probably get a pretty blank stare. At least any of the ones I've interviewed in the past...

      --

      I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

    4. Re:Nonsense by jasenj1 · · Score: 1

      You might like Groovy. http://groovy.codehaus.org/

      Foo foo; - which creates a private variable and Groovy auto-generates getters & setters (which you can write yourself if you wish)

      accessing the member variable bar.foo actually calls the getter.

      Groovy also has an implicit null check

      foo?.bar()

      And many other syntactical niceties and enhancements over Java.

    5. Re:Nonsense by lgw · · Score: 1

      Sure, that's one kind of class. Some classes exist just to collect a variety of fields that travel together through your system: data classes.

      For most cases, you want either a control class, with all members private, and no getters or setters, or you want a data class, with all memebrs public, and no business logic. Both are valid, common cases.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    6. Re:Nonsense by lgw · · Score: 0

      Java is just frustrating in so many ways. C# is frustrating in some narrow ways due to it's lack of macros, so there's some boilerplate you just can't get rid of. Sadly, null-checking is one of those boilerplate problems.

      I try to explain to people that you want a contract, not merely an interface, but I also get a lot of blank stares. But in most languages you can get there: just use an abstract base class that validates the contract explicitly as part of the "interface", right where the caller can see and depend on it. But you can't do any of that with web services, which is just nasty.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    7. Re:Nonsense by david_thornley · · Score: 1

      I am trying, and not succeeding, in remembering when I last wrote a "data class". I haven't found much use for them.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    8. Re:Nonsense by bingoUV · · Score: 1

      Why not simply

      public Foo foo;

      No getter or setter needed, by default it can't be null

      But "public Foo foo;" IS null. Where the definition of null is that the variable's value isn't anything definite. It either points to a random, uninitialized memory area. Or it automatically calls the null constructor of the class Foo - which is very expensive in java. Or it is just null, but you call it with some other name that is not null.

      By default not allowing "null" such defined is idiotic. It is equivalent to organizing your room by stuffing everything disorganized under a bed. Instead of null, you get uninitialized random variable or very high garbage collection losses.

      --
      Bingo Dictionary - Pragmatist, n. A myopic idealist.
    9. Re:Nonsense by lgw · · Score: 1

      Maybe it depends on your field. I use them frequently. From functions that take to many arguments to be practical, to systems with many pass-through layers, to task models that go through multiple serialization-deserialization steps, so simply capturing a state or context for asynch servicing. Seems pretty normal for systems programming.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    10. Re:Nonsense by lgw · · Score: 1

      In the majority of cases, it's just not semantically valid for a data member of function parameter to be null. That it's syntactically valid is just a bug in the language. If it's not a legitimate state, the compiler shouldn't wait for runtime to complain. And certainly you shouldn't have to manually write null-checking code in most cases!

      With proper contacts, where every function must declare something special if a value is allowed to be null, the complier should complain any time you try to set a non-nullable value to a nullable result - catch the bug at compile time. Java does a similar check well today, by ensuring at compile time that you can't use an uninitialized variable, even with complex branching. Compile-time null reference prevention should be just as convenient.

      But then, Java can't even manage List, so it's not like it's going to get ideas from the past 20 years right.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    11. Re:Nonsense by bingoUV · · Score: 1

      For any sane definition of null, an uninitialized variable is null.

      --
      Bingo Dictionary - Pragmatist, n. A myopic idealist.
    12. Re:Nonsense by Anonymous Coward · · Score: 0

      Lombok actually improves this situation quite a bit for a lot of normal and easy annotations such as 'NonNull' and accessors. That said, it sucks that it's not simply a feature of the language

    13. Re:Nonsense by stoborrobots · · Score: 1

      Data classes like this?

      class TCPSocketAddress
      {
      private long ipaddress;
      private int port;
       
      string getAddress()
      {
        return long2ip(ipaddress);
      }
       
      void setAddress(string addr)
      {
        if (addr.matches("/^\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3)$/")) ipaddress = ip2long(addr);
        else throw InvalidIPAddressException;
      }
       
      int getPort()
      {
        return port;
      }
       
      void setPort(string addr)
      {
        if (newport > 0 && newport < 65536) port = newport;
        else throw InvalidTCPPortException;
      }
       
      }

    14. Re:Nonsense by delt0r · · Score: 1

      Dude we stop using beans years ago. Oh and remind me again how this all works in C++?

      --
      If information wants to be free, why does my internet connection cost so much?
    15. Re:Nonsense by Anonymous Coward · · Score: 0

      > For that matter, why is "allowed to be null" the default rather than an exceptional special case
      The hack language got it (with the benefit of hindsight):
      http://docs.hhvm.com/manual/en/hack.nullable.php

      > This goes double for C#, where "?" is already established as the "nullable" decorator.
      It is one thing that Anders Hejlsberg regret about C# that he didn't put in non-nullable types (it is hard to do now without breaking code).

    16. Re:Nonsense by RabidReindeer · · Score: 1

      There is a language that handles stuff like that.

      It's called Ada.

      Not as popular one might expect, originally because all that validation was expensive. I saw it reduce an IBM mainframe to a compile speed equivalent for Fortran on a 4Mhz Z-80.

      Surprised it hasn't become more popular now that more powerful CPUs and and compilers that do deep analysis are the rule. Instead the "in" thing is scripting languages that have even less built-in validation than strongly-typed languages like Java.

    17. Re:Nonsense by RabidReindeer · · Score: 1

      Sure, that's one kind of class. Some classes exist just to collect a variety of fields that travel together through your system: data classes.

      For most cases, you want either a control class, with all members private, and no getters or setters, or you want a data class, with all memebrs public, and no business logic. Both are valid, common cases.

      What you want and what you end up with are often not the same.

      One thing I've learned over time is that usually if I define a class as static, code-only, I usually end up regretting it. For anything but the most trivial data, the overhead of bouncing the object around within sub-methods, lack of a place to hold working variables, and so forth make it very troublesome to work with and expensive to maintain.

      I do have code-only classes and data-only classes, but a lot of the serious work is done where the class holds one or more data instances and working variables as well as the logic that will be performed on them.

    18. Re:Nonsense by Anonymous Coward · · Score: 0

      ... since we lack the courage ad/or authority to just have public members instead of pointless getters and setters.

      When standard industry practice includes teams comprising only experienced developers with great breadth of experience, and management [at all levels] that understands "anything worth doing is worth doing right", and business users who must never have unreasonable time and cost expectations, then perhaps you may exercise the hubris to repeat this drivel.

      Until then, for every one dev that feels as you do, there are fifty managers who will be more than happy to send a php coder in to make this "simple, urgent change" while you are too busy with "more important tasks". Naturally, they will take a reference to your field and store it in a global variable which will be referenced across multiple classes....

      Of course, your observations about null are spot on. When asked "Would you do anything differently in developing C# if you had the chance?", Anders Hjelsberg (creator of C#, and I believe the chief architect for the .NET Type System - clearly influenced by Java, therefore relevant) said:

      [T]he things that you typically end up regretting later are the fundamentals that you didn’t quite get right. Because those you can’t change - you can always ship new libraries etc, but you can’t change the fundamental gestalt of the platform.

      For example, in the type system we do not have separation between value and reference types and nullability of types. This may sound a little wonky or a little technical, but in C# reference types can be null, such as strings, but value types cannot be null. It sure would be nice to have had non-nullable reference types, so you could declare that ‘this string can never be null, and I want you compiler to check that I can never hit a null pointer here’.

      50% of the bugs that people run into today, coding with C# in our platform, and the same is true of Java for that matter, are probably null reference exceptions. If we had had a stronger type system that would allow you to say that ‘this parameter may never be null, and you compiler please check that at every call, by doing static analysis of the code’. Then we could have stamped out classes of bugs.

    19. Re:Nonsense by Anonymous Coward · · Score: 0

      we lack the courage ad/or authority to just have public members instead of pointless getters and setters

      The setters and getters are to provide a stable interface. Not to control the access. e.g. setting a minimum balance limit on a checking account, you can verify that the incoming value is within valid range. Initially, the range is hard coded. Then it moves to config file. Then it's pulled from database or a webservice. Getters and setters shield the caller from these variations.

      Of course, this does not mean that you blindly use getters/setters. But if you do, it's harmless and you are better prepared for future changes. Auto-Property in C# does the same behind the scenes. If you look at compiler generated MSIL, you'll see get_Foo and set_Foo.

    20. Re:Nonsense by lgw · · Score: 1

      Sure, but you shouldn't be reading an uninitialized variable - the compiler should stop that. You sure as Hell shouldn't be passing it to a function, which passes it down through 6 layers until you finally get that null reference exception far from where the bug was - perhaps Java's most common problem. Except of course, the chain usually starts with returning null, and there's just no non-awkward way to enforce that contract in Java.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    21. Re:Nonsense by lgw · · Score: 1

      Sure but that's a fairly rare case, at least on the code I work on, where inexpensive field validation (other than not null) is useful. Port of course doesn't need explicit validation either, Java needs unsigned ints, but that's a different rant.

      Also, of course, you have a bug in your regex. Also, of course, I once spent a year of my life purging every place in a huge codebase where some idiot thought a network address was an int - TCP does not only layer on top of IPv4! So many DB schema changes for IPv6 support, so few bytes saved by thinking "int" was clever.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    22. Re:Nonsense by lgw · · Score: 1

      a lot of the serious work is done where the class holds one or more data instances and working variables as well as the logic that will be performed on them.

      Sure, but does it really make sense to have getters and setters for those variables? The only such pattern I find common is where you need a getter for some sort of ID or name, something "final" in any case. By "control" class I don't mean static: they often have internal state.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    23. Re:Nonsense by lgw · · Score: 1

      Ada has some really wonderful features that were ignored by other languages because it's so bad in other ways. It's a damn shame. And later contract-based languages like Eiffel were also ignored, which is even more pointless. Java was a regrettable exercise in "let's do C++ without the cruft" instead of "lets pull all the best stuff from academic PL design". Sad, really.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    24. Re:Nonsense by lgw · · Score: 1

      In C++ you can at least have the standard that an object is either a class, with all members private and no setters (and a good argument needed for getters), or a struct with everything public, no consistency promises, but often some sort of isValid method or operator to check consistency when needed. You also have macros for boilerplate elimination, and at least vector<int> works, unlike the sad state of container classes in Java (seriously Java devs, that shit was forgivable for one release).

      --
      Socialism: a lie told by totalitarians and believed by fools.
    25. Re:Nonsense by RabidReindeer · · Score: 1

      a lot of the serious work is done where the class holds one or more data instances and working variables as well as the logic that will be performed on them.

      Sure, but does it really make sense to have getters and setters for those variables? The only such pattern I find common is where you need a getter for some sort of ID or name, something "final" in any case. By "control" class I don't mean static: they often have internal state.

      There are at least 2 reasons why "get" and "get" methods are sensible.

      Firstly, because while virtually all debuggers have the ability to set breakpoints on methods, it's not always as easy to set breakpoints on direct variable access. Or to put in any possible needed side-effects, validations, and assertions - depending on environment and framework, of course.

      Secondly, if you use accessor methods, you insulate (decouple) the actual form of the property data from its external view. The reason why that's sensible can be given by virtually anyone who had to deal with its opposite - Hungarian notation used on things that over their life may spend time as counters, math values and even discrete classes.

      As a third case, when you're using an Inversion of Control system, the IoC system often expects to access the properties via accessors.

      Some cases exist where a mixed-content class doesn't need get/set methods. For example, when the object(s) to be acted on are injected at construction time and never referenced from that class, but many frameworks find it preferable to work with no-element constructors and exclusively get/set access either for simplicity in implementation or just to enforce consistency for the sake of lower maintenance costs both on the framework and on the apps using the framework.

    26. Re:Nonsense by stoborrobots · · Score: 1

      So if you are not doing your field validation at creation time, how do you enforce the "interface contract"?

      Something somewhere has to verify that the address is a valid address, and the port is a valid port (why would you accept a socket request for port 67890?) - why allow a non-conformant data object to exist?

      What domains have such wide-ranging field values that validated data is not a reasonable idea?

    27. Re:Nonsense by lgw · · Score: 1

      "Data" classes have no promise of consistency, and no business logic (and no interface really). They're just a bucket of fields that travel together. It's rare that we would validate all fields in one place anyhow - there's the trivial stuff like the port being in range, sure, then there's more elaborate but still stateless checks you do further in, then there might be stateful validation that you have to do a DB query for and so on. You pass the data object down through the usual layers of control objects, which understand various things about the system and validate what they can before they do what they need to.

      So sure, you could add setters that would do some partial checks up front, but you can't really prove anything beyond "well-formed" - which is a far cry from validation.

      "Control" classes are different. They have very strong consistency promises, formal interfaces, don't have setters unless required for some silly framework, take whatever state needed through the constructor, and don't expose their internal state at all beyond perhaps come sort of name or ID. Internal state is often discovered through probing the system or DB queries or whatever the class does to be fully initialized. Ideally all internal state is final anyhow, unless the point of the class is to poll or monitor of some data that constantly changes and take action on it.

      The separation of data and control classes is a powerful technique, great for task processing, request servicing, and so on, where you're routing a request through your system in some complex way until it finds the place that can actually do the work requested. The data class has no dependencies to drag in to the place where it's created/submitted (often by code that's very walled off from the codebase where your business logic lives).

      --
      Socialism: a lie told by totalitarians and believed by fools.
    28. Re:Nonsense by stoborrobots · · Score: 1

      I agree with you on the idea and behaviour of the control classes, but have generally found it handy to have some guarantees of well-formedness in the data objects.

      Otherwise, every control object which uses the data object needs to verify every detail about the data object before it uses it - which leads to the duplication of validation code issue you were concerned about in the first place...

    29. Re:Nonsense by delt0r · · Score: 1

      Err you can do that in java as well.. I don't see your point. Generics and hence containers in java is a bit of disaster. But STL is not exactly the poster child of containers either.

      --
      If information wants to be free, why does my internet connection cost so much?
    30. Re:Nonsense by lgw · · Score: 1

      You can do anything in any Turing-complete language, of course, but it's hard to challenge what people are used to. That's why I stopped doing C++ professionally - scoped objects give better resource management and leak prevention than managed code, but the approach is too far from what most C++ coders are used to.

      --
      Socialism: a lie told by totalitarians and believed by fools.
  101. Caused by all these restrictions by Cafe+Alpha · · Score: 1

    in the language that CS professors are oddly convinced will make your code more reliable.

    What they miss is that forcing the programer to spend 95 percent of his time jumping through pointless hoops, working around type restrictions making up types and putting down boilerplate makes the code too full of cruft to read, too long to understand, too unwieldy to change.

    This is why I prefer to write in Ruby or Lua or Python or Scheme. Scheme may have an unreadable syntax, but it's the most powerful of the bunch and you can implement the most advanced things in the shortest code. It turns out the functionality is more important than syntax... Still its syntax is unacceptably bad. Ruby is unacceptably slow and needs more straighforward metaprogramming but it's the second most powerful in the list.

    1. Re:Caused by all these restrictions by Simon+Brooke · · Score: 1

      Scheme doesn't have unreadable syntax; that's a category error. Scheme does not have syntax. That's the difference. What you're editing is the raw parse tree; and that's a significant part of what makes Scheme (and other homoiconic languages) so powerful.

      --
      I'm old enough to remember when discussions on Slashdot were well informed.
  102. C++ is just as bad by Cafe+Alpha · · Score: 1

    as java

  103. Probably made sense in the paper by Anonymous Coward · · Score: 0

    And then butchered in the article's start for shock value. Often the case.

    If you RTFA, it isn't that 95% of code is useless. That other 95% is necessary for compilation.

    They are saying that it can be logically reduced to a MINSET which can have uses in the form of enhanced search and productivity.

  104. Re:Peanuts by Anonymous Coward · · Score: 0

    Only the first two letters of the variable name count in real languages.

  105. Re: Peanuts by frans · · Score: 1

    Obviously you have never heard of APL.

    --
    Greetings, Frans
  106. Re:Peanuts by Anonymous Coward · · Score: 1

    Have you seen what Haskell programmers consider to be best practices?

  107. best shining example of code by Khashishi · · Score: 2

    Although fluffy code was nearly ubiquitous in all code samples examined, the researchers found that the best quality code could be found at http://www.ioccc.org/

  108. Re:Peanuts by Anonymous Coward · · Score: 0

    You have obviously never seen APL.

  109. Re:Peanuts by Anonymous Coward · · Score: 0

    I also studied COBOL in college but will never admit it under my handle.

  110. Re:Peanuts by Anonymous Coward · · Score: 0

    You forgot the MakeRocketLauncherGoNowFactory, the MakeRocketLauncherGoNowFactoryFactory, the MakeRocketLauncherGoNowException, the ...

    And the MakeRocketLauncherGoNowFactoryFactoryImpl.

    Don't forget to catch the MakeRocketLauncherGoNowException and return null.

  111. Re:Peanuts by Anonymous Coward · · Score: 1

    You don't need (and no one does do it) a RocketLauncherFactor
    Lies! These guys did it.

  112. Re:Peanuts by HornWumpus · · Score: 1

    If finding the one liner that has the problem takes weeks of digging through object onions?

    If half the CPU work becomes method call overhead?

    --
    John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
  113. Re:Peanuts by phantomfive · · Score: 1

    Only a sith deals in absolutes.

    I'm a Sith.

    --
    "First they came for the slanderers and i said nothing."
  114. Re:Peanuts by HornWumpus · · Score: 1

    Just maintain all three, in synch with update locking, at all times.

    It is a pentagon language. You shouldn't be surprised to do everything in triplicate.

    --
    John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
  115. Re:Peanuts by HornWumpus · · Score: 1

    You should learn APL. You will love it.

    --
    John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
  116. Wow! by Anonymous Coward · · Score: 0

    They found something that everyone knows. But then again "without the fluff your car doesnt move".

    Let us be specific. Within todays car electronics just 2 signals "stacked" give you car the signal to start thats clamp S and clamp 15 (30*). The core function behind both is clear. If both clamps are on, the car is up and running including all electronics. If both are off its practically "off". Here comes the fluff which includes everything between both ON and both OFF. Most engineers refer to it as timed processing of electronics and engine.
    The fluff will take care that your electronics starts up and shuts down without problems, it also fluffs your engine so it never overheats and it will take fluffy care of your windows, air conditioning, signal processing/timing and door locks.

    Fluff is what turns the world. The 5% core is just the mass sitting in the middle of it.

  117. Re:Peanuts by GuB-42 · · Score: 1

    Before someone says, "It takes too long to type longer names," the answer is yes, the first time you type it, but copying and pasting long names takes just as long as it does for short names; or autocomplete if you have a good IDE. Give me a break! Don't be a dumbass coder. If you aren't going to document well or comment worth a damn, then you better use decriptive names.

    Less typing isn't the point of shorter names. Typing speed is nearly insignificant in coding.
    The point is screen real estate, the more code you have in your field of view the better. Smart IDEs and larger screens help but because it is a perception problem, it won't solve everything.
    In fact it is the reason why writing clean code is hard. You have to balance descriptive names and easy to understand constructs with high code density.

  118. Re:Peanuts by Drethon · · Score: 1

    Sounds like a prime set of functions to reorganize into proper classes.

  119. Re:New research find's water wet by Anonymous Coward · · Score: 0

    Should we take someone who can't spell a 3-letter-word correctly seriously, or disregard you as one of the Dunning-Kruger cases?

  120. It may be fluff but... by dark.nebulae · · Score: 1

    At least it runs fast on all platforms!

  121. Re:Peanuts by dottrap · · Score: 2

    You forgot the MakeRocketLauncherGoNowFactory, the MakeRocketLauncherGoNowFactoryFactory, the MakeRocketLauncherGoNowException, the ...

    Exactly. Check out EnterpriseQualityCoding/FizzBuzzEnterpriseEdition for a "proper" example:
    https://github.com/EnterpriseQ...

  122. Flambate? by Required+Snark · · Score: 1

    There's a lot of flamebait here. I wonder if it would be as much if the example language was something other then Java?

    --
    Why is Snark Required?
  123. Re:Peanuts by dinfinity · · Score: 1

    Surprisingly, this comment has not a single +1 Funny mod. I know I laughed.

  124. Re:Peanuts by neoritter · · Score: 1

    That's for method and class access control though...

  125. Brainfuck by almitydave · · Score: 1

    That's why I only program in Brainfuck - all wheat, no chaff. There's a 100% correspondence between lexemes and critical functionality.

    --
    my, your, his/her/its, our, your, their
    I'm, you're, he's/she's/it's, we're, you're, they're
  126. Re:New research find's water wet by grcumb · · Score: 1

    Yes, but the point is silly anyway.

    The notion that everything that isn't core functionality is "fluff", gives the impression that it is non-essential.

    Yep, you've got to worry about reductivist thinking like this. If that were the case, then A Tale of Two Cities would, in its entirety, be: 'Sydney Carton had a twin.'

    The rest is mere extrapolation.

    --
    Crumb's Corollary: Never bring a knife to a bun fight.
  127. Re:Peanuts by neoritter · · Score: 1

    There are tools that will remove all reasonable white space when you are packaging the code for distribution though. So I can't see that as a concern either way.

  128. Re:Peanuts by Livius · · Score: 1

    The problem here is that "fluff" is being used to mean anything that's not the sexy and exotic part of the algorithm. Genuine "fluff" gets in the way of comprehension and is bad code, but structuring and redundancy are extremely valuable.

  129. Re:Peanuts by neoritter · · Score: 1

    No, I think it was the goal of Ada which was supposed to replace COBOL and Fortran for the DOD. It also was the only language (at the time) that met the Steelman language requirements.

  130. Re:New research find's water wet by SJester · · Score: 1

    Sure, nearly anything complex can be mostly "fluff" if pared down to a nominal "core." May as well have written that an automobile is 99% fluff, since you only need one cylinder, a crank, and two wheels to make a vehicle...

  131. Re:Peanuts by neoritter · · Score: 1

    But casting in Ada is not flexible or automatic for a reason. The code is meant to be highly reliable and hard to make simple mistakes with. It was meant for ballistic missiles, rockets, etc.

  132. Being there by Anonymous Coward · · Score: 0

    Did anyone else read the abstract (yes, I know the answer's No, this is Slashdot, I must be new here yada yada) and find themselves reminded of Peter Sellers' character in Being There? All that threshing and winnowing made me wonder whether these guys weren't really just a bunch of famer dudes, and someone had fed them some lines....

    President "Bobby": Mr. Gardner, do you agree with Ben, or do you think that we can stimulate growth through temporary incentives?

    [Long pause]

    Chance the Gardener: As long as the roots are not severed, all is well. And all will be well in the garden.

    President "Bobby": In the garden.

  133. You are not Us by fyngyrz · · Score: 1

    Typing speed is nearly insignificant in coding.

    Typing speed is nearly insignificant in GuB-42's coding.

    FTFY.

    --
    I've fallen off your lawn, and I can't get up.
    1. Re:You are not Us by stjobe · · Score: 1

      Typing speed is nearly insignificant in coding.

      Typing speed is nearly insignificant in GuB-42's coding.

      FTFY.

      No, he had it right.

      If you look at what you actually spend time on when going from specification to release, the actual typing of code is a minor part, and as such your typing speed is largely irrelevant.

      I have a colleague who can't touch-type to save his life, uses the mouse to copy/paste/undo (and even step through the debugger - drives me crazy), and while he may take a little longer to type in his code, it's so small a difference to not matter even in the slightest.

      --
      "Total destruction the only solution" - Bob Marley
    2. Re:You are not Us by fyngyrz · · Score: 1

      No, he had it right.

      No, he didn't. But let me help you out here:

      Typing speed is nearly insignificant in stjobe's coding, and his colleague's.

      FTFY, too. :)

      See, what you're both missing is that your experience does not translate into everyone else's experience. Your experience is perfectly valid for you. That's fine. But when you cast your arms out to include everyone, and decree that your experience is everyone's experience, you have moved from anecdotal reporting to hallucinatory crazy-talk.

      --
      I've fallen off your lawn, and I can't get up.
    3. Re:You are not Us by stjobe · · Score: 1

      I've been a programmer for more years than I care to mention, and never - not once - has the speed a coder types at been an issue. But fine. I'm sure there's some coding somewhere where typing speed is a significant factor.

      Speed coding contests, perhaps?

      Swordfish-style hacking-with-a-gun-to-your-head situations just don't crop up that often in my experience - I lead a rather boring life in that regard - but I guess that might count as well.

      So what experience do you have that leads you to be so adamant that typing speed is a major factor in coding?

      --
      "Total destruction the only solution" - Bob Marley
    4. Re:You are not Us by fyngyrz · · Score: 1

      So what experience do you have that leads you to be so adamant that typing speed is a major factor in coding?

      Not is. Can be.

      Among other things, I write major applications and libraries, generally in c or c++ these days. I've been at it for about 45 years, coming from an assembler background. I extensively document what I write, both for the user and within the code (you'd have to download the import library to see the docs... the link is just to the cover page.) I also wrote the user documentation system (in Python/SQL) itself. I often produce as fast as I can type (35-40wpm) when coding, and almost all the time when documenting. There is no question in my mind that my productivity would be reduced if my typing speed or accuracy were to be seriously impacted in any way.

      In my early career, I worked alongside a lot of very good people, and I can't recall any that were really noticeably similar to one another. IMHO, really good programmers tend to not fit stereotypes very well as they are not only (necessarily) brilliant, but are bringing some kind of broader experience to the table. Later on, I ran a couple of hardware and software companies for about 25 years, producing first for 6809 custom hardware of my design (coin-op arcade industry), then the Amiga and later on software-only for Windows.

      During that time, aside from my own work, I hired, directed and supervised many programmers and a small group of hardware engineers as well. I'm well acquainted with various combinations of lines-per-whatever, reliability, and complexity across a pretty good sample of coworkers and employes -- my own observation consequent to this is that there is a very wide range of acceptable performance, and for various reasons, at that. These days I'm retired and spend my time doing AI research, real-time signal processing and image processing applications, working on building an interior into my home with my SO's considerable assistance, and generally whatever else takes my interest. I still write as fast as I can go when I'm writing, chewing up about a keyboard a year. Matias keyboards.

      That's my experience. In no way am I suggesting it is, or should be, yours. Just avoid painting me (and by extension, everyone) with your own particular brush and I'll shut up. About this, at least. :)

      --
      I've fallen off your lawn, and I can't get up.
  134. maths - emotions by Anonymous Coward · · Score: 0

    Actually, Psychology Today had an article one about the 'primary emotion', and all other emotions were combinations
    and varying intensities.... sounds like a quantum-mechanical hilbert space to me...
    very mathematical!

  135. Re:Peanuts by randallman · · Score: 1

    My issue is that context is often ignored. You already know it's a rocket launcher, that you want it to launch now is obvious and make is superfluous. It should be:

    rocketlauncher.go()

    Yea, foo is stupid, but your example is to the other extreme.

  136. Hello World... by cowtamer · · Score: 1

    I think you can tell how much of a language is "fluff" by looking at the length of "Hello World"

    Java is nice, robust, and great for building enterprise applications with a lot of other developers. It is, however, known for being verbose.

    My favorite hello world so far:

    cat Hello World

  137. Re:Peanuts by phantomfive · · Score: 1

    Genuine "fluff" gets in the way of comprehension and is bad code, but structuring and redundancy are extremely valuable.

    Prove it. This paper suggests it's not extremely valuable. You're saying it based on your 'intuition' which is wrong.

    --
    "First they came for the slanderers and i said nothing."
  138. Re:New research find's water wet by Anonymous Coward · · Score: 0

    Yeah, this reminds me of the "only use 10% of your brain" thing.

    I mean, my house is just insane - my body only occupies about 70 litres of space, and yet just this room has 50000 litres of available space - a utilization factor of ~0.1%! Crazy!! My next house will have no room bigger than 100 litres capacity. Should save me lots of cash.

  139. Re:New research find's water wet by Anonymous Coward · · Score: 0

    Should we take someone who can't spell a 3-letter-word correctly seriously, or disregard you as one of the Dunning-Kruger cases?

    Yes, but we don't take the AC who corrects spelling/usage mistakes seriously. Get a life, we all understood what they intended.

  140. Re:Peanuts by unity · · Score: 1

    Heck I don't even like using or import statements and would rather fellow programmers type out the full classpath everywhere. I started doing that years ago and found it helps learn the full api and helps other more green programmers figure it all out quicker.

  141. Re:Peanuts by BarbaraHudson · · Score: 1

    That is both disgusting and oh-too-accurate at the same time.

    --
    "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
  142. Misunderstood! by Anonymous Coward · · Score: 0

    After actually reading a lot of the paper, the conclusions of commenting programmers (above) is mostly raw ignorance. It appears some of commenters (I refrain from calling them "readers" because most seem not to have take the time to "read" and "understand") minimally read the introduction (abstract) (if at all) and think or thought they "knew" what the article was about. If one reads the article completely with the goal of understanding it, then one discovers how the goal of the work is to provide a means of doing several interesting tasks (that I'd like to see done in Eiffel and placed into the IDE):

    1. Code search: In my universe, is there any code that ________? -- some form of "wheat-keyword(s)" query that can be quickly matched against a database held as metadata about the code universe, resulting in suggestions for where to look for code that does what I need instead of rewriting and re-inventing.

    2. Code completion: As I am hand-coding my feature (not just the line or even token I am typing), is there some other feature that looks like what I have already typed, where the remainder of that feature (or some portion of it) can be applied to the one I am typing to "auto-complete" it?

    3. Code reduction: Is there a common language subset, such that a reduced keyword language could be hand-coded minimally and then the "fluff" or "chaff" filler be computed rather than typed, essentially making for a smaller and more powerful programming language and paradigm (when linked to #1 and #2 above)?

    These are very powerful and interesting questions! They are not implying that Java is 5% meaningful and 95% meaningless. It is simply implying a systematic means of code-reduction in an effort to make tools that do #1, #2, and/or #3 above!

    Fine article and good find. Thank you for sharing!!!

  143. Time for intro to Computers by Anonymous Coward · · Score: 0

    Its time for these people, and the ones who voted him an award to go back and retake their Intro to Computers course.

    Looks like this joker, and a lot of others missed the entire point of Source code: by his definition source code is fluff because he's stripping out everything that makes it readable, or for that matter compilable.

    Congratulations dude, you just discovered what source code is!

  144. Re:Peanuts by magarity · · Score: 1

    variable/function names that go like this (a, b, ...., a0, a1, a2, ....). But People should NEVER write code like that

    When writing for the C-64 you HAD to write code like that.

  145. Only girls grow up to be typists by TapeCutter · · Score: 1

    You don't need to touch type to be productive as a software dev. I'm in my 50's and can't touch type to save my life, it has not been a problem for the last 25yrs. I have never been asked about it at interviews and I have no problem keeping up with the work. I'm not the only older dev in Oz who can't type, during the 70's boys were often not allowed to learn typing at school since "only girls grow up to be typists". When I went to uni as a mature age student in the late 80's it was simply assumed everyone could touch type. Touch typing was not taught as part of my degree (or any other CS degree I've heard of) for the reason the GP stated - it's an insignificant skill for the purpose of writing code and since I can peck away with 2-4 fingers at ~35wpm it would be a complete waste of my time (and my employer's money) to start learning it now.

    --
    And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
    1. Re:Only girls grow up to be typists by edrobinson · · Score: 1

      I went over 40 years and finally retired without touch-typing-- so there.

    2. Re:Only girls grow up to be typists by fyngyrz · · Score: 1

      I didn't say a word about touch-typing.

      --
      I've fallen off your lawn, and I can't get up.
  146. Redundancy is important in any language by Theovon · · Score: 1

    In human language, redundancy is important for separating the signal form the noise. Esperanto, which has less redundancy than organic languages, is harder to understand in a noisy environment.

    With programming languages, a lot of the redundancy is for things like meaningful identifier names and type safety. Hey, I've developed compact programming languages before. They're impossible to read and debug.

  147. I didn't read the article cos it was full of fluff by Anonymous Coward · · Score: 0

    This is news? A bit more one ups man ship for the script bunnies. I prefer to know at compile/edit time if I have a syntax issue - not after deployment.

    There is also a big difference between hand cranked and present but generated.

  148. Re: New research find's water wet by Anonymous Coward · · Score: 0

    I would recommend at least 140 litters of space per room wink, wink.

  149. Re:Peanuts by phantomfive · · Score: 2

    Exactly right. Ugly one-liners, or even whole functions, eh, I'll pound my head on them for an hour, but I'll figure it out. The time-consuming part is the structure.

    You can spend weeks trying to understand the structure of a program before writing a few extra lines of code. That's what really steals your time.

    --
    "First they came for the slanderers and i said nothing."
  150. Re: New research find's water wet by Anonymous Coward · · Score: 1

    True, he ads a lot to this conversation!

  151. 100,000 methods to memorize by Billly+Gates · · Score: 1

    And this was for Java5 back in the day a decade ago in college.

    I am sure it is more complex and huge frameworks like hibernate are popular now. People do not have time to dwell into javadoc when they can prototype stuff fast or use a tool to generate some code for a UML app which does not use the full java apis.

    1. Re:100,000 methods to memorize by Anonymous Coward · · Score: 0

      Use an IDE. The related javadocs popup as soon as you start writing the function name or hover over a different one. I find that way better than other languages were you have to hunt in different areas to find what you're looking for.

  152. One word: by jlowery · · Score: 1

    Groovy

    Really, I don't want to write another line of boilerplate Java again. But for those who do, Groovy doesn't stop you.

    --
    If you post it, they will read.
  153. Misunderstood by ljr1981 · · Score: 2

    After actually reading a lot of the paper, the conclusions of commenting programmers is raw ignorance. It appears some of them read the introduction (abstract) and thought they "knew" what the article was about. If one reads it, one discovers that the goal of the work is to provide a means of doing several interesting tasks (that I'd like to see done in Eiffel and placed into the IDE): 1. Code search: In my universe, is there any code that ________? -- some form of "wheat-keyword" query that can be quickly matched against a database held as metadata about the code universe. 2. Code completion: As I am hand-coding my feature (not just the line or even instruction I am typing), is there some other feature that looks like what I have already typed that the remainder of that feature can be applied to the one I am typing to "auto-complete" it? 3. Code reduction: Is there a language subset, such that a reduced keyword language could be hand-coded and the "fluff" or "chaff" filler be computed rather than typed, essentially making for a smaller and more powerful programming language and paradigm (when linked to #1 and #2 above)? These are very powerful and interesting questions. They are not implying that Java is 5% meaningful and 95% meaningless. It is simply implying a systematic means of code-reduction in an effort to make tools that do #1, #2, and/or #3 above! Fine article and good find. Thank you for sharing!!!

    1. Re:Misunderstood by ljr1981 · · Score: 1

      Additionally—there is a #4 that is somewhat like #1 and #2 from above: #4 Examine my code and see if all or part(s) of it exist elsewhere, such that I can find refactor points for simplifying my code. Our present codebase is somewhere well above 810,000 LOC, across many libraries and code universes. I would like to have a tool that would look for repeating patterns and give me a list of possible refactor points where I can leverage reuse out of code that is similar (from whole features to blocks of code within features). This is where the research of this paper is headed and frankly—I find that to be VERY COOL!

  154. Re:New research find's water wet by DamnOregonian · · Score: 1

    Scaffolding is actually what they're talking about. Lots and lots of really silly scaffolding to hold together a few dozen instructions of code. Java (I do regularly have to write Java code, unfortunately) really, really suffers from this.

  155. Re:Peanuts by Anonymous Coward · · Score: 0

    TL;DR: Less is more.

  156. Re:Peanuts by Morpf · · Score: 1

    The goal is not to use _many_ design patterns, but those, that fit and actually improve the design by making it easier to maintain.

  157. Re:Peanuts by lannocc · · Score: 1

    or triangle brackets

    I'm just curious: which brackets have 3 angles?

  158. Re:Peanuts by Anonymous Coward · · Score: 0

    Interestingly, the one piece of Ada I've seen in my entire career was terribly unreliable. It was basically the logic for a gateway card in a VME chassis between two different systems, but for a variety of reasons, it did a lot more than just bounce messages back and forth. Part of it was that it was a shitty, ill conceived, and hastily implemented solution to a problem that should never have come up in the first place, but part of it was just bad code.

    All the type safety and error handling won't save you if some idiot is doing everything in their power to work around it.

    It should also reassure that on the general scale, the defence industry is moving to Java. I shit you not. The US still hangs on to Ada largely for political reasons, but everywhere else, it's all going Java. Mostly for the same reasons that Java is everywhere else, the abundance of developers who can work with it. Some of the real time stuff obviously isn't, but any kind of higher level logic that doesn't need to be RT, fire up that JVM baby!

  159. Better solution would be to... by ADRA · · Score: 1

    Screw all that crap. Just use Lombok and all of a sudden, your code gets considerably more concise while (the intellegent developer) still knows precicely what's happening behind the scenes.

    --
    Bye!
  160. Re:Your Article Is All Fluff, Reader Finds - COBOL by gabrieltss · · Score: 1

    No that was COBOL......

    --
    The Truth is a Virus!!!
  161. Re: New research find's water wet by runningduck · · Score: 1

    I think they are referring to thing such as malloc calls in C. Although the call is necessary, its purpose is to serve the programming language and not necessarily the purpose of the program. The point is that the most appropriate language should be abstracted sufficiently so that the programmer can focus as much as possible on solving the problem and not servicing the needs of the language.

    --
    -rd
  162. Re:Peanuts by phantomfive · · Score: 1

    If you have evidence that design patterns make code easier to maintain, I'd really like to see it, but I have doubts based on reasons outlined in this comment thread.

    --
    "First they came for the slanderers and i said nothing."
  163. Re:New research find's water wet by gumbi+west · · Score: 1

    It's called "salt" and it's either a good or bad thing, depending on if you prefer fast development or low incidence of bugs.

  164. last sentence gnome by epine · · Score: 1

    Who knew programmers and farmers had so much in common?

    So it's you Phil Johnson—if that's even your real name—who is the last-sentence-gnome for every story posted at Slashdot for the past several years now.

  165. Hello World! by MillionthMonkey · · Score: 1

    I see an opportunity here to promote my Hello World! Java enterprise software suite! Features include Singleton, Factory, and Strategy. This library incorporates advanced programming paradigms with modules that can be found in many top tier major player agile dynamic business enterprise organization synergistic application software shops! (Note that this is not the thread-safe version.) I would just paste it below, but apparently Java can't get past the "lameness filter" anymore... figures.

    Available also on a coffee mug. Support free software!

  166. Re:New research **find's** water wet by Hognoxious · · Score: 1

    At least it lets you type an s without an apostrophe before it.

    --
    Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  167. Re:Peanuts by Miamicanes · · Score: 1

    Most of Java's problems lie with the fact that the designers of its original API made some unbelievably bad decisions early in its development. Like:

    * specifying arguments as int or String values, instead of enums... so every method you called that explicitly needed UTF8 had to be surrounded with try/catch (just in case you couldn't remember whether Java wanted you to call it "UTF-8", "UTF_8", or "UTF8" & threw an UnsupportedEncodingException). This particular thorn in my side was FINALLY fixed as of JDK 7.

    Before anyone points out that enum is a semi-recent addition to Java, I'd like to remind everyone that even in 1996, you could declare a class with a private constructor, then use it to declare public static final constants of itself that were defined by their own declarations (which, I believe, is what 'enum' actually does behind the scenes, anyway)

    * Pre-JDK8, Java's handling of nearly everything related to the concept of a Date/Time (parsing, printing, calculating, the works) was completely fucked. -- http://www.oracle.com/technetw...

    * Swing (Enough said. It speaks for itself... and does it almost as loudly and proudly as AWT.)

    Even MORE tragic, though, is the way Android's API architects perpetuated the EXACT SAME anti-patterns (string/int constants as args) with the Android API... including brand new framework classes that didn't exist until Android did & had NO REASON to be that way.

  168. Re: New research find's water wet by Arkan · · Score: 1

    And this is why C is not an appropriate language when you're developing an application where the important aspect is the result, not the amount of memory of the speed required to achieve it.

    A language is a tool, and each language is a somewhat different tool. A good architect/analyst/developer knows which tool to apply to which problem, the associated "fluff" being largely nonsensical with regard to the inherent benefit of applying the right tool to the right problem.

    This, my friend, is common knowledge among experienced practitioners and often fly a mile above the head of beginners which tend to have the "have a hammer, everything looks like a nail" mindset.

  169. Your PC is mostly Fluff by Anonymous Coward · · Score: 0

    Any average Desktop-PC: 3% CPU, 97% Fluff

  170. Re:Peanuts by jhol13 · · Score: 1

    Generics killed Java.
    Just an example, Java v.s. Javascript public static <AnyType extends Comparable<AnyType>> AnyType maximum(AnyType x, AnyType y, AnyType z) v.s. function maximum(x, y, z).

    P.S. I must mention that Javascript is the worst language I have seen in a long time.

  171. Methodology is flawed by Simon+Brooke · · Score: 1

    From the article:

    From that they got 100 million lines of Java code and tossed out simple methods (those with less than 50 tokens).

    Good coding style is to decompose your problem thoroughly, so your methods will be very small. Indeed, using this methodology, the more you refactor the greater proportion of so called 'chaff' you'll get.

    I'm not arguing with the general propositions that

    • Java is an extraordinarily prolix language, and
    • These days, most Java is exceedingly poorly written

    But this study doesn't show it, because it arbitrarily tossed away the better-written code and then analysed the remainder.

    --
    I'm old enough to remember when discussions on Slashdot were well informed.
  172. Re:Peanuts by bingoUV · · Score: 1

    , that you want it to launch now is obvious and make is superfluous

    Not necessarily. If the regular usage is to schedule it for launching at optimal time calculated automatically - launching it now is a special case and function name must make it clear.

    --
    Bingo Dictionary - Pragmatist, n. A myopic idealist.
  173. Re:Peanuts by helix2301 · · Score: 1

    Java is here to stay though. First off Oracle, HP and Symantec build almost all there tools in java so that pretty much guarantees survival. I know google is trying to get away from it for all HTML 5 all chromebooks don't even support java.

  174. An OO language problem, in general by Anonymous Coward · · Score: 0

    Programs in OO languages, in my experience, seem to be mostly fluff. The goal seems to be to make sure to use the OO paradigm, whether or not it is well suited to the problem at hand.

  175. Re:Peanuts by Morpf · · Score: 1

    Well, I don't want to miss at least a couple design patterns: Iterator, Observer, Adapter, Decorator, Dependency Injection, Object Pools (Threads and Connections in my case).
    I also sometimes use Singleton, Builder, Proxy, Command, Circuit Braker.

    Iterator: I want a simple Interface I know, to iterate over data structures if iterating is reasonable. Not 10 different interfaces for 10 data structures.

    Observer: Often I want information to propagate. Yet the business logic should not depend on the UI, so I can easiely provide different UIs. And especally I don't want circular dependencies.

    Adapter/Wrapper: Every so often I have to work with slightly off interfaces. Putting an Wrapper around it solves this.

    Decorator: You don't have to maintain for example scroll functionality for every dsplay and input type (e.g. Text, Picture) but just do it once.

    Dependency Injection: My code is so much easier testable since I use DI. Only downside, I have to admit is, that you potentially have your dependencies defined elsewhere. But then again this allows easier changes of those (for example in case of software product lines).

    Object Pools: Thread and connection pooling can drastically improves performance. Noone nowaday creates 1000 new connections per second from one server to one DB.

    Yet of course I don't sit there all day and try to use as many design patterns as possible. For a 100 line program I would never use DI, I use a wrapper only, if I really need to. And so on...

  176. Re:Peanuts by Morpf · · Score: 1

    Forgot to note, that patterns also improve communication, as you can just say, you used the observer pattern and everybody (hopefully) knows what it means. Moreover by just harmonizing the code, so that the same problem is always solved the same way, you don't have to dig deep into the implementation to see what is going on. You see ItemsPurchasedObserver and you have a rough idea what's going on. On top you are not forced to reinvent the wheel for the millionth time.

  177. Re:Peanuts by phantomfive · · Score: 1

    What you're basically saying is that you like design patterns. You like them because they fit the way you think......which is probably because you learned software engineering through design patterns. Which isn't the same as 'code being easier to maintain.'

    Also, you more-or-less ignored everything in the thing I linked to.

    --
    "First they came for the slanderers and i said nothing."
  178. Java is mostly bloatware, what would you expect ? by macpacheco · · Score: 1

    Java, .net and windows are mainly means to make your shinny 4GB core i7 seem slow.
    If Oracle cared at all about safety, Java wouldn't have so much security updates every month. It's riddled with bugs, cause they never cared about making it secure. If they did, they wouldn't stuff it with so much bloat its pretty much impossible to inspect all of it for bugs in the first place.

  179. Re:New research find's water wet by pixelpusher220 · · Score: 1

    indeed. Will it 'run' without 90% of the 'stuff' in it? Probably if you wrote it that way. "Maintaining" that pile of crap would then quickly become unworkable and then it doesn't 'run' anymore.

    I'm not big on scaffolding to extremes but designs call for standard stuff that isn't truly 'functional' but is nonetheless 'required' for reasonably working applications.

    --
    People in cars cause accidents....accidents in cars cause people :-D
  180. Re:Peanuts by Morpf · · Score: 1

    The thing you linked more or less said design pattern are bad because... he doesn't like it. He says there is no scientific proof they are good and thus they must be bad (without giving any proof) and because people used them wrong and introduced unnecessary complexity. The argumentation of the GoF is as sound or unsound as his. I can always construct an argument against something if I point out how it is used incorrectly. By this argumentation Assembler, C, C++ and actually every programming language is bad, because I can write really messy code.

    I wrote that design patterns are usefull to _me_, yes. I can't generalize my experience, of course. Yet I learned design patterns only quite some years after I started programming. And I really prefer it this way over everyone reinventing the wheel. The code bases I worked on were many years old and more than a million lines of code or so. It just would not have worked without design patterns and code formating rules.

    The problem is, that there are almost no useful experiments in software engineering. Each one I saw until now was set up way too small, too short or used students instead of professionals or any combination of this. Really good experiments are just wayyy too expensive, as you would have to watch programming efforts with and without, on the same project, over years, with professionals. Nobody will finance that, unfortunately. And case studies are just case studies and can't be generalized. Thus it is hard to scientifical sound say what is bad or good. It would be great if we could, of course.

  181. Re:Peanuts by phantomfive · · Score: 1

    I wrote that design patterns are usefull to _me_, yes. I can't generalize my experience, of course. Yet I learned design patterns only quite some years after I started programming. And I really prefer it this way over everyone reinventing the wheel. The code bases I worked on were many years old and more than a million lines of code or so. It just would not have worked without design patterns and code formating rules.

    This is the kind of thing that worries me. You won't let yourself think outside of the design pattern box. You use listeners all over the place.

    Try not using design patterns. You may find yourself enlightened.

    --
    "First they came for the slanderers and i said nothing."
  182. Re:Peanuts by Livius · · Score: 1

    Unless not all "fluff" is equal.

  183. Re: New research find's water wet by runningduck · · Score: 1

    I think you missed the point of my post and maybe even the article.

    You are absolutely correct that a language is a tool. But the point of a tool is to solve a problem. I was not advocating the use of C for general purpose business coding or even calling C an equivalent to Java. I was making a point by analogy being C has many obvious constructs that serve the language more than the problem being soled. There are also many constructs in Java that although not as heavy as having to manage your own memory off-sets are nonetheless equally superfluous to solving the actual business problem.

    Java is a great language for many things, but as the article accurately notes, the language has its own layer of cruft that only services the purpose of the language. This becomes a bigger problem as Java developers push Java into more niches where it is likely not the most appropriate language.

    While you, my friend, may be an experienced practitioner who selects another language when the problem is not appropriate for Java, there are many who simply force Java into the project. So regardless of your superior professional judgment regarding the selection of languages, the premise of my statements and the article stand.

    --
    -rd
  184. There's a big difference between Java and Good! by TheRealLifeboy · · Score: 1

    The difference between Java a good languages like Python or Ruby is huge. These guys have finally hit the nail on the head. Java is a huge fat fluffy monster that wastes a massive amount of code.

  185. Re:Peanuts by Anonymous Coward · · Score: 0

    That paper's a load of shit.

  186. wheat vs chuff for who? by Anonymous Coward · · Score: 0

    Sure, all languages have a fair amount of redundancy. But who do you write the code for? Hint: its not for the compiler. Its for the poor schlub who has to "maintain" or "enhance" the code in the future. You want to make sure they know what the code does.

    COBOL was successful for 50+ years because the code had value after decades.

    1. Re:wheat vs chuff for who? by vilanye · · Score: 1

      Most of the Java boilerplate is for the compiler, not the programmer.

  187. As compared to what? before compling who cares by johncandale · · Score: 1

    Am I missing something? isn't all code 99% fluff before compiling?

    1. Re:As compared to what? before compling who cares by Anonymous Coward · · Score: 0

      No

      Dumbass

  188. Re: New research find's water wet by darkarena9789 · · Score: 1

    I agree. Pearl probably has a higher "functionality" factor but it's compleatly unmaintainable.

  189. This is a problem with OO in general by DaChesserCat · · Score: 1

    I write an application, be it in Java, C++, whatever. Insert Object-Oriented language of choice here.

    I need to do I/O. So I use an existing class. Which is, more often than not, bundled into a large library of classes. And the classes in this library depend on classes in that other library. So I need my new class, and the classes it uses and the classes they use, all the way down.

    If I'm writing an app which uses data persisted to/queried from a SQL database, there are libraries (for Java, usually .JAR files, frequently megabytes in size and that's WITH compression) which I can use. I may use a few classes from that library. And those classes may use a few more. But I can't extract the classes I need and create a new library. I have to bundle their ENTIRE library, with all of the associated classes, regardless of how many/few I actively use. And this library has dependencies in those libraries. And that library has dependencies in those libraries.

    By the time you write something for a website which will use Hibernate to handle the ORM duties, Spring framework to handle the web duties, etc. you end up with an application that's > 10 MB in size. The code which I, actively, wrote is
    Furthermore, if I choose to extend that other class, I may create a method which overrides a method in that class, and my method may not use theirs at all. As such, I still have to include their class, and its associated library, IN ITS ENTIRETY, but parts of it not only aren't being used but aren't even REACHABLE. Because calling foo.bar(), where foo is an object of my class, can't even reach the extended class's .bar() method.

    Object Oriented programs are built in layers, by accretion. As the number of layers increases, the amount of unused and unreachable code grows. Until, voila! we're down to 5% of the code in the app actually getting used, even if you exercise ALL of the functionality in the app.

    Java is merely one of the worse offenders in this. When you have a stacktrace with 30 layers in it, that's a LOT of code. A significant fraction of which is NOT getting used by your app.

    --
    ... by the Dew of Mountains the thoughts acquire speed, the hands acquire shakes, the shakes become a warning
    1. Re:This is a problem with OO in general by DaChesserCat · · Score: 1

      ... the code which I, actively, wrote is less than 100 KB, and the code that it uses is less than 1 MB, but the bundled libraries add up to more than 20 MB. ...

      --
      ... by the Dew of Mountains the thoughts acquire speed, the hands acquire shakes, the shakes become a warning
  190. In other news water is wet. by Anonymous Coward · · Score: 0

    Java is an extremely bloated language requiring a ton of boilerplate that exists for no other reason than to please the almighty compiler.

    Java was written by top programmers for use by average programmers. Hence, all the needless boilerplate.

    It isn't just the accessor/mutators, that is small potatoes. It is all the:

    Casting

    Interfaces(Gosling himself said this was an error)

    Factories

    Runtime exceptions(yes, this causes a ton of boiler plate to deal with things like interfaces that do not throw any exception).

    The need for a dozen sort() methods(sane languages can get by with exactly one sort method and it works on all iterable types) which is caused by:

    A broken type system(it is allegedly strongly typed but is filled with casts and autoboxing, making it weakly typed - compare to Ruby where an object will only ever be one type and can never be coerced, that is strongly typed) that is the cause of all that nasty XML and annotations just to get around the broken type system. An H-M type system would do so much by itself to rid Java of needless boilerplate.

    Properly implemented OO systems like Smalltalk and Ruby have very little need for most design patterns, in fact they disappear entirely making them redundant.

  191. Re:Peanuts by Anonymous Coward · · Score: 0

    Only a sith deals in absolutes.

    I'm a Sith.

    And so is he.