Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Programming Advice

Options
  • 10-05-2002 8:39pm
    #1
    Registered Users Posts: 1,226 ✭✭✭


    I'll be finished the leaving in a few weeks and after that I want to learn to program. I realise its going to take alot of time and practice but I just have a few questions before I start.

    Which language should I learn? I want it to work on all platforms and be "flexible!" it can be used for alot of different things, eg cgi scripts, general programs etc. I was thinging C ? Or is C++ the one to go for? Or just something completely different?

    Secondly, whats the best way to go about learning the language? Online tutorials? Books? Looking at code?

    Thanks for any help I get!


Comments

  • Closed Accounts Posts: 43 Kid Icarus


    Possibly start with Java (it's similar to C++ but a little easier). Then move to C++. Buy yourself a book and learn from that (practice, practice, .....).

    To get yourself a compiler, you might get one with a book, or on the cover of a magazine. If all else fails, download one. Finding a free one shouldn't be too hard (try Borland's site). Other than that, stick with it and don't expect too much too soon.


  • Registered Users Posts: 707 ✭✭✭d4r3n


    i started with C myself and found that after that it wasnt all that differnt, books are good. dont just read them though actually make use of the code they supply whilst reading through it, helped me anyway. gl with it


  • Registered Users Posts: 1,783 ✭✭✭Puck


    I started out on Java myself and am still really in to it. It's very flexible and once the penny drops on Object Oriented programming everything is so much easier!

    As regards learning how to program, there are some really great books out there but they'll never be any use to you unless you actually keep programming and programming untill it sinks in.


  • Closed Accounts Posts: 5 angelr


    first programming language i had a look at was C.
    ben learning C++ for the last year in college.

    here's sum links to the book on C (C Tutorial 21 days) i used when i first thought about programming.

    SNIP

    have fun.
    :-)


    --

    I do believe that's quite illegal... and shame on you, you didn't even upload the copyright page. :)

    There are plenty of open copyright books (can we call them open source?? :)) and tonnes of other resources to be found on the web, try linking to one of them instead, but be certain it's not pirated please.

    Cheers,
    Al. (Trojan)


  • Registered Users Posts: 1,226 ✭✭✭stereo_steve


    Thanks for all the help. I think I'm gonna go for either C or C++. Just a few questions, What exactly is object oriented programming? Can C not be used for large programs? Should C++ be used instead?


  • Advertisement
  • Registered Users Posts: 1,038 ✭✭✭rob1891


    You will probably not find the object orient approach of any use at first, but once you start on larger projects it will proove it's worth.

    Basically when you code, rather that just hacking out the algorithm, you try to identify the structure of the data your are manipulating.

    So, say I am writing a program to track employees and their preformance. What you might want to know about an Employee: their name, dob, qualifications, hours a week, salary, department, promotion history .... etc.

    If you wanted to hurt yourself you could build arrays of data and put those arrays into more arrays and it would be all very messy. Or you could design an employee object. Inside the object would be strings for name, integers for salary, Date objects for dob! You could even design promotion objects and add them in too.

    It's called data encapsulation, it's all wrapped up in a neat little ball.

    What's of even greater importance is code reuse. You could write an object for a general employee, then extend that object to a temp employee, voluntary employee, salary employee. In each of these you would only need to override whatever code you had written to deal with the general employee's salary.

    If you have yet to ever write any code then do not worry about this stuff, keep it in the back of your head so that in a month or two you can read up on it.

    One of the handiest ways to learn about Object Oriented Programming is to start using the libraries of your chosen language. Libraries are bits of code that can be used by you for certain purposes, they simplify operations that could otherwise be quite complicated. i.e. inputting and outputting from/to would be a nightmare if you had to write ALL the code yourself, but the libraries provide an Object that will do all this for you.

    If you've already decided on C++ then ... well HA! I found it very difficult to get my head around the standard libraries in C++ because it seems there are none! (there are really, but never ever look at their source, agh, it's very confusing!). Java on the other hand, and in particular JBuilder (very neat easy access to information and help), provides quite a large and very well documented standard library.

    Have fun with your little project, and like before, stick with it, or even better do a computers diploma/degree, they will MAKE you stick with it!

    Rob


    (oh, is C used for large scale projects? I don't think so, at least not any more. Any new project would probably be written using an object oriented language)


  • Registered Users Posts: 1,226 ✭✭✭stereo_steve


    Thanks a million for all the help above, especially rob1891. That must have taken a good while to type out! hopefully it all goes well! Thanks


  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes


    Originally posted by angelr

    have fun.
    :-)


    *Ahem*

    © Copyright, Macmillan Computer Publishing. All rights reserved.

    You shouldn't be posting that to the net. It's wasn't typed out. It's the CD you get with the book.


  • Moderators, Society & Culture Moderators Posts: 32,285 Mod ✭✭✭✭The_Conductor


    Visual Basic is a decent object orientated programming language. Its probably installed on your computers there in college. Waterstones have a couple of programming books in their bargain basement on Dawson street- normally they'd set you back easily 40 or 50 pounds (or more), but you can pick up ones with damaged covers or other impairments for next to nothing.
    Have fun.


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    Originally posted by stereo_steve
    Thanks for all the help. I think I'm gonna go for either C or C++. Just a few questions, What exactly is object oriented programming? Can C not be used for large programs? Should C++ be used instead?

    Object Oriented programming in layman's terms.......
    Think of building a car. If you were to take every single little piece of the car, and start building from the front bumper along, it's gonna be really really hard to keep it all together, and at the end, when it doesn't work, it'll be really hard to find out where you went wrong.
    The way you would obviously do it is to build the engine, chassis, steering, transmission, etc etc, and test them all indivdually, then put them together. It'll then be much easier to track down where you went wrong if something doesn't work, and different parts, e.g. the engine, can be replaced without rebuilding the entire car.

    Such as it is in OOP. Each thing you want your program to do is made into it's own little separated part, and then you fit them all together, to interact with eachother to make your program work.
    Heavily OOP based programs only contain a few hundred lines of normal code and several thousand object references.

    Don't worry it'll all make sense after you do it.

    I've heard some gurus comment on the benfits of learning C as a first language, simply to learn how to program efficiently. Object code is quite bloated, and heavy, so C is still the choice for the die hard Linux/Unix enthusiasts, but OOP is fast becoming a requirement for jobs, especially Java.

    :)


  • Advertisement
  • Registered Users Posts: 14,148 ✭✭✭✭Lemming


    I stated with COBOL (but that's just me). I'd recommend learnnig a structured language like C first, before moving onto OO languages like C++, Java, or Delphi et al.

    The benefit is this: strucuted languages such as the aforementioned C will get you thinking in logical terms - and you'll examine how do get things done.

    Migrating from logical structure to OO-Programming is easier than the other way around.

    As for Object Oriented Methodology: If you're doing Biology for LC you'll pick up the general idea REAL quick - remember all those classifications of organisms?


  • Closed Accounts Posts: 76 ✭✭photty


    Actually I think C is an excellent primer and starting point. Once you have written small single file programs the next step is to learn about interface and implementation. C lets you mimic a lot of the advantages of OO and get the principles down before you move on to C++.
    For example, try to write a library that does something useful and you will link against stuff you write in the future. A debug/trace library is a perfect excercise for this. Heres the way to approach the problem:
    - Define a set of requirements for the block. What will this thing do? E.g Allow many different blocks to use the debug facility, Enable/disable debug on the fly, etc. etc.
    - Next decide how you are going to tackle the requirements. Do this with pen and paper.
    - Try to split the block into different bits you can tackle individually
    - Develop the public interface to the block, e.g block_api.h (and dont forget the extern "C" {} )
    - Go ahead and make the block_api.c implementation and perhaps
    split this into more files. E.g. block_os.c might be an OS wrapper layer, block_net.c might be the interface to a sockets library
    - Now you can test it out
    - Rinse and repeat until you have something useful

    When you write you're C code remember to make use of the static keyword for both variables and functions. This is like data hiding that C++ promotes. Only make global what you really need to and make sure you give it a suitable prefix.

    So try out some neat stuff like a mini web server to flip off/on debug for different blocks. Also allow debug to be sent to udp you can write a small client to dump this). It's just trace but believe me it's a nice library to have if you ever need to work without a debugger (and at some point you will!)

    Anyways the point is get used to the idea of compiling you're code into object files and then linking into librarys with clear interfaces.

    Good luck!


  • Closed Accounts Posts: 61 ✭✭wish


    Well
    I would recomend that you start with PERL...
    :rolleyes:
    Like I love it


Advertisement