Options

Programming How To Start?

ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
If you guys could pick a programming language as a starting point what language would it be?

I am new to programming and programming concepts, The syntax needs to be easy to understand and noob friendly.

I running Linux quite alot and often dabble with the command line. Am looking at ways of automating things I.e back up scripts can this be achieved with programming languages such as Perl, Python.

How to you invoke linux commands through a programming language? This is really confusing me

Many thank go easy I am a noob when it comes to programming :)
Microsoft's strategy to conquer the I.T industry

" Embrace, evolve, extinguish "

Comments

  • Options
    linuxloverlinuxlover Banned Posts: 228
    Different languages for different problems. If you want to automate processes in Linux, start learning Bash and take it up from there.
  • Options
    FloOzFloOz Member Posts: 1,614 ■■■■□□□□□□
    I'm currently trying to reteach myself programming (haven't programmed since college). Codeacademy.com has been an awesome tool. I highly recommend checking it out. As for language, I chose Python because I feel it best suits a network engineers role in terms of trying to automate certain tasks.
  • Options
    4_lom4_lom Member Posts: 485
    If you are new to programming, I would suggest learning Python. It's more of a scripting language since it is compiled at runtime, but a good one to learn none-the-less. There's a lot of good material available if you choose to learn this language. Here's a few of the resources I used:

    Learn Python the Hard Way: Zed Shaw: 9781257853212: Amazon.com: Books

    Web Development Tutorials

    Python is a very high level language, so it is easy to learn. It also helps you learn how to program. Just knowing a language isn't enough, you have to be able to think like a programmer. After learning Python you can move on to some more advanced languages. I know Python, Ruby, C++, and ASM. And I learned them in that order.
    Goals for 2018: MCSA: Cloud Platform, AWS Solutions Architect, MCSA : Server 2016, MCSE: Messaging

  • Options
    ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
    Thanks :) how long does it take on average to become familiar with a language? Do you use it everyday or set yourself small goals? In terms on Administration how do you apply Python? From guides I have read in the past I was taught how to create lists and create variables nothing really geared towards administration.
    Microsoft's strategy to conquer the I.T industry

    " Embrace, evolve, extinguish "
  • Options
    4_lom4_lom Member Posts: 485
    ally_uk wrote: »
    Thanks :) how long does it take on average to become familiar with a language? Do you use it everyday or set yourself small goals? In terms on Administration how do you apply Python? From guides I have read in the past I was taught how to create lists and create variables nothing really geared towards administration.

    If you dedicate a couple hours every day to it, you could probably get a good grasp within a month. I don't use it everyday. I work in a *mostly* Windows environment, so Powershell is a better option for me. But for administering *nix boxes, there are different modules you could use. For example, if you want to work with the networking side of things (creating simple clients and servers), you could use the SOCKET module. If you wanted to work with an operating system, you could use the OS module. There are literally thousands of these modules available for Python, which is why the language is so great to learn. There is something for everyone. I've often heard people say that Python is the only language you'll ever need to know :D
    Goals for 2018: MCSA: Cloud Platform, AWS Solutions Architect, MCSA : Server 2016, MCSE: Messaging

  • Options
    ccnxjrccnxjr Member Posts: 304 ■■■□□□□□□□
    I'll also vote for Python + Codecademy + LearnPythonTheHardWay.
    It's simple enough to learn, and flexible enough to use in a variety of situations from Sys Admining to Networking, etc.
    Ruby would be a good secondary language to learn, which will come in quite useful if you ever want to dabble with Puppet or Chef.
    (there's SaltStack , which is powered by Python, but it's still in it's infancy ) .

    The community and learning resources behind both make them better languages to start, however that's making a big assumption on your learning style.
    Python and Ruby are the sexy languages to learn now, and they're very functional.
    However also consider Java which isn't as popular in the Sys/Network Admin spheres , but is considered more of a solid foundation if you do want to delve into more of the applications side of things.
  • Options
    antielvisantielvis Member Posts: 285 ■■■□□□□□□□
    As a new Linux rookie admin coming from a Windows server gig, here are my thoughts.

    1. You can't go wrong knowing BASH scripting. Learning it will get you in the "write a script" mindset. I honestly found the hardest part of programming/scripting was getting my mind around the concepts.

    2. If you work in Windows do look at Powershell. It's not programming but it's Windows scripting and will get you in that mindset to learn to think like a programmer

    3. You can't go wrong with Python or PERL.

    I now see programming like I see cooking. You can cook chicken many ways but the basics of cooking the chicken are somewhat the same. Once you get those basics down, learning other languages is probably going to be easier. It's like learning French..then going to learn Spanish. The words are somewhat different but the whole layout of the language is very similiar.
  • Options
    DevilWAHDevilWAH Member Posts: 2,997 ■■■■■■■■□□
    Hi,

    As has been commented on many time on various forums. The first language is where you learn the logic of how programming works. All languages are built around the basic logic operations, IF, THEN, AND, OR, NOT, EQULES, etc. (although these five are possible the major ones to get going with). So if you don't understand logic operations I suggest you look them quickly.

    Then its a case of building together a lot of

    if X do Y

    All languages are based around this very simple statment, and the primary difference between most are the syntax of the command and what you require to run the programs created. Scripting languages such as Python need Python to be installed, as the script is run the Python program processes the code and executes. While a "programming" language that can be complied such as C++, the code is compiled in to an executable file that can run standalone on the system it is built for.

    The arguments for and against each are endless, but generally Scripting languages are more limiting in low level design and suffer from proformace when you are looking at complex tasks such as GAMES and DataBases. They are however portable. Code written in Python on a Linux box for example will directly run on a windows machine if you install the underlying Python application.

    Compiled languages are generally better for performance as you get very low level control of Memory and CPU, so you do find them used to create drivers for hardware and high proformace applications such as modern games. They do have the issue that once compiled the code will only run on very specifice hardware / OS specs. So you need to compile it mutiplt times for different systems, and often simple recompiling it is not enough, some of the code will need to be rewritten.

    Script, quick to develop and very portable, perfect for automating tasks and dynamic web design, or GUI interfaces.

    Compiled code, longer development process, and from my experience steaper learning curve, use to create complex applications and bespoke Databases.

    So which one to learn... Personal if you have no programming experience go for any of the scripting languages as you can easily find real wold tasks you can use them to solve with short straight forward scripts. And in my mind the best way to learn is to have a sense of achievement at the end. Take Perl, Python, or PHP and with in an afternoon you can learn enough to read a log file, and from a provided keyword pull ever entry with that occurrence out, create a formatted text or Html file and open it.

    If after 2 weeks you grow board of scripts and want to get you hands on a "real" (watch the arguments that causes :) ) then find start looking at a compiled language and move on. the great thing is though that the fundamentals you learn in the first few weeks / months of any language are identical, so there no such thing as the wrong language to start with. ( just wait till some once comes up with some obscure one now! ).

    One thing you don't mention is what OS you are using? Linux has many many mature scripting languages while Windows is a bit more restricted. My personal scripting choices would be perl (very nice to use) and PHP, great for websites. While "programming" languages C++ is a very main stream language so has huge resources on the net. but if you want a middle ground c#.net or VB.net are not bad, and Microsoft have a free Visual studio with all the .net and C++ languages with lots of resources to back it up in one place.

    What ever you chose good luck and enjoy :)
    • If you can't explain it simply, you don't understand it well enough. Albert Einstein
    • An arrow can only be shot by pulling it backward. So when life is dragging you back with difficulties. It means that its going to launch you into something great. So just focus and keep aiming.
  • Options
    ptilsenptilsen Member Posts: 2,835 ■■■■■■■■■■
    I really think Python is the best way to get the concepts down. It forces you to get indenting, which will help you code better later, and it doesn't have some of the more inane syntax rules that some other languages have. It's a really great starting point. I would put Java second to Python, followed by BASH and PowerShell, for learning programming concepts. Which language you use in practice is going to depend on the task. Once you've really learned the concepts, picking up new ones is generally trivial. It doesn't take a veteran to Google syntax, and even the most experienced of veterans won't know the entirety of any language. Try out Python or another high-level language and learn the concepts. It's all downhill from there.
    Working B.S., Computer Science
    Complete: 55/120 credits SPAN 201, LIT 100, ETHS 200, AP Lang, MATH 120, WRIT 231, ICS 140, MATH 215, ECON 202, ECON 201, ICS 141, MATH 210, LING 111, ICS 240
    In progress: CLEP US GOV,
    Next up: MATH 211, ECON 352, ICS 340
  • Options
    GAngelGAngel Member Posts: 708 ■■■■□□□□□□
    Assembly and C
    You can learn anything else after those two much faster.


    If you just want to write short programs any of the OOP stuff will work but the true foundations lie in the languages above.
  • Options
    YFZbluYFZblu Member Posts: 1,462 ■■■■■■■■□□
    As someone who recently finished the Python CodeAcademy track; starting to learn programming is easy. Your problem will be after the introduction. Now what? You'll know just enough to become frustrated when you actually try to do something useful with the knowledge you've gained.

    I definitely recommend the Python CodeAcademy track, and I'd like to make a second recommendation - "Python 3 Object-Oriented Programming", by Dusty Phillips. This has been an excellent resource to answer the "now what?" question with an OOP objective once you get the most basic stuff down.

    Yes, it's Python 3 (CodeAcademy teaches 2.7); however the differences are a non-issue in this book IMO.
  • Options
    ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
    Assembly? C? Noway :) way above my level. I have dabbled with Bash scripting but haven't found a good resource that introduces concepts such as for, if and functions. Every tutorial I read just goes over my head.

    O/S I run is linux (Centos) I'm not interested in programming games or creating visual stuff. What I am interested in is automating command line stuff. But I am a noob have never programmed in my life you mere mention of parameters, variables, loops and I start sweating :) I haven't learnt any programming logic in my life.
    Microsoft's strategy to conquer the I.T industry

    " Embrace, evolve, extinguish "
  • Options
    ptilsenptilsen Member Posts: 2,835 ■■■■■■■■■■
    Just go for Python or BASH. It's true that once you know C, you can learn just about any modern language. It's also true that you can go without ever learning C and accomplish what you're hoping. You can certainly learn the relevant concepts well enough.
    Working B.S., Computer Science
    Complete: 55/120 credits SPAN 201, LIT 100, ETHS 200, AP Lang, MATH 120, WRIT 231, ICS 140, MATH 215, ECON 202, ECON 201, ICS 141, MATH 210, LING 111, ICS 240
    In progress: CLEP US GOV,
    Next up: MATH 211, ECON 352, ICS 340
  • Options
    MrAgentMrAgent Member Posts: 1,310 ■■■■■■■■□□
    Another vote for code academy. I've been using it to get better with Python. Also check out Ruby, it seems to be gaining more popularity as well.
  • Options
    CodeBloxCodeBlox Member Posts: 1,363 ■■■■□□□□□□
    I started with C. It made getting familiar with Python very easy.
    Currently reading: Network Warrior, Unix Network Programming by Richard Stevens
  • Options
    NovaHaxNovaHax Member Posts: 502 ■■■■□□□□□□
    If you are wanting to do web-development...no better place to start than codecademy icon_thumright.gif
  • Options
    About7NarwhalAbout7Narwhal Member Posts: 761
    Thanks for the site, I can use this at work to learn.
  • Options
    paul78paul78 Member Posts: 3,016 ■■■■■■■■■■
    DevilWAH wrote: »
    if X do Y
    All languages are based around this very simple statment,
    icon_twisted.gif Sorry to go off-tangent but I couldn't help thinking about the anti-if campaign when I read your comment - Home | The Anti-IF Campaign

    @OP - It's just my personal bias - but try not to fall into the trap that learning to program by learning a language means that you have learned to be a programmer. My course analogy is that it's like learning to build a house by learning to use a hammer. Perhaps try to take a few of the free online classes at Coursera first on software engineering - https://www.coursera.org/course/programming1 may be a good place to start. Good luck.
  • Options
    BryzeyBryzey Member Posts: 260
    I'm heading down the Linux road myself.

    My plan is bash > Python > puppet

    I am just starting out with this plan though..

    My advice is to pick one and immerse yourself. Head first. If you keep at it the light bulb will eventually go off and it will start to get easier.
  • Options
    GAngelGAngel Member Posts: 708 ■■■■□□□□□□
    ally_uk wrote: »
    Assembly? C? Noway :) way above my level. I have dabbled with Bash scripting but haven't found a good resource that introduces concepts such as for, if and functions. Every tutorial I read just goes over my head.

    O/S I run is linux (Centos) I'm not interested in programming games or creating visual stuff. What I am interested in is automating command line stuff. But I am a noob have never programmed in my life you mere mention of parameters, variables, loops and I start sweating :) I haven't learnt any programming logic in my life.


    I'm a comp sci guy. If you really want to program that's what you'll need.
    The rest isn't really programming just using other peoples code. Powershell, .net and java if you want to be a super admin. The real money is for people who can write the real code though not interpret it.
  • Options
    DevilWAHDevilWAH Member Posts: 2,997 ■■■■■■■■□□
    paul78 wrote: »
    icon_twisted.gif Sorry to go off-tangent but I couldn't help thinking about the anti-if campaign when I read your comment - Home | The Anti-IF Campaign

    I wasn't talking literally typing "if" "then" in to code, but the underlying logic that programs must obey at its fundamental level. Being a binary system all questions can only have a yes/no response. I would say being a good programme is being able to take real world situations and questions, and describing them in terms of logical operations. Being a good programmer is implementing these operations in the most efficient and robust way.

    I have to say some of those "monstercode" examples on the site remind me of my early attempts :), one thing I have never really delved in to is the "object orientated" side of programs apart from a few times of dipping a toe in. I would seriously suggest adding to your list a language that supports this. once you understand it, it does keep you thinking about how to make best use of the code you are writing.

    On a side note my way in to scripting out side of Batch scripts, was VBA in Microsoft Excel. Things like making a status check for network devices, so I could enter a list of IP and it would continual update there online status, or creating configuration from standard templates and lists of variables.
    • If you can't explain it simply, you don't understand it well enough. Albert Einstein
    • An arrow can only be shot by pulling it backward. So when life is dragging you back with difficulties. It means that its going to launch you into something great. So just focus and keep aiming.
  • Options
    tier~tier~ Member Posts: 86 ■■□□□□□□□□
    Everyone here has made some good suggestions. Whether you decide to start with Bash, Powershell, Python or C++ it really doesn't matter. What does matter is that you choose whatever will be most practical to you so that you can continually find new tasks to automate or programs to build because the only way to get better is by writing new code.

    If you don't have a problem to solve you'll probably never see the point and quickly lose interest. Here's an excellent article I read recently that expands upon that, https://medium.com/learning-to-code/565fc9dcb329.
    Let's Connect!
    LinkedIn, Twitter, Blog
  • Options
    ReliableGuy2.0ReliableGuy2.0 Member Posts: 12 ■□□□□□□□□□
    I stared with C too, Codelbox. User who started post, that's a good way to start.
  • Options
    ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
    C looks a bit intimidating :) my plan of attack so far is

    Udemy - intro to Bash scripting
    and python introduction

    Code academy - Python

    Learn python the hard way

    Python seems to be quite a noob friendly language from what I have seen. Once you have completed the intro courses how do you then take it to the next level and learn to apply a language to the operating system?

    What I mean by this is I run Linux and I have read that python has different modules. Is there a book that teaches you how to use the O/S module and helps you create administration scripts?

    How do you get from Introduction to that level?
    Microsoft's strategy to conquer the I.T industry

    " Embrace, evolve, extinguish "
  • Options
    W StewartW Stewart Member Posts: 794 ■■■■□□□□□□
    I'd recommend C/C++ to start off. It'll cover some things that bash might not include like object oriented programming. If you really want to learn how to program then you need to understand the concepts first. Syntax varies among languages but once you understand how to code in general, you can pretty much pick up on any language pretty easily. Once you understand those concepts then You can pick up on something like python or bash. Bash itself is pretty different then most structured programming languages but it's the best tool to automate linux commands when you don't need some of the more advanced concepts that other languages offer.
  • Options
    ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
    Start with C? Are you trying to put me off programming :) I thought the C languages were for the hardcore I'm a noob and writing hello world is the extent of my programming skills.
    Microsoft's strategy to conquer the I.T industry

    " Embrace, evolve, extinguish "
  • Options
    ptilsenptilsen Member Posts: 2,835 ■■■■■■■■■■
    I really have to disagree with recommendations to start with C or C++ or any low-level language. You do not need to understand how strings or memory management work at that level to get solid programming concepts. Unless you want to be a professional software developer or something along those lines, you really don't need C. And as far as learning order, C has been super easy for me to pickup because I'd worked with Java, Python, PowerShell, and so on and knew the core concepts and techniques. You can't do anything in C without learning the nitty gritty details along with the basics, and I just don't think those are every going to help you write better shell scripts, which is realistically the most you're going to do in an systems administration (or similar) position, nor do I think those will help you learn other high-level languages any easier. Learn Python, and BASH and PowerShell will come pretty easily. The same is true of C, but Python is easier to learn that C and as I mentioned before, that it parses indentations as syntax forces you to learn how to write code well.
    Working B.S., Computer Science
    Complete: 55/120 credits SPAN 201, LIT 100, ETHS 200, AP Lang, MATH 120, WRIT 231, ICS 140, MATH 215, ECON 202, ECON 201, ICS 141, MATH 210, LING 111, ICS 240
    In progress: CLEP US GOV,
    Next up: MATH 211, ECON 352, ICS 340
Sign In or Register to comment.