Welcome!

Welcome to our community forums, full of great people, ideas and excitement. Please register if you would like to take part.

This is extra text with a test link..

Register Now

Global Horizontal Ad1

Collapse

Google Tag Manager

Collapse

Google Website Review Code

Collapse

Announcement

Collapse
No announcement yet.

Programming 101

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Programming 101

    10,000 foot view of programming


    Programming is about controlling a machine. It's not a secret art or magic.

    To control a machine, you need to understand how that machine takes instructions and how it returns the answer to you.

    So, naturally, we are going to need to focus on a language. There are many languages out there that a person could use to "speak" to a machine. I don't believe that there is a single "best" language to use. So, whatever language you choose, it should do the trick. I'll address languages when we finish preliminary points on programming.

    Algorithms

    College courses, in my opinion, do not spend enough time on teaching algorithms. An algorithm is basically the "flow" of your program. So, the first step in a proper algorithm is to establish what your program wants to do. After you decide the solution your program will give the user, you should be breaking down the "problem" into manageable pieces. It's good practice to break down your "problem" as small as you logically can.

    I will use a cake as an example to explain:

    Gather: eggs, flour, milk, sugar, shortening, spice, extracts, mixing bowl, spoon, oil, baking pan, stove, electricity and a timer.

    Think of the things that you just gathered as "objects". Objects are the actual data that you will use in your program. You will hear that term quite often.

    Trust me this is going somewhere.

    Break down your objects further:
    Gather: Chicken eggs, wheat flour, cow's milk, cane sugar, canola oil, etc.

    As you can see, in programming, you need to be precise as possible.

    Continuing, you have all the ingredients to make a cake but you need to do something with the ingredients. In programming, actions are called functions or subroutines. You can use those phrases interchangeably. So your actions (functions) should tell the computer what to do and in what order:
    1: mix in a bowl
    2: crack eggs throw away shell
    3: add spice
    ...

    It's up to you to create the flow of your program so others using your program can be successful.

    Review:
    Algorithms are the flow of your program. You need to create one before you even write a single line of code. Objects are the data that you will use in your program. Functions are the actions that the computer must perform in order to solve a problem. Please practice algorithms because they are very useful for design and upgrading your code to extend it if you should want to in the future.

    Next: Language Types

  • #2
    Originally posted by TheHarmattan View Post
    10,000 foot view of programming


    Programming is about controlling a machine. It's not a secret art or magic.

    To control a machine, you need to understand how that machine takes instructions and how it returns the answer to you.

    So, naturally, we are going to need to focus on a language. There are many languages out there that a person could use to "speak" to a machine. I don't believe that there is a single "best" language to use. So, whatever language you choose, it should do the trick. I'll address languages when we finish preliminary points on programming.

    Algorithms

    College courses, in my opinion, do not spend enough time on teaching algorithms. An algorithm is basically the "flow" of your program. So, the first step in a proper algorithm is to establish what your program wants to do. After you decide the solution your program will give the user, you should be breaking down the "problem" into manageable pieces. It's good practice to break down your "problem" as small as you logically can.

    I will use a cake as an example to explain:

    Gather: eggs, flour, milk, sugar, shortening, spice, extracts, mixing bowl, spoon, oil, baking pan, stove, electricity and a timer.

    Think of the things that you just gathered as "objects". Objects are the actual data that you will use in your program. You will hear that term quite often.

    Trust me this is going somewhere.

    Break down your objects further:
    Gather: Chicken eggs, wheat flour, cow's milk, cane sugar, canola oil, etc.

    As you can see, in programming, you need to be precise as possible.

    Continuing, you have all the ingredients to make a cake but you need to do something with the ingredients. In programming, actions are called functions or subroutines. You can use those phrases interchangeably. So your actions (functions) should tell the computer what to do and in what order:
    1: mix in a bowl
    2: crack eggs throw away shell
    3: add spice
    ...

    It's up to you to create the flow of your program so others using your program can be successful.

    Review:
    Algorithms are the flow of your program. You need to create one before you even write a single line of code. Objects are the data that you will use in your program. Functions are the actions that the computer must perform in order to solve a problem. Please practice algorithms because they are very useful for design and upgrading your code to extend it if you should want to in the future.

    Next: Language Types

    Excellent stuff! I like the way you explained it. I'm learning from the way you broke it down.

    Comment


    • #3
      Language types

      Generally, there are three types of languages with their own set of strengths and weaknesses.

      Compiled languages are more robust and historically faster than the other two types. Examples of compiled languages:

      C - The grandaddy of many languages' inspiration. It is flexible and allows the programmer to get real close to the actual "circuits". Windows, Mac, Linux, BSD and Minnix are primarily written in C.

      C++- This language is a superset of C. It was known as "C with classes" in the earlier days of its adoption. C++ is even more flexible than C, and the native code is a very good primer on object oriented programming. There's that word "object" again.

      D - This language is the new kid on the block. The creators thought that C++ could use a little beautification and some more modern features. Very good language in my opinion.

      There are tons more to name so I'll end this section with a short list: Assembler, BASIC, Fotran, COBOL

      Interpreted Languages

      An interpreted language is a language that is written for an executable program usually called a interpreter. These languages do not need to be compiled before they are run. The instructions are typed out and made into a script. The interpreter reads the script and it executes the script at the interpreter level. Interpreted Languages are very flexible and convenient but they lack in speed.

      Examples of interpreted Languages:

      Python: This language is the rockstar of all the interpreted languages and it's in high demand. It is object oriented and provides a general purpose language for automation compiled programs or it can be used to extend a program's functionality.

      Perl: Over the years Perl has gained a cult following for its specialization in dealing with strings. If you are working with a lot of words, this language is a no-brainer.


      Ruby: Ruby has been called the ugliest language in the word but its properties are solid. It's a general purpose language that does what other interpreted languages can do. It's extension: Ruby on Rails turned out to be great for developers wanting to extend and add functionality on the web.

      PHP: Speaking of the web, this is the one of the big languages that works on the web and add functionality to your web pages. Over the years it has suffered security issues but it's now on track to continue to be a top language on the web.

      Byte Code Interpreted Languages

      These languages are compiled into bytecode and then executed inside of a virtual machine.
      The logic to this type of language execution is mainly twofold: it is faster than interpreted languages and the code is portable between virtual machines on different operating systems. Java lead the charge back in 1995. In the early 2000's, Microsoft followed through with their rendition when they released the .Net Framework.

      Bytecode Languages are:

      Java - The granddaddy of bytecode Languages, is a staple in many development projects. It is still in high demand.

      C# - This language was developed by Microsoft and it is a general purpose language and has been a rockstar for that platform. It was inspired by C, C++ and Java.

      F# - This is one of the newer general purpose languages that emphasize functions over objects. It's still too new to see if it can break out of the pack.

      As you can see, you have many language solutions for your projects. No one can tell you which on is right for you. So, naturally you will need to have a sense for experiment and try a few languages and pick one that is right for you and your project.

      Next: Object Oriented Programming

      Comment


      • #4
        Object Oriented Programming

        I cannot stress it enough that the programmer needs to think in terms of objects when learning a new programming language. I will use a back for my examples in this section.

        A bank offers many services but most of them are in the form of accounts. Accounts are therefore tied to actual people. Accounts are usually currency.

        So let's say you have a personal n that wants to open an account. The programmer needs to think about the type of account. The type of account opened has different properties applied to how your money is stored and spent.

        For simplicity you could open up a savings or checking account. Think of those two as different objects that you need to program and define on your program. You have to tell the computer about the interest rate, minimum daily balance, etc.

        Once again, for simplicity, the account holder is a separate object. Within the account holder's object, there needs to be something that differentiate one from another. Two people can have the same name and birthday. But no two people have the same SSN, for example.

        There are whole books on object oriented programming. I suggest that you learn to think about objects as separate parts if an idea that needs to work inside of a program.

        Next: Intro To C++ (With A Twist)

        Since C++ is widely used and it is the forerunner to object oriented programming, we will start writing code in the next chapter. Amandla!

        Comment


        • #5
          Originally posted by TheHarmattan View Post
          Object Oriented Programming

          I cannot stress it enough that the programmer needs to think in terms of objects when learning a new programming language. I will use a back for my examples in this section.

          A bank offers many services but most of them are in the form of accounts. Accounts are therefore tied to actual people. Accounts are usually currency.

          So let's say you have a personal n that wants to open an account. The programmer needs to think about the type of account. The type of account opened has different properties applied to how your money is stored and spent.

          For simplicity you could open up a savings or checking account. Think of those two as different objects that you need to program and define on your program. You have to tell the computer about the interest rate, minimum daily balance, etc.

          Once again, for simplicity, the account holder is a separate object. Within the account holder's object, there needs to be something that differentiate one from another. Two people can have the same name and birthday. But no two people have the same SSN, for example.

          There are whole books on object oriented programming. I suggest that you learn to think about objects as separate parts if an idea that needs to work inside of a program.

          Next: Intro To C++ (With A Twist)

          Since C++ is widely used and it is the forerunner to object oriented programming, we will start writing code in the next chapter. Amandla!


          Your efforts here are not wasted here bruh.
          Ive just pulled up a seat to the front of the class, ready to absorb.
          although, im primarily focused on python right now.

          Comment

          Working...
          X