Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why not System.exit(0)? O'Reilly Online Java courses worth it?  RSS feed

 
Ken Austin
Ranch Hand
Posts: 39
Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings, all.

I am new to the site, having recently decided to teach myself programming. I hope to eventually work full time in this area. I took a C class in the '90's, and have had a computer on my desk since I bought the just-released Commodore 128 in college. I am working my way through David J. Eck's free online text (Javanotes 6.0 - An Introduction to Programming Using Java. I purchased Thinking in Java and Head First Java to work through when I'm done with that. My long term goal is to work as a coder; my middle term goal is to pass Oracle's Java programmer exam.

I signed up for a Coursera course called Introduction to Algorithms. I was able to handle the course material, but the programming is still just a little beyond me. One of the tools they included in the download for the course was a program called checkstyle.

While playing around with checkstyle, I ran it on some of the programs I'd written while using the Eck text. Among the things it flagged were use of tabs, line length over 85(?) and use of System.exit(0). A quick Google search to find out why these are "bad things" was unfruitful.

Three questions:

1. Why was use of System.exit() flagged as a style issue?

2. Why was use of tabs flagged? (I'm using TextWrangler as my code editor.)

3. I am considering paying $1200 ($400/course) for O'Reilly School of Technology online Java classes, which offer certificates and CEUs upon successful completion. Is this a good use of my money?
 
fred rosenberger
lowercase baba
Bartender
Posts: 12542
48
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, welcome to the ranch!

tabs vs. spaces is an old debate...in fact, see this thread for more on the topic.

as for System.exit()...i'm not sure. It may depend on how/where you are using it as much as anything. Does "checkstyle" have any documentation or explanation on how/why it determines what is or isn't bad?

edit: I did find this article, which implies that it "... is an avenue for Denial of Service (DoS) attacks. "
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
System.exit causes the JVM to shut down. That's usually not what you want.

Tabs vs. space; just wait until the first time you open a file where some other developer used tabs and your editor is set for spaces. You'll see the problem.

The 80 column thing is a throwback to the days of 80 column punch-cards and 80 column display monitors. With todays wide-screen monitors, that's an archaic standard. I set mine at 140. Be advised however, when posting code to these forums, long lines can cause a horizontal scroll-bar to appear and really screw up the formatting.

As for how you spend your education dollars, I can't advise on that. Personally, I went back to community college and got a degree in computer programming. It took two years, but it was worth it. It got me off unemployment and back into the world of coding.

Good luck to you!
 
Junilu Lacar
Sheriff
Posts: 11135
160
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ken Austin wrote:3. I am considering paying $1200 ($400/course) for O'Reilly School of Technology online Java classes, which offer certificates and CEUs upon successful completion. Is this a good use of my money?

That depends entirely on you. Does that fit your learning style? How long are these courses? Personally, I would just invest that money in a few good books and a good reading light but that's my learning style. YMMV.
 
Ken Austin
Ranch Hand
Posts: 39
Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, guys.

Fred, thank you for the welcome and the two links. They were enlightening. (I guess I should definitely avoid mixing the tabs and spaces.)

JK, thanks for the background on the line width. Going back to traditional school is what I'm trying to avoid. I already have a Master's, and the one programming class I took was paced more slowly than I would have liked.

Junilu, at the moment, that is the course of action I'm pursuing. There seems to be a general feeling that higher ed is not worth the money right now...at least in the tech sector. I'd rather buy a book. But I thought that if the O'Reilly certificates and CEUs are reputable, they might look better on a resume than "read some really good books." (I know it will come down to whether or not I can code.)
 
fred rosenberger
lowercase baba
Bartender
Posts: 12542
48
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ken Austin wrote:I guess I should definitely avoid mixing the tabs and spaces.

The real answer (and I'm not sure if it was in that thead or not) is that you follow whatever coding convention you are told to use. If your company says 'indent every other line with tabs and spaces", then that is what you do. It is more important to be consistent with everyone than 'right'.

If you are writing code for yourself, adopt a style you like and stick with it.
 
Junilu Lacar
Sheriff
Posts: 11135
160
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ken Austin wrote:the O'Reilly certificates and CEUs are reputable, they might look better on a resume than "read some really good books." (I know it will come down to whether or not I can code.)

Exactly. If you are lucky enough to interview for a good team (doesn't always necessarily == good company though) certs and CEUs won't really matter that much and you shouldn't make a big deal of them. Impress by being able to correctly and intelligently apply what you learned. Build up a sample website as you learn and show it to prospective employers. Show what you can do. Get creative. That's how you get the attention of people and teams you want to be working with. If the prospective employer doesn't appreciate that kind of approach, I say they aren't worth it anyway. Sure, beggars can't be choosers but if you can hold out a little bit for a good team, then you'll be happier in the long run.
 
Campbell Ritchie
Marshal
Posts: 55681
161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jk Robbins wrote: . . . I set mine at 140. Be advised however, when posting code to these forums, long lines can cause a horizontal scroll-bar to appear and really screw up the formatting. . . .
You are probably all right at 140 columns, but anything longer can make lines difficult to read. Remember there are still people using the Ranch who have screens 1024px wide or less. 140 columns will take the writing off their screens unless they use very small text, and horizontal scrolling makes code very difficult to read. There are some code conventions here; they are old but still useful. I notice they duck out of the tab v space argument. The next section down tells you how to wrap lines, which is a valuable skill.

And welcome to the Ranch again
 
arulk pillai
Author
Ranch Hand
Posts: 3413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I too invest on good books and quality online blogs and articles for my education unless the company you are working for is prepared to pay for it
 
Winston Gutkowski
Bartender
Posts: 10573
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Junilu Lacar wrote:
Ken Austin wrote:the O'Reilly certificates and CEUs are reputable, they might look better on a resume than "read some really good books." (I know it will come down to whether or not I can code.)
Exactly. If you are lucky enough to interview for a good team (doesn't always necessarily == good company though) certs and CEUs won't really matter that much and you shouldn't make a big deal of them.

I suppose there is one thing about being able to put it on your CV, and that is to say that you paid for it yourself; because that, at least, shows some commitment (or lots of dosh; but I can't imagine too many rich kids wanting to become junior programmers). I was very interested in taking the SCJD exam until Oracle priced it out of the market for me; and I suspect it's deliberate policy.

Winston
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!