Live data from Hacker News

Why I Hate Frameworks

discuss.joelonsoftware.com

71–80 of 127 posts

Re: Why I Hate Frameworks

#71
post #64
post #36

Earlier quoted context omitted.

I think the issue is, a spice rack from IKEA may work, but it's not going to look great, or last long. Any flat pack spice rack, will be shoddy quality, and probably break. You don't get good furniture by mass producing it like that. Same with software. What if I want a custom spice rack, with some secret compartment, in solid oak.

The idea that using well tested, widely spread open source software is somehow less reliable than writing your own is the kind of baseless FUD I wouldn't expect from you, axod. Next, you'll be suggesting that people write their own web server instead of using Apache? Or perhaps they can trust other people's code so long as they pay for it, so you'll send them towards IIS? Come on, now.

"Next, you'll be suggesting that people write their own web server instead of using Apache?"

If the webserver is a key component in your success, then definitely. Write a webserver. It was for me, which is why I wrote my own (After I found others lacking).

If it really matters, and the existing stuff isn't good enough for your use-case, write it yourself.

Re: Why I Hate Frameworks

#72
post #68

Earlier quoted context omitted.

About?

Suggesting that rails is a kick-ass tool made of balsa.

Not "is a," but rather, "may be." This is because I never personally experienced the problems noted in the link I posted, but they are coming from what appears to be a credible source. You mistook a suggestion of problems for a personal conviction.

Re: Why I Hate Frameworks

#73
post #52
post #37

Earlier quoted context omitted.

"Only when you dip down into the mediocre masses do you need this help." And what is wrong with that? Some of us aren't the programming gods you are. If it helps people why get so high and mighty about it? I know with your superior intellect us philistines might seem dumb to you, but maybe you should stop writing about how smart you are when you can't even spell "programmers" right.

Fundamentally, you need to learn your craft. I have just inherited a large project based on Hibernate. I dislike it because there is all this crap between me and the database. I am proficient in SQL as well as Java and I don't like masking a very powerful language with a weaker Java-centric abstraction. If you are going to develop backends you need to understand databases and SQL. If you don't you will end up with an…

Sorry to hear that you don't like Hibernate. I'm using it for a project right now, and I greatly prefer it to ActiveRecord. The trick is to use a framework (yes, a framework!) like Grails to autogenerate a lot of the configuration crap for you.

I suspect that your large project was built by "Java Engineers" who tried to stuff way too much into the ORM layer. That's an abuse of the tool, not an indictment of the tool itself.

Re: Why I Hate Frameworks

#74
post #32

Earlier quoted context omitted.

I agree completely. Web frameworks add a layer of code bureaucracy that really doesn't need to be there in most cases. Reading and setting browser cookies is not that hard. Creating and reading web forms and validating inputs is not hard. Creating a relational database schema and objects that store themselves in that schema is not hard. You can do all of this directly in mod_python, essentialy by buildng your own fra…

"essentially by building your own framework" Why build your own framework when there's one already there? Already well-used, well-tested, well-extended? Sure it may be easy enough to do, but is it really worth it? I, for one, would much prefer to be spending my coding time writing application logic than Yet Another Validation Library.

There is a trade-off to using a Framework. For me, it depends on the complexity of the problem, and the difficulty of learning the framework.

Suppose someone is familiar with Java Servlets and JSP, basic JDBC and SQL, and the tomcat container (with connection pooling). If I have a simple database driven application, I can choose to hand code some of my application logic, or use a framework.

So I'm choosing between, say:

No framework: container managed security, hand coding my ORM layer, writing my own server side form validation, writing my own MVC (or just not bothering, if it is just a few pages).

Framework: Spring Security, Struts for form building and validation, Spring for the MVC tier, JPA and Hibernate for ORM.

These are slightly extreme - you don't have to use all those tools, of course.

But let's say we do get something out of the framework. The code really is easier to maintain and understand, provided someone has read a 300 page book on spring, another 300 page book on hibernate, and a 150 subsection of a book on Struts, along with doing all the exercises.

Even if the framework based code is better, that's not enough to justify the complexity. I need to justify taking an application out of the realm of someone who understands the basic servlet spec and putting it into the realm of only those who have read and digested an additional 600+ pages of Framework complexity.

Thing is, I like frameworks. You can read and digest 100 pages about Rails and really get going. So the bar for justifying the "added complexity" of a framework in the Ruby world is much lower than it is in the Java world. I don't use Python, but I'd imagine it's a similar situation - it's much easier to justify Django than the Java framework stack.

Re: Why I Hate Frameworks

#75
Was anyone else put off by "And, if you want to kill your ex-girlfriend, there's really no substitute for a ball-peen hammer"?

I get it's a joke, but violence against women, when used in a semi-professional context in a community of software engineers is one of those things that keeps more women out of the field in the long run.

I'm not trying to be PC intentionally -- it just struck a raw nerve for me.

Re: Why I Hate Frameworks

#76
post #54

Earlier quoted context omitted.

This also makes unit testing extremely diffcult since you have the joy of creating mock objects for your Context, ConnectionFactory and Connection. I have all but given up writing test code at work. The various j2ee frameworks I have to use make it almost impossible.

Drop Classic J2EE and learn Spring. It will make things sooo much easier and manageable.

No kidding. J2EE is an abomination, and is almost single-handedly responsible for destroying Java's reputation with a lot of programmers. Spring is a giant leap forward.

Grails is basically Spring MVC, wrapped in dynamic language goodness. I'm using it for a project right now, and it's shockingly terse and clean. It's also a lot of fun, which is something I never thought I'd say about a Java "Enterprise Framework".

Re: Why I Hate Frameworks

#77
post #44

Earlier quoted context omitted.

Because frameworks aren't optimized to your use case.

Hell, programming languages (typically) aren't optimized to your use case. You modify them to make them so. Good frameworks are the same way. I've already extended the hell out of Kohana to make it more useful to me. This is work I would have had to have done if I weren't using it, sure, but all the basic stuff is there all the same.

Sure, it just depends. Quite often, I've found that modifying someone elses code takes orders of magnitude longer, than just writing it yourself.

Re: Why I Hate Frameworks

#78
post #52

Earlier quoted context omitted.

Fundamentally, you need to learn your craft. I have just inherited a large project based on Hibernate. I dislike it because there is all this crap between me and the database. I am proficient in SQL as well as Java and I don't like masking a very powerful language with a weaker Java-centric abstraction. If you are going to develop backends you need to understand databases and SQL. If you don't you will end up with an…

Sorry to hear that you don't like Hibernate. I'm using it for a project right now, and I greatly prefer it to ActiveRecord. The trick is to use a framework (yes, a framework!) like Grails to autogenerate a lot of the configuration crap for you. I suspect that your large project was built by "Java Engineers" who tried to stuff way too much into the ORM layer. That's an abuse of the tool, not an indictment of the tool…

It was definitely done by "Java Engineers", but the ORM layer is pretty clean. My problem is that the Java way is very class-centric, not really OO. Why use a class at all, if all you have are getters and setters? It makes sense to me for the ORM layer just to build a list or hash from the result set. A class has no intrinsic benefit, because it's just a struct with extra baggage. One way to get the SQL complexity out of the way is to use a stored procedure, but as far as I can tell Hibernate doesn't support them.

Re: Why I Hate Frameworks

#79
post #54

Earlier quoted context omitted.

Drop Classic J2EE and learn Spring. It will make things sooo much easier and manageable.

It definitely does make the above more manageable, but it doesn't solve the core problem which is that the whole design pattern is built for complete configurability, but without sensible defaults. In some sense, Spring only exists to manage the massive configurability of Java design patterns, but by adding it's own configurations to the mix. It's definitely a cool idea, but the better solution is to just avoid facto…

"""It's solving a problem most of us don't have."""

I think that is because a lot of people simply don't know what good design is. I've seen many projects where people think they don't need Spring but where it made 100% sense. And made the project simpler and easier to manage and test.

Even in small projects it makes a lot of sense to have a good seperation in layers or services and to use a mostly invisible helper to glue things together.

Modern Spring can configure your app with a very minimal amount of XML. If you don't like XML then use annotation based configuration.

I totally disagree with your statement that Spring only exists to manage the 'massive configurability of Java design patterns'. The only patterns that the foundation of Spring introduces are IoC and 'configuration by convention'. Those have been proven to be extremely powerful patterns that simply allow you to burn half of the 'J2EE Design Patterns' books.

Re: Why I Hate Frameworks

#80

Over-complexity is common in the Java space. I was aghast at using JMS. You make a Context so that you can tell it to make a ConnectionFactory, so that you can then ask that thing for a Connection, then you finally get to login . You can then instantiate Producers and Consumers and finally get messages. Why do I need to have 5 different objects when one would do? Having 5 different objects did absolutely nothing for…

"""Over-complexity is common in the Java space."""

Yes, in a SPECIFIC area of the Java space.

There is a huge group of people who believe that J2EE and its complexities are a major pain the ass. That is why great frameworks like Spring, Guice or Stripes exist.

Sun loves you when you use J2EE/JSF/EJB/JMS/JWHATEVER. But there are serious alternatives that are more lightweight, easier and less intrusive.

Of course you will not add value (read: buy into) to the Sun Enterprise Ecosystem :-)

Staying away from (most) 'Enterprise' Java standards has worked very well for me. I really enjoy working in Java.

Post reply on HN