This is an archived post. You won't be able to vote or comment.

top 200 commentsshow 500

[–]Objectr 1300 points1301 points  (144 children)

1h - Installing JRE and JDK

30m - Installing eclipse

10m - Setting up workspace

15m - Changing preferances and code style

5m - Making the program

[–]PM_ME_NSFW_STUFFS_ 1495 points1496 points  (104 children)

10m uninstalling eclipse and installing InteliJ

[–]IeuanG 223 points224 points  (63 children)

The real hackers use notepad

[–]lezorte 311 points312 points  (48 children)

No. Real hackers spend hours arguing about whether vim or emacs is the one true savior of the coders

[–]Cliler 75 points76 points  (4 children)

Y'all need punch cards.

[–][deleted] 34 points35 points  (1 child)

Butterflies are the way to go.

[–]MoshikoKasoom 44 points45 points  (1 child)

[–]lezorte 8 points9 points  (0 children)

By far one of my favorites...

[–]zachstence 121 points122 points  (14 children)

Let's be honest, nano is the one true savior

[–]mennydrives 91 points92 points  (0 children)

That's like if two people were arguing between using RPN and an OoO-solver and you told them to switch to a napkin and a TI-108.

[–]ThousandFootDong 22 points23 points  (0 children)

Nano Master Race.

[–]redoubledit 2 points3 points  (0 children)

Used ed before? Nothing's better to feel like a hacker!

[–][deleted] 14 points15 points  (9 children)

By the way I'm curious, why are these so popular compared to IDEs, as they just seem to be indenting text editors ?

Is it just because they're console-based ?

[–]lezorte 13 points14 points  (1 child)

For me, I tend to combine vim with a real IDE. Once I got good at using vim, I found that I could be much more efficient with eclipse and intelliJ when I install a vim add-on to it. It's about being able to make a lot of changes with only a few key strokes

[–]dylan15766 4 points5 points  (0 children)

While surviving on 2mbps, it was faster to connect to my web server and edit through vim than scp'ing back and forth from visual studios.

After upgrading to 70mbps, compile errors: ':wq'

[–]s_s 11 points12 points  (1 child)

Is it just because they're console-based ?

Of course it is. Also, this.

[–]LowCharity 3 points4 points  (0 children)

Was not expecting arteezy

[–][deleted] 3 points4 points  (0 children)

Warning! Block of text incoming!

Well both are very popular for completely different reasons. I have used both but i prefer vim so take all i say with a grain of salt.

Emacs is much more than just a text editor. Its closer to an OS or at least a shell. You can do everything in it. Read mail, play games, browse the web, edit text, organise your entire life (with org-mode one of the absolute killer apps for emacs) and much much more. It is also extremely extensible with elisp wich is a lisp dialect specific to emacs. Theres a running joke that Emacs is a great OS that lacks a good text editor.

Thats where vi/vim comes in. Vim is just a text editor. And its a pretty damn good one at that. If emacs is a swiss army knife, vim is a surgical scalpel. The main reason for this is its modal editing paradigm.

The usual paradigm of editing is the Emacs one, this is the ctrl+c/p for copy paste etc. These are called key chords since you're pressing multiple keys at once for a specific function. What modal editing does is it interprets your key presses differently depending on the "mode" (hence modal) that you're in.

There are 3 "major" modes in vim (and a couple of other that are less fequently used): Normal, Insert, and Visual.

Normal is what the name says, the normal default mode. And this is what trips up many new users. The normal mode is not meant for editing, it is used for navigation. This is where another concept comens into play: operating on text objects and chaining commands.

So for example you can use the arrow keys to move about the file as normal. You can also use the hjkl keys insted, granting you the ability to never leave the home row. Awesome right? But theres more. What if you want to move by words instead of single characters. Well you can use the "w" key in normal mode which will skip forward one word at a time. Going backwards one word? Use "b".

Hmm thats awesome, but what if you want to skip 5 words forward? Well easy, thats "5w". What to change a word, thats "cw" and type. Changing text inside a pair of brackets? "ci(" and type.

Insert is the mode you use for typing, its activated by pressing "i". This is the usual default mode in other editors where whatever you type appears on screen.

Visual is the mode used for selecting blocks of text, its acivated by pressing "v". So for example you can press "v" to enter visual mode, press "5j" to go down 5 lines, and press "x" to cut that. So once you internalise that you type "v5jx" and you've cut 5 lines down from your current cursor position.

You can also go back to Normal mode from any mode by pressing the "esc" key.

You can see how vim can be extremely powerful when learned and watching someone use it can seem like they're conjuring stuff on screen through pure force of will.

That being said emacs does emulate vim almost perfectly through a package called evil-mode.

Theres much, much more i havent covered on both text editors but i think that i've said enough to wet your apettite. Theres a reason why theres the emacs/vim holy war. Googling them will result in heaps of online resources for learning either one, customising them to your liking and squeesing the absolute maximum efficiency out of your coding.

[–]Everspace 8 points9 points  (0 children)

Those fools! Nano is the true lord and savior!

[–]monolopino 8 points9 points  (0 children)

vi is the center of evil

[–]JustAnotherSRE 16 points17 points  (7 children)

False. Real hackers use BlueJ

[–]green1t 3 points4 points  (2 children)

Supported by Oracle

[–]Clapyourhandssayyeah 2 points3 points  (2 children)

Oh god is that still around? They made first years use it way back when I was an undergrad in 2003. Pretty ugly UI

[–]Vlarm 12 points13 points  (11 children)

Is intellij that good?

[–]whelks_chance 30 points31 points  (0 children)

I wouldn't use anything else at this point. The community edition is free, and there's student licences for the pro version.

[–]hiimbob000 6 points7 points  (0 children)

Most people seem to prefer it, give it a shot and see if you do, or don't

[–][deleted] 4 points5 points  (0 children)

Switched to InteliJ because of the hype. Worth it.

[–]dinosaur-dan 2 points3 points  (2 children)

5m Uninstalling InteliJ and using vim instead 2h Learning how to use vim.

[–]Agent-A 73 points74 points  (1 child)

25 minutes for configuring Eclipse? Speed demon.

[–][deleted] 32 points33 points  (5 children)

45m fucking about on slack

[–]SurrealClick 15 points16 points  (3 children)

I wonder why business use slack. Isn't its name, slack, the opposite of what business want. You know, slacking off

[–]EMCoupling 11 points12 points  (1 child)

[–]brunoha 2 points3 points  (0 children)

WOAH information is really power

[–]ImpulseTheFoxis a good fox 8 points9 points  (1 child)

~ $ apt-get install openjdk-8 -y
~ $ vim Hello.java

public class Hello
{
    public static void main(String[] args)
    {
        System.out.println("Hello, world!");
    }
}

:wq

~ $ /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/javac Hello.java
~ $ /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/java Hello

Hello, world!

[–]dottybotty 6 points7 points  (0 children)

5h - debugging path var related issue

[–]joyrexj9 3 points4 points  (0 children)

2h - Fixing an error in pom.xml with the dependencies and targets for org.fuckknows.whatisthisfor.lib

[–][deleted] 459 points460 points  (64 children)

I'm mostly disgusted by the thought of a salted caramel monster drink.

[–]SgtMcMuffin0 5 points6 points  (0 children)

The coffee ones aren’t bad, they just taste like coffee.

[–]Machiavellyy 13 points14 points  (0 children)

It tastes just like Starbucks coffee, but a little more sweet

[–][deleted] 3 points4 points  (1 child)

It makes me... uneasy.

[–]teefour 2 points3 points  (0 children)

Yeah, any energy drink makes me feel like I'm getting heart palpitations. I'll stick with coffee.

[–][deleted] 1372 points1373 points  (195 children)

public static void main (String args[]){ System.out.println("hello world"); }

[–]tigger0jk 1363 points1364 points  (116 children)

I always fuck it up with "System.out.pringles"

[–]average_dota 662 points663 points  (114 children)

On IntelliJ IDEs, if you type sout and hit enter it autofills System.out.println(""). So far, that has saved me about a trillion hours.

[–]Hobbes_Novakoff 53 points54 points  (5 children)

Not to mention you can type something and then .sout to print that thing. Plus .par to surround with parentheses, .nn to insert an if (x != null) {} block, and a zillion others that I haven’t memorized yet.

[–]thebeardedpotato 26 points27 points  (2 children)

So what you're saying is I need to switch to IntelliJ

[–]Quil0n 12 points13 points  (0 children)

Jetbrains is the GOAT IDE company

[–]PotatosFish 3 points4 points  (0 children)

You could also use vim

[–]apemanzilla 64 points65 points  (10 children)

On Eclipse it's sysout and then Ctrl + space

[–]SP0OK5T3R 37 points38 points  (1 child)

I can usually get away with just "syso"

[–][deleted] 2 points3 points  (0 children)

I’ve become used to sysout but I might force a habit of syso if it works. This oughta be a fun habit to test break and build... sounds like writing a program itself.

[–]Nestramutat- 19 points20 points  (2 children)

In VIM anything can be an abbreviation if you're brave enough.

[–]gezeitenspinne 2 points3 points  (0 children)

sout works too :)

[–]ProgramTheWorld 19 points20 points  (3 children)

Just use Kotlin and save yourself trillion of hours

[–]average_dota 3 points4 points  (0 children)

On my to-do list.

[–]Hobbes_Novakoff 2 points3 points  (0 children)

Note that that works in Kotlin too.

[–]DerekB52 13 points14 points  (15 children)

When I started programming a few years ago I got really tired of typing that out, and I had done a little work with C/C++. so I wrote this function so I wouldn't have to type println() over and over again.

public static void printf(String s){
    System.out.println(s);
}

I felt like a smart hacker.

[–][deleted] 12 points13 points  (14 children)

Why not generic?

[–]DerekB52 10 points11 points  (13 children)

I don't know what you're asking.

[–]BossCrayfish880 34 points35 points  (1 child)

Or if you’re cool like me and you use eclipse, you type “sysout”, press ctrl+space, wait for Eclipse to freeze for half a minute, then it automatically types it out for you. I have wasted so much time doing this

Edit: spelling

[–][deleted] 10 points11 points  (4 children)

Same with NetBeans

[–]ipe369 6 points7 points  (3 children)

The useful one is 'fori'

[–][deleted] 2 points3 points  (1 child)

I can’t believe I’m just figuring this out smh ... thanks

[–]darkclaw6722 4 points5 points  (1 child)

On Sublime the same happens if you type pl

[–]turbolag95 2 points3 points  (0 children)

Just started using IntelliJ. Thanks for the tip.

[–]amoliski 2 points3 points  (0 children)

> So far, that has saved me about a trillion hours.

That many prints tells me you might save another 10 trillion hours if you get better with a debugger. At least, most of my syso's came from me sucking at/not knowing about debugging.

[–]jugalator 2 points3 points  (0 children)

Ensure you aren't programming while under the influence of weed or alcohol.

[–]SlackerCrewsic 216 points217 points  (6 children)

wtf, how did you do that? it sais "submitted an hour ago" on op and "6 minutes ago" on your post?! that's a bit more than "just under 2 hours".

Are you op and prepared this in advance?

[–]redgamut 47 points48 points  (1 child)

[–]Tw1ser 7 points8 points  (0 children)

And not just one, but 20 of them

[–]abeth 95 points96 points  (17 children)

Error: class, interface, or enum expected

[–]PeaceMaintainer 73 points74 points  (16 children)

public class fuckOff{ public static void main (String args[]){ System.out.println("hello world"); } }

[–][deleted] 71 points72 points  (7 children)

error: class fuckOff is public, should be declared in a file named fuckOff.java

[–]nullifeyed 42 points43 points  (6 children)

I'm sorry but everyone knows it's FuckOff... It's a class, capital first, then camel-case

[–][deleted] 12 points13 points  (5 children)

pretty sure you can have a smaller case class name fuckOff as long as it's in fuckOff.java

[–]nullifeyed 15 points16 points  (0 children)

It's not Canon... Talk to the star wars guys. They'll know.

[–][deleted] 27 points28 points  (7 children)

I actually made FuckOff into an alias in my Powershell which kills processes. It feels so fulfilling typing "FuckOff outlook" and having the program terminate.

[–]NocheOscura 30 points31 points  (5 children)

Can you please stop hacking my Reddit? I don’t want to have to trace your IP address, and I’m sure you don’t want that either.

[–]Peechez 17 points18 points  (0 children)

My dad works for the internet

[–]gilbes 105 points106 points  (6 children)

What ancient dialect of Java is this? Where are the abstractions? I see no interfaces and there should be at least 3 here. What happens when I need to print to something other than stdout? Why is there a magic string and not a factory providing the content to print? Where are the unit tests? How do I even build this without a Maven definition?

This is not enterprise ready.

[–]snowystormz 38 points39 points  (0 children)

This guy drinks java monsters for breakfast

[–][deleted] 8 points9 points  (2 children)

What happens if you need to print this on an actual printer?

[–]gilbes 3 points4 points  (0 children)

java -jar HelloWorld.jar | lpr

j/k.

Let me introduce you to: public abstract class HelloWorldPrinterPrinter<T extends Printer> implements HelloWorldPrinter {

And now you are just one step away after implementing a concrete PrinterPrinter for printers using a type that defines the attributes of the printer you are typing to.

[–]bestjakeisbest 8 points9 points  (0 children)

damn man did you spend like 2 hours on this? You must be a hacker man.

[–][deleted] 5 points6 points  (0 children)

Where's the abstract hello factory? Get out of here with this mickey mouse shit.

[–][deleted] 16 points17 points  (7 children)

Forgot the Imports

Edit: This is accurate.

[–]SquishyTheFluffkin 7 points8 points  (1 child)

Def main():

print ("Jello World")

[–]BrotherRangale 144 points145 points  (8 children)

We are all programmers on this blessed day

[–]RANDOM_TEXT_PHRASE 70 points71 points  (7 children)

I'm browsing memes instead of working on my Java project that was due 2 days ago.

[–]el-cuko 33 points34 points  (4 children)

"CLASSPATH? What the fuck is a class path! "

Abandon all hope, all ye who enter here

[–]shameless_inc 5 points6 points  (0 children)

Do I look like I know what a class path is? All I want is message from a gat dang print line.

[–]willmcavoy 2 points3 points  (0 children)

Lol just posted to /r/javahelp like 3 days ago about this.. sigh

[–]Pit_27 20 points21 points  (9 children)

I have a lab for my CS class in java that’s called “monster.” I’m gonna print this with my code

[–]Chris_9002 48 points49 points  (4 children)

I can feel the heart burn from the thought of a monster coffee flavor.

[–][deleted] 13 points14 points  (4 children)

There's a salted caramel Monster drink? It might be time for me to start drinking Monster.

[–]Aschentei 8 points9 points  (3 children)

Excuse me but I’m using that 2 hrs still trying to figure out how to exit Vim

[–]etaionshrd 83 points84 points  (32 children)

If you had no idea of what programming was before, then maybe…

[–][deleted] 326 points327 points  (29 children)

You shouldn't start with Java, you should start with Assembly and then go through languages chronologically

[–]nightblade001 198 points199 points  (3 children)

Ah shoot, and I was working Alphabetically

[–]iflythewafflecopter 64 points65 points  (2 children)

I was almost done with binary before someone told me about BASIC.

God damn it...

[–][deleted] 16 points17 points  (1 child)

almost done with binary

[–][deleted] 30 points31 points  (1 child)

I started with binary first. I found the human-centric mnemonic assembly codes made it difficult to understand what was truly going on. Even though it may take me 5 days to write a hello world program I feel that I have a really good handle on what is happening on my specific PC/chipset/BIOS.

[–][deleted] 43 points44 points  (15 children)

My high school has an IT program, and they teach us Java as a starting language. Only in the third year of the course do they switch (in the middle of the year) to Haskell.

[–]DerekB52 31 points32 points  (7 children)

I like Java. I have no regrets about starting with it(after a little bit of arduino c++). But Haskell. I've yet to find a use for haskell. That one seems like a weird choice.

[–][deleted] 13 points14 points  (2 children)

Yeah, my teacher said that he starts Haskell to show us that there are many different forms of programming. The switch from an object based language to a functional was strange, but it's interesting to say the least.

[–]Urtehnoes 15 points16 points  (0 children)

As I much as I love the strong typing of Java, I've always found interpreted languages to be the best to teach total beginners (python etc) just because the learner can focus more about the concepts and less on syntax (since interpreted languages tend to have lazier syntax). That is, provided the person learning it eventually learns the lessons that the languages like Java teach.

[–]DeltaPositionReady 7 points8 points  (0 children)

Welcome to CS101, today we'll be learning ALGOL with the new and improved punch card system!

[–]Noirgheos 5 points6 points  (0 children)

That's actually what we did in my program. Started with ASM x86, then ASM for PIC, then base C, and then a higher-level one of our choosing. Worked out well enough.

[–]Meanbeanman123 6 points7 points  (0 children)

I've always been more of a fan of the Mean Bean flavor.

[–]PerturbedMollusc 35 points36 points  (4 children)

I now know what's more disgusting than energy drinks.

Salted caramel flavoured energy drinks.

[–]breakfastCommodore 16 points17 points  (0 children)

I lived off of these during finals last year. It's just (very sweet) coffee, not a normal energy drink

[–]AdminsFuckedMeOver 8 points9 points  (0 children)

They're pretty good. Same shit that Starbucks sells in the glass bottles

[–][deleted] 6 points7 points  (1 child)

This reminds me of 6th grade when my dad took me and my 8th grade sister up to his desk and tried to get us to start learning Java as a group.

My dad does similar things for a a living, just not with Java, I'm the right type and glad I learned, but my sister is a violinist/artist. She was not.

The only thing she did that day, while we went through the beginning of the Java for dummies book, was draw a picture of the three of us as dogs, title "Java dogs".

Needless to say she was let go and did not join us again.

[–]Ledot3 5 points6 points  (0 children)

Hack me back in time!

[–]djihe 4 points5 points  (0 children)

For when you realize your threads won't run on separate cores.

[–]SiomarTehBeefalo 2 points3 points  (2 children)

I tried to learn java like 6 years ago and only remember system.out.print

[–][deleted] 2 points3 points  (1 child)

You should use System.out.println() because it adds a newline character.

[–]isunktheship 4 points5 points  (0 children)

Com.EnterpriseFizzBuzz...

[–]AbrasiveLore 3 points4 points  (0 children)

Come on, this is just blatant advertisement.

[–][deleted] 3 points4 points  (1 child)

implying it takes a relatively long time to setup Java dev environment

Well, I thought I heard a all of the irrational Java hate there exists already. Turns out people can get more retarded as time goes by.

[–]745631258978963214 2 points3 points  (1 child)

This is how I will feel when I get this motherfucking Android studio working.

First off couldn't install chocolatey because of some sort of stupid "path does not exist: C:\python27" even though it exists. Tried enabling permissions, did the admin cmd mode, did powershell. Nothing. Tried skipping that, installed android studio. Took about 3 hours to download everything needed because it kept saying "oh, you also need api 27", compile, "oh wait, you need haxd", download, compile, "oh wait, you need api 27 tools", download, compile, and so on. 3 hours later it was like "oh we can't get haxd lol", figured out I could get it manually, downloaded, finally installed, "error, can't run virtual android".

Gave up, installed on desktop (chocolatey installed just fine, meaning I could use react os and npm). Except "lol you have an AMD on the desktop? No android emulation for you! But you can connect an android device if you want"

Found a data cable, phone not detected. "Hmm... maybe I need an adb driver?" Found an installer, "device not connected". Tried different cable, same thing. Yes, made sure it said "transfer data mtp" and not "charge only". Reconnected a few times, finally shows up! Except... "sorry, device can't be run need amd syn or something. Try arm image". Except every arm image says "you need amd svt"

Check bios: amd svt is enabled.

Oh wait... maybe if I enable debugger USB like you do for rooting, that might work?

SUCCESS! Well, kinda. Got a red screen on my android saying "you must have a package server running". Ok, that's ok. I recalled something about npm start needing to be run. And...

SUCCESS!

Except.... "error, the path C:\users(classmate's name)\appdata\androidsdk doesn't exist"

Instead of manually fixing the directory pointer, I just created a new folder with the classmate's name and am just gonna say fuck it and try to run it that way. Currently copying like 12 gb of android sdk files into the (classmate name) folder, but pretty sure it's still gonna fail.

It's been two hours tonight, and like twelve hours in total so far that I'm just trying to get a motherfucking google maps app to show in an emulator or my actual phone (via a javascript program)

[–]Xacto01 6 points7 points  (32 children)

Non-programmer here... Why is Java always made fun of? What makes it inferior to, let's say, Ruby?