Slashdot Mirror


Thoughts On the State of Web Development

rmoskal recommends his blog post up at Most Media on finding the right level of abstraction, Grails, and SOFEA. "[Three years ago] I was very excited about Apache Wicket as the way to develop line of business applications with a domain model, CRUD [create-read-update-delete] screens for maintaining the model, and in the most interesting cases, doing something else useful besides. I still like Wicket. It has, as its website says, a small conceptual surface area.' It reminds me of Python in that 'You try something it usually just works.' In many respects, though, Wicket seems to be at the wrong level of abstraction for the for the sorts of line-of-business applications described above. If your team is spending any time at all writing code to produce listing, filtering, and sorting behavior, not to mention creating CRUD screens and the back-end logic for these operations, they are probably working at the wrong level of abstraction. ... Recently I did a small project using Grails and was quite pleased. Grails uses groovy, a dynamic language compatible with Java, and is based on the proven technologies that I know and love well: Spring, Hibernate, SiteMesh, Maven, etc. ... I get all the power of the Java ecosystem without the fustiness and lack of expressivity of the core language (no more getters and setters, ever!)."

21 of 253 comments (clear)

  1. getters setter :) by roman_mir · · Score: 4, Insightful

    First, getters/setters are generated by your IDE of-course, so you never have to write them by hand, however, more to the point, I have avoided many various parts of the 'Java ecosystem', while still using that language to do all sorts of development and really, you don't have to use getters/setters. I use many Java classes as simple data structures, just like C-Gods intended, no getters or setters there, just public or protected fields.

    1. Re:getters setter :) by Anonymous Coward · · Score: 2, Informative

      Geez, again with the same excuse: "My IDE generates them automatically". Yes it does, but Java IDE's are not the only one's that can do that, duh.

      Deeper problem is that you later have to use those "fully automatically with just a few special clicks" getters and setters like this in your code: point.setX(point.getX()+1); instead of just writing point.X++;
      2.7 times longer line than it ought to be. And with current java IDE-generated non-VM supported getters/setters all of the shorthand abbreviations such as ++ -- += -= *= etc are unusable. Good luck writing any complex formulas on one line with such getter/setter syntax :P

    2. Re:getters setter :) by drewhk · · Score: 2, Interesting

      You do not think OO enough. The problem is that you think about, "how can I modify an object" instead of "what services that class should provide". You rarely need inc, mult, etc, they are very primitive operations, and indicate a poorly designed interface -- as you noted, too. The class here is a Vector (or Point, which is the same), so instead of inc, mult, you can simply use add(Vector delta), and scale(int lambda) -- which are the natural operations for a Vector. You can also have rotate, mirror, etc.

    3. Re:getters setter :) by Daishiman · · Score: 2, Insightful

      The fact that you even NEED an add() or increment() method shows the idiocy of the programming language.

  2. java centric by thetoadwarrior · · Score: 2, Informative

    This isn't really about web development in general but Java web development and writing getters / setters is the IDE's job.

  3. Using Java for web development by Banacek · · Score: 5, Insightful

    Using Java for web development is like using a wrecking ball to hammer in a nail. Use something that fits the job better, like Zend Framework, Django or Ruby on Rails. In web development, time to market is everything. Build your application and hopefully you get a large user base. Then when performance is an issue, you should already be working on a rewrite that can incorporate something like Java on the backend.

    1. Re:Using Java for web development by Anonymous Coward · · Score: 2, Interesting

      Or just dump the server side all together, seriously with the maturity of the JavaScript frameworks, there is no reason to build on restrictive server side technologies, just build your UI with HTML/CSS/Javascript and communicate back to RESTful services implemented in whatever language the back end team chooses. This fixes a lot of things that where broken in web development not to mention that it is a far faster development style and is more maintainable to boot.

    2. Re:Using Java for web development by Daengbo · · Score: 2, Informative

      TFA (Shock! I read it) says that this is his new preferred method. Separate all the server and client-side logic. Push almost all the logic into the client.

  4. Need a New UI Tool by Tablizer · · Score: 5, Insightful

    As I've said before on slashdot, the open-source movement should look at creating a new GUI browser that does desktop-like and CRUD GUI's well. Forcing the e-brochure-like HTML-based browsers to act like desktop/CRUD GUI's is like trying to roll Pluto up Mt. Everest: people have kept trying to pull it off with AJAX and whatnot for more than a decade, but it's still kludgy, bloated, buggy, security-challenged, and version-sensitive.

    It's time to throw in the towel and start a new tool and markup language.
       

    1. Re:Need a New UI Tool by icebraining · · Score: 3, Insightful

      The biggest problem with Java applets is that they pretty much force you to use Java as your programming language. Many of us want language choice.

      Well, there's at least proofs of concepts for Ruby (JRuby), Python (Jython) and Groovy.

    2. Re:Need a New UI Tool by phantomfive · · Score: 2, Informative
      It's not even just that: as soon as you get out of the three column format, HTML has trouble. The idea of CSS is sound, to separate the presentation from the content, but in practice it fails (if you don't believe me, ask yourself this: when was the last time you used a

      div

      as a line break? That's really not what they're for).

      It's sad, but the problem is HTML has been developed by a committee, and not just a committee but a committee with conflicting goals. Some people want to make desktop-like GUIs, others want to make it impossible to define precisely what your page will look like in a given browser (this makes it more portable, in theory). Some people on the committee are thinking in terms of page layout, and some are trying to manipulate it in any way possible to give their browser a competitive advantage.

      With all this in mind, HTML makes a lot more sense.

      --
      Qxe4
    3. Re:Need a New UI Tool by Hurricane78 · · Score: 2, Informative

      It’s called QtDesigner & friends. Or XUL. Look it up.
      Basically, it’s an old hat. A very old hat. I did things like that back in 2003.

      I’m back to plain and simple... compiled desktop/server/mobile programs. I still use something like XUL (but in EBML with a tag-mapping attachment), but I mostly generate that “XUL” from SQL DDL, as an itermediate representation, and plain machine code as a final result.
      As an example: A complex application usually takes the time to write a clean SQL with the appropriate interfaces (30-60 min), a run of my generator (3 seconds?), then I add a bit of non-standard business-logic (duration depends. Between 20 minutes and a whole week.), use a small tool to generate a color palette and fonts for the design (15 min), edit a tiny text file of annotations, and run the final compilation (<5 min).

      Done.
      That thing now has a an optional server part, a AJAX browser client, a real full application for Windows, Linux and Mac, and a small but full-featured (no compromises!) phone and PDA client. Done, done, and done.

      So with a big of luck, I can churn out a $2000 tool in a day, and a $10000 tool in a week.
      But I do not really like doing stupid apps for stupid business clients. So I do as little as possible.
      Which explains why I can hang out here all day long, posting lengthy comments. :)

      (My main business is game design, but since the money is not coming in as much as planned, I haven’t stopped doing stuff like this yet. Maybe I should hire someone to do it for me, and just become Leisure Suit Larry. ;)

      --
      Any sufficiently advanced intelligence is indistinguishable from stupidity.
  5. People who do not learn from history.... by Kenneth+Stephen · · Score: 4, Insightful
    ...are doomed to reinvent J2EE. Badly I confess that I haven't tried any of the frameworks mentioned by the parent. But I have had conversations with people who have, and here are some questions that I have for the folks who think that the people who came before them (and invented J2EE) are stupid:
    1. Can your framework handle two-phase transactional commits when it interfaces to other applications?
    2. How well does it support single-sign across apps deployed across different servers but behind a reverse proxy that unifies them under a single domain?
    3. Can you cluster multiple hosting servers for your app to minimize downtime during app upgrades? Does your application sessions failover to the other members of your cluster correctly, if so?
    4. Can you take legacy code and layer your app around it without needing to rewrite the legacy app? Can you do this even if the programming team who wrote the legacy app is no longer around?
    5. When you discover that you are having intermittent glitches (slow responses / server 500 response codes /etc), do you (a) reinstall (b) upgrade to a newer version of your framework / OS / whatever (c) Troll the user forums for your product / framework and hope that someone has seen your problem before. (d) Pull three all-nighters reading the source code to your product / framework? [Hint. The right answer is (e) Put your product into a supported trace mode and get your vendor to support you]

    IMHO, programming language wars are silly. The proof of the pudding is in what you can achieve with the framework of choice. After many years of observing the competitors to J2EE, I have yet to see a professional grade alternative to it.

    --

    There is no such thing as luck. Luck is nothing but an absence of bad luck.

    1. Re:People who do not learn from history.... by inKubus · · Score: 2, Interesting

      These kids today who act like there's some art to programming that's instinctual, that they should be comfortable programming when they don't know shit about the language they're using. Guess what, C is the most comfortable language ever invented. Perl is one of the fastest to write.

      Of course, perl is designed for text. HTML, while a subset of "text", is a pretty complex markup language. To generate such code using another language is not trivial. Then you're dealing with networking, web servers, the internet, unknowns like browser type and user screen resolution. Then you have various databases on the back end. It's a very complicated problem yet kids think somehow the computer (or someone else) should just solve it.

      The problem is that frameworks are generic and your app is specific. Yeah, the basic types are always there, CRUD, forms, lists and datagrids. But the amount of variance between two "lists" can be huge. A styled list that may work great for a list of books might be horrible for a list of people.

      There's no way a framework is going to define base types for every possible thing you could have in a list. The frameworks and object-relational mapping engines are just tools to assist you. You still have to classify everything and their interactions. You still have to define a logical flow for every feature. You still have to test everything. That's what a programmer's job is! So, kids, you're never going to have something that will abstract away the programming. As much as you'd just like to point at the computer and magically create an "app" like you paint a picture, it's not possible, has never been and never will be. "Fustiness and lack of expressivity"--shut the fuck up and get off my lawn.

      --
      Cool! Amazing Toys.
  6. Re:Rails is Awesome by binarylarry · · Score: 3, Insightful

    It rocks until you need to support more than a dozen users. Then you need something like Java, which as proven to scale to meet any demand.

    Just ask the folks at Twitter.

    --
    Mod me down, my New Earth Global Warmingist friends!
  7. Re:getters and setters by AuMatar · · Score: 2, Insightful

    In Java, its a weakness about interfaces- you can't have a data member in an interface, so any interface needs to use getters/setters.

    In most languages, its so you don't give direct access to internal variables. In C++, you can just make the data member public and assign to it like a normal variable. But then you can't protect what is stored there or do sanity checks. Or you can write a getter/setter to do so. And if you decide to change from one to the other, you need to go back and change every access everywhere- a pain. Some languages like C# provide syntactic sugar to allow you to use foo.bar=9 and have that call a function, but there's problems with this- its impossible to know when you're calling a function or not by inspection, so you can have bugs that are difficult to find by code inspection- = does not always do what you expect it to. I prefer writing getters and setters to that.

    --
    I still have more fans than freaks. WTF is wrong with you people?
  8. Play framework is the way... by jbwiv · · Score: 2, Interesting

    Rails? Been there. Grails? Done that. Both are decent. Rails is very good, but the abuse of open classes gets old quickly. Grails is ok, but it's really just a thin veneer over a complex mix of Java projects, and God help you if you run into any problems, because you'll be dealing with a stack trace that's 1000s of lines long, and you be troubleshooting these underlying complex java libs. For me, the play framework (http://www.playframework.org) is the best Rails-like approach on a Java platform. It stays very close to rails, so if you know rails learning it is easy. It's very pragmatic and very fast. It doesn't require a compile step to see your changes. It just works. Best of all, the code is clean and easy to troubleshoot. I suggest you check it out.

  9. We're going the wrong direction by Rival · · Score: 4, Insightful

    With the amount of abstraction in software development these days, very few people seem to really know what they're doing anymore. This should concern you -- if it doesn't, you haven't thought about it enough yet.

    We regularly see new exploits that affect systems that have been live for years, oft-times spanning multiple major versions and platforms. In retrospect these flaws are often usually painfully obvious, but because they have been buried in the layers of sediment of "best practices", "boilerplate" code and underlying platforms, they aren't seen. At least, not until a curious or malicious mind starts poking around.

    While this is in part a problem with QA, the deception of abstraction is that it provides a Black Box that is very easy to trust. This affects developers as much as QA.

    Are we really wise to keep building on these layers of abstraction? Toolkits on top of frameworks on top of virtual machines on top of operating systems on top of hardware -- even device manufacturers can't keep their locked-down devices from being rooted in a matter of days, sometimes even before release. While many of the Slashdot crowd laugh because there is a sense of social justice in seeing DRM broken, the same exploits may some day be used against systems we rely on. I don't consider myself a fearmonger, but I wouldn't be surprised to see significant digital infrastructure fail at some point, either due to malicious intent or simply instability, at some point in my lifetime. Poor software quality hurts us all.

    I realize that I sound like an old man yearning for the better days, but I learned to program in assembly on 8088s, and I knew exactly what my programs were doing. I'm not saying I want to go back to that, but the idea that most developers these days don't even understand memory management or garbage collection blows my mind. Asking for a new language because getters and setters are too much of a hassle? Somebody get this kid a lollipop, please.

    I read the article (no, I'm not new here) and the author's main point, emphasis original, is this:

    If your team is spending any time at all writing code to produce listing, filtering, and sorting behavior, not to mention creating CRUD screens and the back end logic for these operations, they are probably working at the wrong level of abstraction.

    Where does he draw the line at "wasting time writing code"? This is exactly the mindset that leads us to buffer overruns, SQL injections, and many other problems which should not make it into production software. He wants his developers to abstract as much as possible, but code reuse all too easily leads to blind acceptance and a failure to understand what is being imported. If he trusts that all those acronyms on the blog post he wrote are bug-free, then I would hate to be one of his customers. Not that there seems to be many categorically better options available.

    In the end, I think we need to abandon the cycle of "software bloat to more powerful hardware to software bloat..." and figure out what we can do with what we have. Good grief -- look at CUDA! We have orders of magnitude more processing power in a single video game console than all the world's computers before World War II, and available memory is simply insane. Take a look at what Farbrausch has done, and you will see what dedicated focus on efficiency can do.

    Stop being lazy, understand what you are doing, understand what you have available, and use it well.

    1. Re:We're going the wrong direction by wurp · · Score: 2, Insightful

      I haven't read your whole post in depth, but this stood out:

      Where does he draw the line at "wasting time writing code"? This is exactly the mindset that leads us to buffer overruns, SQL injections, and many other problems which should not make it into production software.

      No, rewriting functionality that already exists in stable, tested libraries is the mindset that leads us to buffer overruns, etc.

  10. Re:getters and setters by Civil_Disobedient · · Score: 2, Informative

    In Java, its a weakness about interfaces- you can't have a data member in an interface, so any interface needs to use getters/setters.

    Not true if the field is declared static.

  11. Re:Off Topic. by Civil_Disobedient · · Score: 2, Funny

    I'd like a 3d online space where my avatar can stand in the rustling grass of a windy prairie. In this environment, are a variety of nearby locations: A Desk...

    And on that desk, a computer. I virtually sit down in the virtual chair in front of my three-dimensional virtual desk, press the virtual power button, look at the virtual monitor (300 feet wide!) and am confronted with... ad infinitum.