Slashdot Mirror


Java Development: Eclipse or IntelliJ IDEA?

Java_Good_COBOL_Bad asks: "For Java development, would most people recommend using Eclipse or IntelliJ IDEA? I am currently using Eclipse and it took a long time to get the environment set up. I understand that Eclipse is a framework that can be used for many things, not just Java development, but all I really need is an IDE for Java. So, I wonder if Eclipse is more complex than I need. I have never used IDEA before. Is it more straight-forward? Has anybody here migrated from Eclipse to IDEA? How steep was the learning curve?"

27 of 122 comments (clear)

  1. Let me see if I've got this straight... by Fished · · Score: 3, Interesting
    You've spent a great deal of time and effort to get Eclipse setup, and are apparently using it with at least some success. However, you are debating whether to switch to something with less features because you're not sure if you need all of Eclipses features. Therefore, you are proposing to go to a very different, but very feature rich programming environment that will cost money?

    Huh? If it's working, why switch?

    I bet you were one of those "vi" types back in the day, weren't you? No editor can ever have too many features: Emacs all the way!

    --
    "He who would learn astronomy, and other recondite arts, let him go elsewhere. " -- John Calvin, commenting on Genesis 1
    1. Re:Let me see if I've got this straight... by Otter · · Score: 3, Insightful

      I think his point is that he's still fighting with Eclipse, and is wondering if switching to something simpler might require less effort than continuing with Eclipse is going to demand.

  2. don't forget netbeans- "ide religion" by acomj · · Score: 4, Interesting

    If your doing java development netbeans is an option. Eclipse has forced it to become much better. Although it doesn't use SWT. I prefer eclipse, but have friends who swear by net beans. Unlike most people in this situation we still talk to one antoher (java ide's seems to cause religous battes, like vi vs emacs.. etc..). This kind of battles are silly.

    http://www.netbeans.org/
    http://community.java.net/netbeans/

    than there is sun's java studio...what is this?? I don't know , but its free now and seems to be yet another ide.

    http://developers.sun.com/prodtech/devtools/free/i ndex.html?cid=16052

    1. Re:don't forget netbeans- "ide religion" by junkgui · · Score: 4, Informative

      Sun java studio creator is netbeans 4.1 with some added propriatary plugins for drag and drop JSF coding... And eventually it should pull in nebeans 5.0 features as well. Drag and drop JSF is very important if you work in a shop that is constantly teatering towards ASP.NET because it is basically the same product. If you work with people who don't have the greatest skill set this can make them productive at building web gui, and netbeans/swing will always be better at building stand alone swing apps then eclipses attempts. Netbeans is much better then it used to be, but it is still occward in a lot of ways. The one standout feature that I like about netbeans is that ant is integrated into the IDE much more completely, there is no way to build a netbeans project without haveing a working ant script that can also be run on the command line. Other IDE's don't force your hand the same way, and I really hate projects that are not written in such a way that you can just check them out of CVS and build them/deploy ear files... Also netbeans 5.0 has a profiler that is still not working very well, but when it does work it will be a very nice addition. On the other hand eclipse is really very easy to work with, and works very well. The GUI is very nice and very consistent, but I think that swing has the possibility of being much better then SWT, so feel free to ridicule spelling errors in this post and call me an idiot.

    2. Re:don't forget netbeans- "ide religion" by owlstead · · Score: 2, Interesting

      Swing IS betten than SWT, but they do one thing wrong. Integration with the native OS. Eclipse has, at least superficially, a nice, consistent GUI with the native environment. Swing has become closer to this as well, but many applciations don't seem to default to the platform GUI (which is plain stupid) and every Swing application is making it's own choice, so even throughout Java applications, the look and feel is inconsistent. And the problem with emulation is that you are always running behind. They do try to solve this for Longhorn though.

      Eclipse works very well within Windows, and pretty well within Linux and Mac, due to SWT. I've tried to program in SWT however, and although it is pretty simple to get something up and running, the design of the thing leaves much to be desired. I mean, color constants in the main SWT class? What year is this?

      Eclipse works pretty well, and although it has grown to be a bit more difficult than before, it is still way more inuitive than most other IDE's. Check out the keyboard configuration, the setting up of your own formatting scheme, the keyword lookup in the configuration etc. And try a sample application first. It's not *that* hard. If you're on a fast machine, by all means switch on "Mark Occurences". You now know how to find it.

      Happy coding!

  3. IDEA all the way! by avalys · · Score: 4, Informative

    IDEA is the best IDE I've ever used. It automates pretty much every mindless code navigation/generation/refactoring task, but stays out of your way otherwise. Really, it's not so much an IDE - more an souped-up, heavily-Java-specific text editor. There are no wizards, and it never hides code from you. It just takes a lot of the tedious tasks out of coding.

    It's not hard to use, but the sheer array of features can take some time to discover and learn to use. It is very definitely "straightforward".

    Eclipse is not bad - IDEA is expensive, and Eclipse is a decent free alternative. But if you have the money, there's no reason not to use IDEA. Eclipse has always seemed to me like a poorly-executed IDEA clone. Similar to most open-source desktop software, really.

    And don't listen to the masochists who will tell you a text editor and the command line is all you need.

    IDEA has a 30-day free trial - why don't you download it and give it a spin?

    --
    This space intentionally left blank.
    1. Re:IDEA all the way! by dubl-u · · Score: 3, Informative
      Eclipse is not bad - IDEA is expensive, and Eclipse is a decent free alternative. But if you have the money, there's no reason not to use IDEA. Eclipse has always seemed to me like a poorly-executed IDEA clone. Similar to most open-source desktop software, really.

      I'd agree. I have used both extensively, and IDEA has always had a much better UI. For something that I spend many hours a day using, that's very important to me. It's sort of like the difference between the iPod and Brand X MP3 player. It's not that there's anything very wrong with most of the MP3 players, but there's something so right about the iPod.

      Note that they also regularly offer half-price personal licenses for people just doing their own thing.

      Eclipse has always seemed to me like a poorly-executed IDEA clone. Similar to most open-source desktop software, really.

      Yep! Another fellow opines that Eclipse is Bizarro IDEA.

      IDEA has a 30-day free trial - why don't you download it and give it a spin?

      I second that. Make sure you really use it for something serious, too, and take the time to learn some of the handy keystrokes and the more common refactorings. Ones I use at least hourly:
      • Ctrl-Q: show definition (and docs, if any) of symbol under the cursor
      • Ctrl-B: jump to definition of symbol under the cursor
      • Ctrl-Alt-Left Arrow: back to previous location (like back in your browser, it has a stack of visited edit locations)
      • Ctrl-N: find class by name
      • Ctrl-Shift-N: find non-Java file by name
      • Ctrl-Alt-Shift-N: find any method by name
      • Ctrl-Alt-V: extract highlighted expression as variable
      • Ctrl-Alt-N: Inline highlighted variable or method
      • Ctrl-Alt-M: extract highlighted block as method
      • Ctrl-F6: global symbol rename (does it via the parse tree, so variables or methods with the same name in different contexts won't be touched; if you rename a class or package, it takes care of all filenames and related import statements)
      • Ctrl-Shift-F6: change method signature (again, global based on the parse tree)

      If you're just a casual Java developer or find the price a big deal, then Eclipse is perfectly adequate. For me, though, it's very much worth the money.
  4. Hey! It is a reasonable question. by klahnako · · Score: 4, Interesting

    I use CodeGuide5, which's interface is optimized for dealing with Java and it's refactorings. I also have Eclipse installed, but I find it tedious to use because it is too generic. I keep Eclipse for it's most robust CVS client so I can access some temperamental CVS servers.

    I find it a valid question that IDEA is worth the few hundred dollars it may cost in order to have a more streamlined experience.

  5. Tough Call by GOD_ALMIGHTY · · Score: 4, Informative

    Depends on what you need to do, which frameworks your using. I've found IntelliJ integrates with a standard IDE-neutral build xml and custom tools like XDoclet much better than Eclipse. Eclipse demands that your project be built inside Eclipse to use any Eclipse tools. The default Java editor in IntelliJ is nicer than Eclipses as well.

    If you're supporting multiple developers, Eclipse can be easier to get people to standardize on, making debugging the dev environment easier. If your doing JBoss work, the Eclipse based JBossIDE might be nicer than IntelliJ, just because everything is setup already. Avoid Rational Application Developer at all costs though, it probably needs a couple of revisions before the IBM over engineering gets out of your way and lets you work.

    It's been a while since I've tried to do web framework stuff in IntelliJ, although it's always handled this a lot better than the plugins for Eclipse that I've seen, it never handled XDoclet integration well enough to deal with tag library and struts tags. That always made some nice features useless. Eclipse is just as bad, I've yet to see a good set of plugins that handle all the tools I use in a standard Java dev environment. Many of the plugins seem to expect things done the Eclipse way, or they become useless. I wouldn't mind doing things the 'Eclipse way' if that were synonymous with IDE-neutral, but until then, the Eclipse way won't cut it.

    The thing that annoys me the most about all these IDEs is the lack of imagination in tool-building. Very few graphical tools handle the IDE-neutral environment well, the wizards and syntax highlighting engines tend to be extremely inflexible. If my project needs JUnit testing, why wouldn't I do an automated nightly pull and generate a public report everyday? Wouldn't my IDE only be helpful if I could do the Unit tests outside the IDE, without figuring out a boatload of crypticlly stored dependencies?

    Anyway, I'd try each of them out with the particular features you need, and make sure to check that they will easily integrate other tools you'll need. Java IDE's could be a lot nicer. Both Eclipse and IntelliJ have made great improvements, but this is more a half-way point than anywhere near a victory lap.

    --
    Arrogance is Confidence which lacks integrity. -- me
  6. What do you consider "a long time?" by Evro · · Score: 2, Insightful

    After downloading the JDK and Eclipse and setting the CLASSPATH and JAVA_HOME vars, all I had to do to get Eclipse running was type ./eclipse. So what's your idea of "a long time?" Why don't you just try IntelliJ and see if you like it? Nobody else's opinion is really going to be much help in a "what's better?" debate anyway.

    --
    rooooar
  7. Java IDEs by Khanar · · Score: 5, Informative

    You should also at least look at NetBeans.

    Anyway, I have used all three of the big Java IDEs.

    While they all share the same basic functionality, like great refactoring, ANT, and JUnit support, each has some areas it excels in. I would say IntelliJ is slightly better than eclipse (the free version, I have never used IBM's eclipse based environment), and both of these I prefer over NetBeans.

    The main reason I prefer IntelliJ (if you can afford it) is that it has more useful shortcuts, more intelligent formatting capabilities (if you press enter while in a quoted string it will automatically insert the needed quotes and plus sign and place the rest of the string on the next line, and back again).

    One feature I really like, that from what I remember is only in Eclipse, is incremental building. The other two require you to hit a build button before hitting the run/debug button. Not that I'm lazy, but you really get used to it building automagically when you hit save. One thing I find kind of annoying about Eclipse is that it doesn't include support for say, xml editing, which the other two support out-of-the-box, instead requiring you to go to their site and finding web-tools plugin. Also the internal parser used for error marking often requires saving the file before it will refresh the markings on the page.

    The reason I put NetBeans last, is that it doesn't include quick fix suggestions. Its nice to be able to hit a couple of keys and have the IDE suggest and fix simple problems without having to look at a reference, or moving a bunch of code around.

    From my experience all three of these IDEs take about the same amount of setup when you get passed simple applications, so if you had trouble with Eclipse, I don't think IntelliJ or NetBeans will be much simpler.

    There is always javac I guess.

    1. Re:Java IDEs by Westley · · Score: 2, Interesting

      One thing to note: Eclipse has had the "press enter while writing a string" functionality for a little while. I think it came in the 3.1 series. That's one of the problems of comparing these IDEs - I know that Eclipse develops pretty quickly, and I'd imagine the other two do too. Keeping up with what each can do would leave little time left for coding!

    2. Re:Java IDEs by Flwyd · · Score: 3, Interesting

      One feature I really like, that from what I remember is only in Eclipse, is incremental building. The other two require you to hit a build button before hitting the run/debug button. Not that I'm lazy, but you really get used to it building automagically when you hit save. One thing I find kind of annoying about Eclipse is that it doesn't include support for say, xml editing, which the other two support out-of-the-box, instead requiring you to go to their site and finding web-tools plugin. Also the internal parser used for error marking often requires saving the file before it will refresh the markings on the page.

      For me, this is perhaps the nicest feature of Eclipse. Most of my day is spent making changes to one file at a time, then testing to see if it worked. Our enterprise application consists of a server run out of a servlet container (Tomcat usually) and a Java client. It often takes half a minute to start Tomcat and the server and it takes a minute or two to launch the client, log in, and get to where you want to be. Incremental building and hot code replace mean that I can fix five bugs and try fifteen solutions to another problem without a single process dying. On some days the productivity gain is more than a factor of two.

      And I agree with another commenter -- if you've already spent a lot of time setting Eclipse up, why switch now?

      (Having just created a branch workspace, I'm rather disappointed with how few settings travel with you when you say "Export All Settings" in Eclipse. Why would I not want my annotation and text coloring to be the same? Why would you not remind me I need to export my code formatter? Why would you not export my code templates?)

      --
      Ceci n'est pas une signature.
  8. I migrated, haven't looked back by slick_rick · · Score: 2, Interesting

    I used Eclipse originally and then migrated to IDEA because Eclipse kept crashing on me (to be fair, this was probably Debian Unstable's fault, not Eclipse). To be honest I really prefer the IntelliJ enviro. At the time it did a lot of things out of the box that Eclipse did not (like show me errors in my Javadoc comments, integrate extremely smoothly with Tomcat, gracefully handle JSPs, etc). Eclipse could probably be bent to do all these things with various plugins, but my IDE is one thing i really don't want to futz with all that much.

    That was two years ago, and to be honest I haven't had much urge to check on how Eclipse is doing these days. I liked it when it wasn't crashing, and for the price you can't beat it... But when your company is picking up the tab and you just want it to work, you can't beat IntelliJ with a stick :-)

    --
    apt-get install redhat please god - Me (take it easy, I love Debian)
  9. Alternates to background assumptions by iaminthetrunk · · Score: 4, Insightful
    I am currently using Eclipse and it took a long time to get the environment set up.

    Respectfully, in addition to asking which IDE to use, you should be asking yourself why this is. Particularly if you do not work in soloist isolation, collaborating with a colleague is in your best interests - you should have asked a college with expertise to assist you. If you are not fortunate enough to be in a master-apprentice relationship with a more experienced colleague, you ought at least shift your automatic frame of mind towards the collaboration of a working group. You could later repay with collaborative expertise in a particular subset of specialty you possess. Even in open source projects, such instincts for teaming and efficiency will serve you well. Your question has been good, but it's basis is suggestive an compartmentalized perspective or environment that may be at least as important to ponder as the finer points of IDE efficiencies.

    Has anybody here migrated from Eclipse to IDEA?

    I work with both simultaneously. Both are adequate workspace environments, relatively easy to migrate and setup(*). However, I find it more interesting to redirect to asking if have considered using both IDEs for their strengths, if costs permit. After migrating, I found no need to actually choose between them, and would ask you if your post hides a false framing question, implying a binary choice when other options exist. You need not fully setup a project in an IDE to reap many of the benefits of it's use. You may load a single source file and still perform a fairly broad number of powerful actions. (As other will no doubt point out, the mix of refactorings offered between them varies, it can be pleasing to utilize both for a combined pool of available IDE refactorings.)

    With Murphy as my witness, I currently have Eclipse, Visual SlickEdit, NetBeans, and IntelliJ installed. I use Eclipse for a subset of some of it's refactorings, SlickEdit as needed for things such as horizontal column cuts and power-editing macro recording/replay (the other IDEs simply don't provide these features suitably), and IntelliJ for most development. NetBeans I confess to not much using; I've tried JDeveloper on a colleagues box. Such evaluations are useful - an IDE with even one or two favorable unique features easily run on singleton files repays the exploratory time.

    That you may not wish the setup costs is a valid point, as is ability level at maintaining familiarity with multiple IDEs, however the counterpoint here about maximizing efficiency by selection and mix of the right tools, and about continual learning, are, I think, valid. In both regards to increased colleague collaboration and avoiding binary choices to build a robust mix of tools, please consider keeping an active mind.

    (*) There are some occasional stray bits of migration errata in either direction, but nothing severe. For instance, Eclipse awkwardly roadblocking on, say, encountering a mixed case windows directory vs an all lowercase Java import. That was bad coding by a third party developer, but an awkward case to workaround in Eclipse that IntelliJ handled smoothly. Both are good IDEs, IntelliJ is perhaps a bit smoother and more robust.

    --
    "The hottest places in Hell are reserved for those who, in times of moral crisis, preserved their neutrality." -Dante
  10. Tried it, didn't like it by Will+Sargent · · Score: 2, Interesting
    I didn't like the Java editor. There are many things that IntelliJ does differently, but there are very few things I could say that IntelliJ does that Eclipse doesn't in the Java editor. At least for 4.5.4. I have no experience with 5.0.

    However, the JSP and XML support in IntelliJ freaking rocks. Live templates combined with the IntelliJ JSP editor is enough that I switch out of Eclipse to IntelliJ whenever I have to edit JSP, even though I have WTP installed. I've been told that JDeveloper and Netbeans also have JSP editor support, but haven't looked at them closely.

  11. Eclipse: great, but sucks. by clambake · · Score: 4, Interesting

    Eclipse has a billion and one plugins, it runs on all platforms, it's awesome... Oh, but also it sucks. Absolutely anti-intuitive (perhaps holdover from it's IBM days? IBM couldn't design a UI to save thier lives). Inconsistancy, primarily, is my main beef. In one set of menus, FooBar is right on top, but on another it's two levels deep, but on the right-click context menu it's three levels deep in a completely different heirarchy... on one pane, but on another pane the right-click context menu for FooBar it's only one level deep, but is named slightly differently. It makes it's a nightmare to find what you are looking for even when know exactly what it is...

    1. Re:Eclipse: great, but sucks. by angel'o'sphere · · Score: 2, Interesting


      Eclipse is a pretty intuitive IDE.

      Intuitive means yoou don't need to learn it, it works just so. And if you already have used it for a while you don't have to remember any features you already used because they are right there where you need them.

      Eclipse is anything but intuitive!

      E.g. how many ways are there to create a new project and connect it to a CVS repository? And why does only ONE of those many ways work correctly?

      The way how classpathes and libraries work is a compete mess. Why can't it be simple as saying: put this *.jar into classpath?

      As I mentioned in the other post: why does every plugin need its own perspective? Most of the stuff simply should be done in the "navigator" where you see "files". Ther eis no special "java package view" needed, but I'm forced to use it often because a lot of commands are only there.

      Basically the only 2 perspectives beyond "navigator" making sense are CVS/version control and debugging.

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  12. Why not answer your own question? by darkpurpleblob · · Score: 2, Informative
    So, I wonder if Eclipse is more complex than I need. I have never used IDEA before. Is it more straight-forward? Has anybody here migrated from Eclipse to IDEA? How steep was the learning curve?
    Why don't you try for yourself with a 30 day trial of IDEA?
  13. Re:Easy by okki · · Score: 2

    Why does netbeans suck, please elaborate... I really had no problems with Netbeans at all. It got me going with mobile phone java development. I started using Eclipse about three years ago and loved it immediately, now I had a similar experience with Netbeans. Especially because Eclipse is a little weak on the GUI side. Mostly what I would suggest is to see what you will be developing for, what types of apps you want to maken, and then decide what IDE you require. Sometimes vim is enough, even for java developent.

    --
    -- okki nothing more to say
  14. Free not always the issue by Wabbit+Wabbit · · Score: 2, Interesting

    Well, I mostly agree, but as someone who codes for a living, the cost of IDEA is more than worth it. I've used them all, and while Eclipse has gotten better, and is now (at least for me) actually *usable*, I find that I can just fly with IDEA.

    But this really is a Religious War (tm), and as such there's no Right Answer (pat. pend.)

    --
    Nothing is inexplicable; only unexplained -Tom Baker, Doctor Who
  15. Re:Try these... by owlstead · · Score: 2, Informative

    Dr Java has a shallow learning curve because it is simple. TOO simple. I would never use an IDE anymore that only does syntax coloring. All three main Java IDE's (IDEA, Eclipse and Netbeans) parse the text you type by default. This means you can easily see what's a local variable and what's a field. See if your application contains unreachable code, bad switches, bad expressions and of course on the fly refactorin.

    Especially Netbeans will support additional code checks in the future (think checking if your regular expression or printf statements are valid (IF they can be checked). This is the future for source based IDE's. I would *never* use an IDE that does not keep an abstract syntax tree up to date in the background.

    That said, Dr Java does seem to have an nice place to run test code in. I would love to see somthing better than "java (s)crap pages" in Eclipse. Say, a nice beanshell plugin that can also run in parallel with the debugger.

  16. Future "Ask Slashdot" Q: Catholic or Protestant by egriebel · · Score: 5, Funny

    Dear Ask Slashdot: I am currently an Agnostic, but I've read a lot about this "Jesus" thing on the internet and it sounds really cool!! Although I don't plan to now, I would like the option to sin, and I would prefer something that keeps my weekends free because I really like to sleep in. I've read a little bit about Catholicism and it seems interesting, and I've looked at Judiasm, but I think I would have a problem fasting for a whole day even though eight days of gifs would be neat. Hopefully someone can point me in the right direction!
    ====
    Will we actually see this on Ask Slashdot? Well, why not have a real religious argument, that would probably be less controversial than what IDE to choose!!

    --
    ACHTUNG! Das computermachine ist nicht fuer gefingerpoken und mittengrabben. Ist nicht fuer gewerken bei das dumpkopfen.
  17. Re:Easy by nacturation · · Score: 4, Insightful

    Eclipse == free
    IntelliJ == NOT free

    That's enough for me right there.


    Is that how you make all your decisions?

    No condoms == free
    Using condoms == NOT free

    Cost/benefits analysis... more than just a buzzword!

    --
    Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
  18. I've used both in the workplace by malachid69 · · Score: 3, Informative

    Personally, I have used both in the workplace. I have found IntelliJ to be:
    1) more expensive
    2) more intuitive
    3) more reliable (ie: searches in Eclipse regularly left items out)
    4) faster

    I would say that #1 is your deciding factor. If you are willing to spend the money on it (you can usually get it for 1/2 price for a Personal copy -- and free for open source projects), it is a much better product.

    Some will argue that Eclipse is better because of the fact that it is open source. As much as I prefer open source software, I was willing to spend the money on IntelliJ for home because of #2-#4.

    Some will likely point out that #3 just means that I was likely doing something wrong. It wasn't just me - it was the entire team. At the time that I noticed this deficit (last year), the entire work team was required to use Eclipse; and a few of us switched to IntelliJ (and honestly a couple to JBuilder as well; no one switched to NetBeans, though we tried it) because all but 1 of us despised how Eclipse performed.

    If you aren't looking for something with all the bells and whistles, you might just want to go with a much cheaper solution like JCreator (which I also paid for) -- but I personally would recommend IntelliJ.

    --
    http://www.google.com/profiles/malachid
  19. Does It Have To Be Integrated? by ObsessiveMathsFreak · · Score: 3, Informative

    I've never been a huge fan of Integrated Development Enviornments. The learning curve is usually quite steep, each has its own peculiarities, and each does things you originally had no intention of doing.

    Case in point, Anjuta, on the creation of a new app, creates a 500K config file and I have no idea what it's doing. Each IDE also has a tendency to create its own directory hierarchy, make file or equivilent, and if versioning is included, will pick its own scheme.

    What this usually entails for me is loss of control over the project. I sort of feel trapped within the IDE, and unable to get out. The Visual Studio effect; I don't know where my code ends and the automatically generated stuff begins.

    As such, I prefer keeping it simple. I use a bare text editor where possible. Syntac highlighting is a must for me, and I've found very few editors that do this correctly. Emacs will work if your colour scheme is OK, but Emacs is a quasi-IDE to begin with.

    I find writing computer programs to be just that. Writing. It's a personalised sort of thing. A few personally written shell scripts, a handmade makefile, the command line and a decent editor can go a long, long way. You are intimately aquainted with all aspects of the project. On the downside, you are intimately aquainted with all aspects of the project.

    Your milage may vary, considerably. But before you begin to use an IDE, as what it is giving you, good and bad, that a personalised DE is not. There's a trend towards monolithic IDE programs that do it all in one, but do they really deliver on their promise. Are you really more productive. Your troubles with Eclipse could be symptoms that IDE are really not for you.

    --
    May the Maths Be with you!
  20. Re:Easy by orasio · · Score: 2, Funny

    Free as in Freedom.
    The sexual metaphor is:

    Girlfriend: you can get them for lots of money (nice car, good clothes, Kenzo parfum, drinks), or no upfront cost, but it has hidden costs all over. You _will_ get screwed.
    Drunk girl at the bar: FREE

    Condoms are not optional.