1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cameron's Programming Tutorial #1 - What language should I choose?

Discussion in 'Software/Coding' started by repository, May 3, 2015.

  1. repository

    repository Member

    Joined:
    May 3, 2015
    Messages:
    37
    Likes Received:
    127
    Trophy Points:
    33
    Gender:
    Male
    Home Page:
    Hello everyone!

    I am very new to cubecraft (as seen by this being my first post!), but I would like to share some knowledge with those who are interested in development as I have been developing for 5 years now and have developed and worked on all kinds of interesting projects!

    The languages I will be covering are non-web development one's. If you really are passionate about web-development, then feel free to tell me to make another post about it some time.

    To start with I am going to give a brief overview of how computers process and execute information (see it's relevance later on).

    • Data in a computer is stored as binary (more technically known as machine code). Simply put, it's just 1's and 0's.
    • These bits (each binary value) are grouped into binary words; which are normally multiples of 8 - forming what's known as a byte.
    • This is where you get sizes from in files etc, (a KiloByte is 1024 bytes!).
    • Anyway, there are two essential parts that every computer has - a Main Memory and a Processor.
    • The Main Memory stores each binary word with a specific address.
    • The Processor is full of registers (small temporary holding storage points which all perform specific jobs). Together they will fetch-decode and execute the data.
    If you want to look into depth about this more search up the "Fetch-Execute cycle" in your preferred search engine - but you shouldn't need to know too much in depth!

    The different levels/tiers/generations of programming languages

    Generally speaking, there are 4 generations of programming languages.

    1st generation : The 1st generation is as simple as it gets. You are literally writing your program in binary.

    2nd generation: The 2nd generation is known as assembly code. It's written as commands which perform functions on certain addresses or values from addresses and can also be used to manipulate registers in the Processor.
    Example 1: LOAD #21 - would load the number 21 into a register called the accumulator (which just holds the most recent instruction) to be executed.
    Example 2: ADD 14 - adds the value from memory address 14 with the co-existing value found in the accumulator.

    3rd generation: The third generation is where the big differences come into play. Third generation languages are abstracted (simplified) way more than lower generations through named variables, Object-orientated programming, etc.

    4th generation: 4th generation programming languages are the highest tier. They are known as declarative languages whereas 3rd generation programming languages are imperative. In a 4th generation programming language you define WHAT needs to be done, and HOW you want to do it. Whereas in 3rd generation programming languages you only define WHAT needs to be done.

    Since these programming languages aren't in machine code (binary), how the hell does the computer run the program?!

    To transfer languages into machine code, system software called Translators are used.
    There are 3 types of translators :

    Assembler : This turns assembly code into machine code.
    Compiler : If a programming language uses a compiler, it means that the code needs to be compiled before it is run. A compiler links all of your source files and turns them into object code. This can then be turned into an executable file, which is composed of binary.
    Examples of languages that use a compiler : Java, C, C++, C#
    Interpreter : An interpreter reads the source code line by line and executes it on the go.
    Examples of languages that use an interpreter : Python, Ruby,

    Compiler vs Interpeter vs Assembler(very important):

    Compiled :
    • Produces executables.
    • Will run large programs very quickly.
    • The machine code isn't difficulty to understand, so it's easier to keep intellectual property.
    Interpreter :
    • Easier to debug - since the program is checked line-by-line.
    • Less likely to crash a computer - doesn't run directly on the CPU.
    • Uses less memory - source code only has to be present one line at a time in the memory.
    Assembler :
    • Useful for editing hardware (physical components of the computer) as you can change the values that they operate on in the main memory. BARE IN MIND: Other high-level languages such as C++ can do this too, but not on a very-specific level.

    It is essential you bare these factors in mind when choosing what language you want to uptake - ask yourself "What do I want to use it for?"

    Syntax of programming languages and What they do

    Unfortunately I cannot answer this as it would take wayyyy too long. They are all very different.
    What I would ask you to do is look at everything above and decide the purpose of why you are learning a language, THEN play around with it and get a feel for it and see if you enjoy it.

    ______________________________________________________________________

    You have reached the end of the tutorial.

    Thanks for reading. Hoped this helped! (Please tell me to expand on certain things if you want me to, and ask any questions if you want below).
     
    YounB, _Patrickk, Norwegian_ and 7 others like this.
  2. Accountrowan01

    Accountrowan01 Member

    Joined:
    Nov 13, 2014
    Messages:
    355
    Likes Received:
    505
    Trophy Points:
    93
    Gender:
    Male
    Location:
    The Netherlands
    Welcome to CCG!
     
  3. repository

    repository Member

    Joined:
    May 3, 2015
    Messages:
    37
    Likes Received:
    127
    Trophy Points:
    33
    Gender:
    Male
    Home Page:
    Thanks :)
     
  4. Yittamonkey

    Yittamonkey Member

    Joined:
    Mar 30, 2014
    Messages:
    2,393
    Likes Received:
    2,357
    Trophy Points:
    113
    Location:
    Canadia
    Welcome!
     
  5. repository

    repository Member

    Joined:
    May 3, 2015
    Messages:
    37
    Likes Received:
    127
    Trophy Points:
    33
    Gender:
    Male
    Home Page:
    Thanks!
     
  6. alyphen

    alyphen Member

    Joined:
    Jan 4, 2014
    Messages:
    101
    Likes Received:
    96
    Trophy Points:
    28
    Gender:
    Male
    Occupation:
    Technical Consultant
    Location:
    127.0.0.1
    Home Page:
    This is a decent summary of some of the basics of computing - let me know if you need any help, I've been programming for about 7 years now.
     
  7. Colourlight

    Colourlight Member

    Joined:
    Feb 7, 2015
    Messages:
    2,159
    Likes Received:
    482
    Trophy Points:
    83
    Gender:
    Male
    Occupation:
    Stalkers these days *shakes head*
    Location:
    Scotland, UK
    Home Page:
    Welcome!
     
  8. olsyboy

    olsyboy Member

    Joined:
    Jun 13, 2015
    Messages:
    215
    Likes Received:
    56
    Trophy Points:
    28
    Gender:
    Male
    Occupation:
    Student
    So what do you guys think is the best coding language?
    I reckon Java, C or Python :p
     
  9. GingerGeek

    GingerGeek Developer Staff Member Developer

    Joined:
    Jul 11, 2015
    Messages:
    74
    Likes Received:
    286
    Trophy Points:
    53
    Gender:
    Male
    Occupation:
    Developer at Cubecraft
    Home Page:
    Completely depends on what you want to do lol
     
    Norwegian_ likes this.
  10. olsyboy

    olsyboy Member

    Joined:
    Jun 13, 2015
    Messages:
    215
    Likes Received:
    56
    Trophy Points:
    28
    Gender:
    Male
    Occupation:
    Student
    @GingerGeek Does it? If you want to make GUI applications, you can use python.
    If you want to make a webpage, you can use python.
    If you want to make a database (it would be hard, but...) you can use python.

    If you are good then you can surely adapt a language!
     
  11. GingerGeek

    GingerGeek Developer Staff Member Developer

    Joined:
    Jul 11, 2015
    Messages:
    74
    Likes Received:
    286
    Trophy Points:
    53
    Gender:
    Male
    Occupation:
    Developer at Cubecraft
    Home Page:
    Yes but it's to do with tools for the job. If you were writing performance centric code, you would use C or even assembler. If you wanted to work at a higher level of abstraction you could use Java, C++ or python. You can use any programming language to more or less do anything - but it probably won't work as well.

    Good luck reimplementing a SQL server in assembly ;0
     
  12. olsyboy

    olsyboy Member

    Joined:
    Jun 13, 2015
    Messages:
    215
    Likes Received:
    56
    Trophy Points:
    28
    Gender:
    Male
    Occupation:
    Student
    xD Funniest quote all day :p
    @GingerGeek
     
  13. olsyboy

    olsyboy Member

    Joined:
    Jun 13, 2015
    Messages:
    215
    Likes Received:
    56
    Trophy Points:
    28
    Gender:
    Male
    Occupation:
    Student
    But on a serious note yes I do completely agree with that, I am just saying that you can definitely adapt a language...
    Also, you can't build an Android app in Bash lol
     
  14. GingerGeek

    GingerGeek Developer Staff Member Developer

    Joined:
    Jul 11, 2015
    Messages:
    74
    Likes Received:
    286
    Trophy Points:
    53
    Gender:
    Male
    Occupation:
    Developer at Cubecraft
    Home Page:
    I'm not saying you can't adapt the language, but there is definitely not a one-size-fits-all language like you were suggesting :)
     
  15. johnyestaloca

    johnyestaloca Member

    Joined:
    Oct 12, 2014
    Messages:
    1,171
    Likes Received:
    2,118
    Trophy Points:
    113
    Gender:
    Male
    Location:
    The land of the holy icecreams
    I use Google sometimes... Is that also good enough to join the club? :3
     
  16. olsyboy

    olsyboy Member

    Joined:
    Jun 13, 2015
    Messages:
    215
    Likes Received:
    56
    Trophy Points:
    28
    Gender:
    Male
    Occupation:
    Student
    .... Eek..
    Jk lol :p
     
  17. YounB

    YounB Helper Staff Member Helper

    Joined:
    May 13, 2014
    Messages:
    5,948
    Likes Received:
    6,549
    Trophy Points:
    113
    Gender:
    Male
    Occupation:
    ¯\_(ツ)_/¯
    Location:
    London, England
    Python is pretty good IMO, it's easy to use (kinda), and btw my brother made a database for a fitness place for signing up close to where we live, from Python.
     
  18. NanoNet

    NanoNet Member

    Joined:
    May 23, 2014
    Messages:
    1,044
    Likes Received:
    345
    Trophy Points:
    83
    Gender:
    Male
    Location:
    IKEA
    Python is good, but definitely not my favorite. It's very tedious with the compiler, because all the spacing has to be correct :( Languages (For example) like C++ and Java, their compilers ignore spacing and you can develop a coding style that way ;)
     
  19. olsyboy

    olsyboy Member

    Joined:
    Jun 13, 2015
    Messages:
    215
    Likes Received:
    56
    Trophy Points:
    28
    Gender:
    Male
    Occupation:
    Student
    @Younisco Yes, you could maybe read to some file or import a module to do it, but the language is not designed for that. At all.

    @NanoNet YAML is tedious?
    Just get an editor that does it for you xD
     
  20. NanoNet

    NanoNet Member

    Joined:
    May 23, 2014
    Messages:
    1,044
    Likes Received:
    345
    Trophy Points:
    83
    Gender:
    Male
    Location:
    IKEA
    I have JetBrains for Python. The reason that the compiler has to check for spacing issues is because there are no curly braces/containers for the code. I think instead of curly braces, they use ":". Personally I find it neater to have braces (And easier to de-bug), that's why I've adopted more of Java and C++ :p