Page 3 of 3 FirstFirst 123
Results 21 to 26 of 26

Thread: Beginning to program

  1. #21
    Join Date
    Mar 2006
    Beans
    393

    Re: Beginning to program

    Quote Originally Posted by r-senior View Post
    The write once run anywhere thing is a feature of Java. Java programs are cross platform without needing recompilation. Read up about bytecode and JVM.
    A lot of scripting languages, Perl, Python, Ruby, will run on any machine. And since they are scripting languages, there is no need to compile them. And yes, they do run at speeds comparable to Java.
    Just my 0.00000002 million dollars worth,
    Shawn

    Programming is as much about organization and communication as it is about coding.

  2. #22
    Join Date
    Dec 2012
    Beans
    24

    Re: Beginning to program

    Programming for me consists of a number of things which can be regarded seperately:

    1/ learning to structure my thoughts clearly and algorithmically,

    2/ translating this structure to the programming language used and

    3/ understanding what this means in hardware.

    For me, 3/ is very important. It gives me the feeling of having solid ground beneath my feet. For this reason my favourite language for a long time was sparc assembly, which consists of instructions like "move the number 4 to register 2 and add it to the number in register 3, storing the result in register 6". You get to control what the hardware is 'actually doing'.

    This is quite different from high level languages. Take this bit of Java code:
    Code:
    public static void main(String[] args) {
      System.out.println("1" + 2 + 3);
    }
    Whatever else you may think about this, there is a lot of stuff going on behind the scenes and lots of rules which you have to know.

    This meant to me that, when I began programming, high-level languages were hard. The experience gained about how to write large applications was implemented in the rules of the language. In Java, for example, everything has to be a class. This leads to a number of questions. What is a class? Why is a class a good idea? What problems can be solved easily using classes? What is the computer 'actually doing'? etc. etc. These questions are best answered with experience, in my opinion.

    If I could give some advice to my younger self, I'd say:

    1/ learn enough assembly so that you can write very very simple programs. This will teach me what allocation is, what memory management is, how functions are called, what support for functions is provided in hardware.

    2/ move to C to see how a program written in one language (C) can be translated into another language (assembly/machine code). What problem is addressed by C containing things like a for-loop with this odd syntax?

    3/ try a number of higher-level languages and find one you like (python/ruby/php/smalltalk/...). Here you'll be able to do more much faster than in C, so you'll spend more time thinking about how to structure code and how to think about larger problems.

    Please note, these ideas are tempered to the way I think. It's possible that you think differently and another path will lead to Rome faster.

  3. #23
    Join Date
    Jan 2013
    Beans
    95
    Distro
    Ubuntu Mate 14.04 Trusty Tahr

    Re: Beginning to program

    I'm actually having an issue even making the JDK work. Since so many people are posting, helping out, I figured it would be easier to have just a generic reply then quote several people.

    The command 'javac' isn't being found as a valid command no matter what I do. I've referred to this help page and nothing is working. To be honest I'm not sure if I've gotten the JDK right in Ubuntu, I can't seem to install it, I just unpack the tar.gz and cd to my .java file and put the path to javac before I try to compile the .java.
    I've even tried this in Windows and a new virtualbox installation of Xubuntu to see if a fresh install had anything to do with it.
    I also followed the instructions for Windows and updating the PATH variable via the control panel, and it's still not working
    I'm really very confused as to why nothing is working.

  4. #24
    Join Date
    Dec 2012
    Beans
    24

    Re: Beginning to program

    No, no, no. Don't download the sdk from oracle.

    Instead open a terminal and type:

    Code:
    sudo apt-get install openjdk-7-jdk
    This will install the jdk and automatically update it, when updates become available.

  5. #25
    Join Date
    Nov 2012
    Location
    Halloween Town
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Beginning to program

    If you want to use Oracle Java instead of OpenJDK, you can add a PPA repository to install and keep it updated. This package provides Oracle Java JDK 7, which includes Java JDK, JRE and the Java browser plugin.
    At a terminal window just run the following commands:
    Code:
    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt-get install oracle-java7-installer

  6. #26
    Join Date
    May 2007
    Location
    Leeds, UK
    Beans
    1,665
    Distro
    Ubuntu

    Re: Beginning to program

    A lot of scripting languages, Perl, Python, Ruby, will run on any machine. And since they are scripting languages, there is no need to compile them. And yes, they do run at speeds comparable to Java.
    I didn't mean to imply that write once run anywhere was a feature unique to Java but I can see that my post was ambiguous in that respect. If you look at the context I was trying to explain that it is a feature of Java rather than NetBeans. You are quite correct that scripting languages will run on any machine (that has the interpreter installed).

    The speeds though are not comparable. Depending what you run, a processor intensive Java program takes about 1.2-1.5 times as long as an equivalent C program, whereas something like Python will be at least an order of magnitude slower. I have a little test suite somewhere. For a lot of applications this is not an issue and these scripting languages are great languages.

    No, no, no. Don't download the sdk from oracle.
    +1

    I routinely develop applications using the Open JDK for running on the Oracle SDK and I don't mean toy apps, I mean things like EJB and Spring enterprise apps running on Glassfish and Tomcat. The Open JDK is pretty good these days. There are some corner cases where the Oracle JDK is needed, but these are increasingly rare and we should support the open source version.
    Please create new threads for new questions.
    Please wrap code in code tags using the '#' button or enter it in your post like this: [code]...[/code].

Page 3 of 3 FirstFirst 123

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •