College goers I study with..

Page 1 of 1

10 Replies - 4319 Views - Last Post: 02 April 2012 - 10:45 PM Rate Topic: -----

#1 ILoveJava  Icon User is offline

  • D.I.C Regular

Reputation: 29
  • View blog
  • Posts: 389
  • Joined: 12-March 12

College goers I study with..

Posted 15 March 2012 - 03:57 AM

So I thought I'd post on here, about the guys I study with. I lost access to my account, so my friend gave me his account details so I could program for the day, so, while I was there, I lurked. I found his VERY first Java program, I couldn't help but laugh so fucking hard at him while I read it.
public class Main 
{
System.out.println(String [] args) 
{
int i = 0;

System.out.println ( "Hello World!" );
for(i=0;i<10;i++)
{
System.out.println ( i );
}
}
}

No, there is no indenting, and there is a space before & after brackets, and the for loop is extremely condensed.
Was this wrong of me? Or does this "program" deserve it?

Is This A Good Question/Topic? 0
  • +

Replies To: College goers I study with..

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6064
  • View blog
  • Posts: 23,520
  • Joined: 23-August 08

Re: College goers I study with..

Posted 15 March 2012 - 04:11 AM

*
POPULAR

Um...other than the lack of indentation -- and consider this is this person's first program -- everything else is strictly a stylistic choice. It's not uncommon to see extra whitespace or a lack of whitespace in statements.
Was This Post Helpful? 5
  • +
  • -

#3 Julyuary  Icon User is offline

  • D.I.C Head

Reputation: 38
  • View blog
  • Posts: 106
  • Joined: 20-December 11

Re: College goers I study with..

Posted 15 March 2012 - 06:27 AM

Like JackOfAllTrades said, and I think this is actually fine for a first program. Do any of his other or more recent programs look worse?
Was This Post Helpful? 0
  • +
  • -

#4 SpartanGuy07  Icon User is offline

  • D.I.C Head

Reputation: 32
  • View blog
  • Posts: 149
  • Joined: 08-September 11

Re: College goers I study with..

Posted 15 March 2012 - 07:05 AM

That's kind of weird that you were "lurking" through your friend's computer...

And I say I agree, probably what my first program looked like as well. Although it might not be the most readable form, one point of the Hello World program is to give a very simple design and then show you how it can be formatted to ease reading in the future.
Was This Post Helpful? 0
  • +
  • -

#5 Ryano121  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1362
  • View blog
  • Posts: 3,002
  • Joined: 30-January 11

Re: College goers I study with..

Posted 15 March 2012 - 09:20 AM

I know a lot of people who put extra whitespace in between brackets. As was previously said it's all about your own personal style. OK the lack of indentation and condensed for loop could get a bit annoying, but I this is normally a tell tale sign that they wrote the program in Notepad. It's not easy to get nice pretty formatting on Notepad.

The lack of a main method however is a different story. I can only assume that

System.out.println(String [] args)


was mean to read

public static void main(String [] args)


But still, not really worthy of laughing about it. Its only Hello World.
Was This Post Helpful? 4
  • +
  • -

#6 Shane Hudson  Icon User is offline

  • D.I.C Technophile
  • member icon

Reputation: 343
  • View blog
  • Posts: 1,286
  • Joined: 06-December 09

Re: College goers I study with..

Posted 16 March 2012 - 05:15 AM

Yeah the only weird thing about that code is he initiates i twice, but baring it mind most people start with hello world.. this is a good first program.

EDIT: For the record, I know this is Hello World.. I meant just System.out.println('Hello World');

This post has been edited by Shane Hudson: 17 March 2012 - 04:16 AM

Was This Post Helpful? 1
  • +
  • -

#7 Sergio Tapia  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1253
  • View blog
  • Posts: 4,168
  • Joined: 27-January 10

Re: College goers I study with..

Posted 16 March 2012 - 12:19 PM

Nothing wrong with this. :/ Except maybe he's initializing i twice.
Was This Post Helpful? 0
  • +
  • -

#8 Duckington  Icon User is offline

  • D.I.C Addict

Reputation: 170
  • View blog
  • Posts: 608
  • Joined: 12-October 09

Re: College goers I study with..

Posted 20 March 2012 - 02:15 PM

You expect someone's first code to be spectacular? I suppose you came out of the womb screaming and whipping up web services?

Dick.
Was This Post Helpful? 0
  • +
  • -

#9 darek9576  Icon User is online

  • D.I.C Lover

Reputation: 198
  • View blog
  • Posts: 1,689
  • Joined: 13-March 10

Re: College goers I study with..

Posted 21 March 2012 - 06:59 AM

I dont even remember my first program but it must have been worse than that, and you are a twat.
Was This Post Helpful? 0
  • +
  • -

#10 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7764
  • View blog
  • Posts: 13,128
  • Joined: 19-March 11

Re: College goers I study with..

Posted 23 March 2012 - 08:31 AM

TRWTF is he gave you his password.
TRTRWTF is here's a guy who goes out of his way to help you out and you're making fun of his first program. Remind me not to do you any favors, man.


EDIT: not to mention - you "lost access"? What, forgot your password? Is "hunter2" really that hard to remember?

This post has been edited by jon.kiparsky: 23 March 2012 - 08:37 AM

Was This Post Helpful? 1
  • +
  • -

#11 no2pencil  Icon User is online

  • Admiral Fancy Pants
  • member icon

Reputation: 5324
  • View blog
  • Posts: 27,237
  • Joined: 10-May 07

Re: College goers I study with..

Posted 02 April 2012 - 10:45 PM

I think this topic has gone it's course. This is not what the nightmare in code forum is aimed to achieve.

** Topic Closed **
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1