Friday, August 29, 2014

Learning Java...

I now know what they meant when they were saying that Ruby and Python are languages that are designed for the programmer vs. the computer, and how they make programming fun. Initially, I thought "how can programming not be fun?" However, after studying Objective-C and Java, I'm pretty clear on what they were talking about.

Java, from my understanding, so far, is a "lean" language, so you have to import "modules" that are already packed into Python and Ruby. In Java, you  have to write "import java.util.Scanner" to allow the user to input information, whereas you can just create a variable to accept the input in Ruby and Python. There are other little things like declaring types for variables and only being able to use one type of object in arrays, that make programming in Java...different.

The cool thing about declaring a type of variable, though, is that you decide what kind of variable you want to use ahead of time and you don't actually have to write your number in a decimal form, if they don't have numbers following the decimal. This is good for programming because you are thinking through the type of result that you want, which avoids using integers, when you want a float and having to go back and put in the decimals if you forget.

Another built in feature in Ruby and Python is the error messages. Although, you can resolve that situation by using an IDE, it comes built in to the other languages and coding in Java requires you to *sigh* download a IDE like NetBeans, free of charge and install it on your computer, when you're first getting set up.

Things that you can do using Java that you can't use Ruby and Python for? Compiling programs into .exe and other files that you can run as stand alone software (I think you may be able to do this on python, with some extra effort...Cython?) and building native mobile apps for android, which is huge. I think that with the popularity of mobile devices, not being able to use a language to build native applications for them is a pretty big disadvantage...if you like making stuff for other people to use. Even though there are plenty of things you can still build for people who are sitting in front of computers or for things that use Raspberry Pis or Arduinos. For me, the most exciting thing right now, as far as development is concerned, is making things that can be used no matter where they are on many different kinds of devices. I really hope that something can be done about this...and soon [ yes, I know about Ruby Motion :) ].

Challenges with learning2Java that aren't about the language itself:
  1. The writers of the books. I'm not literary expert or anything, but the way that they write/speak is hard to follow. The way they say things is not fun, at all. I don't know if it's just me or what, but I had such a hard time reading the books that I decided to watch youtube videos first so that I could get a general understanding of what's going on. It's not like I don't like to read or I just picked books at random, either. I did an internet search to try to find the best books to learn with, but yeah...
  2. Leaving this hanging: public static void main(String []args). Yeah, you really can't do that. It's not cool to tell me that you're going to explain something later, and then wait to talk about it at the end of the book. Sorry. I NEED to know. [ note to self: why haven't you googled this, yet? ]  How about walking me through it and then going into more detail later. I understand that "public" means that it will be available to other code, they explained that "main" means that this is the operating class that the compiler will look for, and from studying Objective-C, I think that "void" means that a function will not return anything, but I have no idea what that means for a class or if this is even the same thing in Java, and "static"? I need all of this explained and I need to be clear that I'm thinking in the right direction on this. That "String []args" part also needs to be explained, especially since I keep seeing those square brackets moved to different places in different code. How am I supposed to concentrate on what you're trying to teach me if this keeps coming up unexplained?
This probably sounds like a lot of complaining, but it's just my growing pains. I'm definitely going to take advantage of all opportunities to learn new things. [ ...especially Java, since it's the dominant mobile platform and I definitely want to develop for it...even though I have an iPhone ;) ]. I'm just getting started with Java and Objective-C, so if I start saying things, in the future, like "I don't see what people's problem with Java is" or "actually, Objective-C is pretty cool, I'm glad I learned it before I started Swift" don't be surprised. :)

I think that I'm going to go study a little Ruby now. 

...because Ruby.

No comments:

Post a Comment