[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

(forw) [david-downey@codecastle.com: Re: learning programming]



Sorry folks for the forward, I didn't notice that mutt hadn't added
the CC to the list when I sent this so I'm forwarding it to the list
for completeness.

Glen, forgive the post directly to you and this posting as well.


Enjoy the holidays!



----- Forwarded message from "David D. W. Downey" <david-downey@codecastle.com> -----

Date: Tue, 25 Dec 2001 14:42:14 -0800
To: Glen Mehn <glen@squaretrade.com>
User-Agent: Mutt/1.3.24i
Reply-To: "David D. W. Downey" <david-downey@codecastle.com>
From: "David D. W. Downey" <david-downey@codecastle.com>
Subject: Re: learning programming

* Glen Mehn (glen@squaretrade.com) wrote:
> personal preference, I think. 
> 
> And perl/python is apples and oranges: python is object oriented (like java, C++), while perl is more like C.
> 
> A lot of people take issues with perl's lack of standards-- where {}, (), etc, may or may not be required.
> 
> As to having {} and ;, it's a matter of the language structure, and that's all. Whether or not you use them is simply a matter of how you structure the language.
> 
> glen


C CODE
========

#include <stdio.h>

int main()
{
    printf("Hello, world!\n");
    exit 0;
}


C++ CODE
========

#include <iostream.h>

int main()
{
    cout << "Hello, world!" << endl;
    exit 0;
}


PERL CODE
=========
#!/usr/bin/perl

    print "Hello, world!\n";
    1;



BASH CODE
=========

#!/bin/sh

    echo "Hello, world!";
    exit 0;



NOTES
=====

Hmm, all of them use the ';', all use (or can use) '\n', print
statements are similar. Perl and C++ can use the same syntax as the
C segment if you choose. Pretty much all interchangable here.

Other than language specifics like hashes, arrays, and strings are
done slightly differently in each of them. ::shrug:: matter of
preference I guess. (Didn't include python since I don't know the
language)

To the one who started this thread, look at the above syntax for the
most common starting point of learning any language, the Hello,
world! program. See which one you think is easiest for syntax. Bear
in mind these are the most basic of programs and as you get deeper
into any of them there will be some differences from language to
language, but overall they code the same. You choose.


-- 
David D.W. Downey - Creator of KiXO Linux - sourceforge.net/projects/kixolinux
Red Hat Certified Engineer - www.redhat.com/training/rhce/courses/rh300.html
LPIC-II Core Test Developer - Linux Professional Institute - www.lpi.org

----- End forwarded message -----

-- 
David D.W. Downey - Creator of KiXO Linux - sourceforge.net/projects/kixolinux
Red Hat Certified Engineer - www.redhat.com/training/rhce/courses/rh300.html
LPIC-II Core Test Developer - Linux Professional Institute - www.lpi.org

Attachment: pgp_vgolICpmy.pgp
Description: PGP signature


Reply to: