How to start??????

Code junkies hangout here

Moderators: ChrisThornett, LXF moderators

Postby 1slipperyfish » Sun Aug 21, 2005 9:59 am

i think java is the best language to begin with as it's is fairly straight forward, but powerful, that was my first language(sams teach yourself java in 24 hours) i have also had a go a few others jscript, c#, c++, python but none of them compare to java in my opinion :roll:
if you decide to learn c++ from the internet beware as most offerings are in an older version of c++ and are not compatible with most new compilers :roll:
</two penneth>
paul
i am a follower of the culture

Image
User avatar
1slipperyfish
Forum Jester
 
Posts: 2431
Joined: Mon May 09, 2005 2:52 pm
Location: wigan

Postby jjmac » Sun Aug 21, 2005 10:46 am

Howdy 1sf (troll)


A lot of the C/C++ is ancient ... true. X is a good example there (grin). Java was basically designed to contain the programmer from themselves ... that is, enforce safe habbits in order to get embedded production systems up and running. The net idea came later, so it isn't the "pure" lang that it often promotes it self as. I do like java, but comes accros as a bit restrictive for my tast. And it isn't that fast, unless you have a fast box that is. C++ has come a long way over a short time. One problem that people will have yhough ... is that when they attempt to code in plus, they will either try to impose the concept space of another language on it, and then get disapointed when they find problems there ... or they think they __must__ do the full object thing. As Mr BS says, well written C will be C++ by default. If written to modern specs. Ic'e seen .cc or .cxx files with "printf" functions being used, and that just ain't plus :).

But i can see what your saying though :), java was my real first lang aside from basic. At the time there was a lot of documentation around, so it was also very accessable. Mainly due to Sun pushing it forward i guess. And the first always seems to have a certain hold.

Java is more of a smallTalkish kind of thing really too, that uses C++ style syntax ... and hides all its pointers (grin). And very library based, but so is C++ now anyway. Apparently one can get gabbage collection for plus too :roll: But, of course, i haven't looked there (money).

The older versions -=- well, theres an opportunity to translate fragments up. :)


jm
http://counter.li.org
#313537

The FVWM wm -=- www.fvwm.org -=-

Somebody stole my air guitar, It happened just the other day,
But it's ok, 'cause i've got a spare ...
jjmac
LXF regular
 
Posts: 1996
Joined: Fri Apr 08, 2005 1:32 am
Location: Sydney, Australia

Postby 1slipperyfish » Sun Aug 21, 2005 7:24 pm

i just meant that if you're a beginer java is a lot easier to learn as you say, no pointers, automatic garbage collection, i have quite a fast box so i've never really noticed a difference in speed, and when i was learning c++ a lot of the tutorials on the internet where actually more c than ++ in their syntax( i presume this was an earlier version of ++/ late version of c to get coders to change languages)
also with a good grounding in java the transition to c and all it's variants will be a lot easier(well i thought so anyway :D )
paul
i am a follower of the culture

Image
User avatar
1slipperyfish
Forum Jester
 
Posts: 2431
Joined: Mon May 09, 2005 2:52 pm
Location: wigan

Postby jjmac » Mon Aug 22, 2005 1:33 pm

Howdy 1sf (troll),

I mentioned it hides its' pointers, not that it dosen't have them ... all passes in java are by reference not value. It's just that your not allowed to do arithmetric on them, and "dot" syntax is used rather than ->. References are pointers basically really. And there are proprietry gabbage collecter available. But if all your objects/types have handles ... there not really needed with care. A lot of the leaking in C/C++ was really occuring in the libraries rather than directly in the apps too. But even libc has come forward on that issue.

I know what you mean though, when you mentioned "a lot of bad code", like, is there what :). One thing that drives me crazy is when a "non-object" creation is found in src. Such as a function pass where a parameter is replaced with just a "new blah" statement. Rather than a declaration, call to new, then passing the handle. How can it be deleted other wise :roll: Heaps of that goes on unfortunately. But thats a habbit issue.

A lot of the code out there is old ... in context with older standards ... but things move quickly, so i would think that in whatever is being learn't ... the info refered to should be in terms of the current language standard. Though i bet the X coders probably wouldn't agree there, lol :roll:

>>
i just meant that if you're a beginer java is a lot easier to learn ...
>>

Can't agree there. It all depends on what learning facilities are available to a person and how the person relates to the sources their learning from. Java is great though, i quite like it. But i think i realised that the main reasons were that i had access to free Java IDEs (PCPlus) and the language aspects i liked were the C/C++ ones anyway. Syntax flexability.

And what about "BASIC". Iv'e had some great times with basic. It handles strings just so well (grin). And does good math too, with a few tricks applied sometimes.

Even LT (tux) said once that C++ was no good, in that he tryed it for the kernel once but it was to cumbersome ... so C was the choice. But that was back in the mid nineties, and at the time the comment was true. ++ has gone through a lot of ratification since. I think we are all still in yesterday (grin).

>>
a lot of the tutorials on the internet where actually more c than ++ in their syntax
>>

There the same, except that well written C, complying with modern C standards, will be C++ by default.

It's like ... say you declare an int in a function ... then you create a conditional statement ... say "if (blah) { }"

Then you declare another int, same name, within that conditional. In old C, that would be an error, due to the double declaration within the function, but in ++ it wouldn't. It would just hide the outer int for the duration of the conditional.

That provides a more flexable structure ...

Code: Select all

int blah_func()
{

   int i;

   i = 7;

   if (blah) {
       int i;
       i = 8;
 
       whatever ....
    }

  return i;
}


You have two "int i"'s in ++, as the inner will hide the outer. In C you would likely get an error or a warning.

Though it's all 6 of one and half a dozen of the other really :) i guess. I always like McGrawHill books whenever i come across them. They seem to generally have a fairly good reading style about them :)

>>
i have quite a fast box so i've never really noticed a difference ...
>>

(grin) it helps :)



jm
http://counter.li.org
#313537

The FVWM wm -=- www.fvwm.org -=-

Somebody stole my air guitar, It happened just the other day,
But it's ok, 'cause i've got a spare ...
jjmac
LXF regular
 
Posts: 1996
Joined: Fri Apr 08, 2005 1:32 am
Location: Sydney, Australia

Postby 1slipperyfish » Mon Aug 22, 2005 7:13 pm

i have never learned c as i have always been lead to believe that it is a very leaky language(security wise) and with java you can't accidently write something that will start to ?systematically? delete your hard drive :roll:
it could happen :D
paul
i am a follower of the culture

Image
User avatar
1slipperyfish
Forum Jester
 
Posts: 2431
Joined: Mon May 09, 2005 2:52 pm
Location: wigan

Postby A-Wing » Mon Aug 22, 2005 7:24 pm

GCC4 pretty much fixes all the leakyness as you call it. With the correct libraries or good programming they don't happen anyway.
I haven't seen a C program that can accidently delete your hard drive, don't see how it can happen unless you are doing low level disk access which you shouldn't be doing anyway.
Andrew Hutchings, Linux Jedi
http://www.a-wing.co.uk
User avatar
A-Wing
LXF regular
 
Posts: 460
Joined: Tue Jul 05, 2005 7:25 pm
Location: Wellingborough

Not Basic! Nooooo!

Postby overflow » Wed Aug 24, 2005 11:21 am

Avoid Basic in all its flavours. It is a ghastly language. You will have to unlearn all sorts of bad stuff when you progress to a proper language.

Start with Python. It is a very clean, uncomplicated language with some very nice features and a clear object model that is easy to understand.

http://www.python.org

There is also a very helpful newsgroup at comp.lang.python.

Getting the hang of objects, both using other people's objects and writing your own is a vital step in learning programming and Python will help you understand that. You can then explore other languages like C++ and Java, which make objects more of a drama.
overflow
User avatar
overflow
LXF regular
 
Posts: 158
Joined: Tue Aug 23, 2005 1:40 pm
Location: London

RE: Not Basic! Nooooo!

Postby jjmac » Sat Aug 27, 2005 11:31 am

Howdy overflow,

I'm not disagreeing with you [ i think (grin) ] ... but,

I don't think that objects are really that neccessary initially, in order to learn a language. They may well get in the way of getting familiar with the overall mind space associated with a particular language too. The less complext that stage is the better -=- more fun, with the satisfaction of actually getting small units to work.

Different languages have different paradigm associations ... so comparisions become somewhat futile really. As BS has said ... it's a common mistake that people do, to bring the mind space of one language, often something their more familiar with ... and try to impose it on an other language. Resulting in a disapointment in how the other language performs (for them).

So what ever language is being considered, it needs to be looked at in terms of its' own purpose rather than in terms of some thing else. and in all cases/flavours ... why make it over complexed. Better to have fun with it than try to grasp all of its aspects to soon. What ever understanding that may be there, hidden away in the more esoteric areas of a particular language ... forget it ... it will reveal it self eventually depending on how long the person has been involved with it. Much easier that way i recone.


When you say "more of a drama" ... in what way do you mean ?


jm
http://counter.li.org
#313537

The FVWM wm -=- www.fvwm.org -=-

Somebody stole my air guitar, It happened just the other day,
But it's ok, 'cause i've got a spare ...
jjmac
LXF regular
 
Posts: 1996
Joined: Fri Apr 08, 2005 1:32 am
Location: Sydney, Australia

Postby overflow » Sat Aug 27, 2005 9:02 pm

More of a drama owing to the number of different types of objects which necessarily introduce syntic elements that Python doesn't have. Like: 'public', 'abstract' and 'final' for example. These are confusing concepts to somone learning about classes.

Python lends itself really well to someone learning programming. Simple stuff is really simple in Python.

Code: Select all
print "Hello world!"


As a first program, it doesn't get much simpler than that.

But this initial simplicity doesn't hinder using the language for large, complex projects. I work at a software company and we use Python for just about everything.

We take on new recruites straight out of university and they learn the language from books with peer help. Generally these people already know Java or C++ but they take to Python and everyone prefers it.

It is a remarkably productive language.
overflow
User avatar
overflow
LXF regular
 
Posts: 158
Joined: Tue Aug 23, 2005 1:40 pm
Location: London

Postby Arion » Sun Aug 28, 2005 7:29 pm

The unfortunate fact, as I'm sure you've noticed, is that you can ask 10 different people what programming language to start with, and you will get 10 different answers.

Personally I would recommend Python, although I'll go through a few of them, highlighting what I think are advantages and disadvantages as a first language.

I hope you find the following useful. Having tried all the following languages I would recommend Python, for its sliding simplicity(simple for simple stuff, with advanced features when you need them), and good habit generation.(Python insists on indentation).

C/C++:
Once you know C or C++ anything else will be relatively easy. A lot of languages use C syntax, including Java, Javascript, PHP, and to a certain extent Perl.

C is a very difficult language to master. It requires a lot of learning theory, and you need to learn things about memory management, and memory allocation and all that. There are libraries(prewritten/reusable pieces of code) to help you out with this(such as GLib). C++ uses different libraries, but from an ease of learning point of view, it is C but way more stuff to learn. Very few people know 100% of C++. A very good C++ programmer would know about 90% of the language.

Perl:
Perl is an excellent language for processing text. It is however the only language that looks the same before and after encryption. This makes it very hard to read existing code, to learn new stuff. In many cases you need to study each character before deciding what it all means. On the upside you don't need to worry about memory management.

Java:
Java is a bit like C++ without the memory management, plus manditory OOP(Object Orientation). You can write non-OOP with C++(which will be basicly C), but java insists that everything is an object.

Python:
Python is a very OO language, perhaps even more so than Java. Everything from a string to a number to a number to a function to er just about everything, is an object. This only becomes clear when you learn more about the language.

Indentation is manditory in Python, where as in C-syntax languages(all languages discussed so far), Indentation is strongly encouraged. Indentation is a good habit to get into, and Pythons insistance is IMO a good thing. With python you use as advanced or as simple of concepts as you like.

PHP:
PHP is a language designed originally for web development, in which it excells. It has since made its way into GUI and console development, but it doesn´t have the same community support as some of the other languages discussed here. PHP GUI development is restricted to GTK, where as Python has pyGTK, PyQT, wxPython, and a lot more besides.

Javascript:
Javascript is very like C without the variable types, and memory allocation. It isn´t quite as Object oriented as it is object based. By that I mean you generally don't make your own objects in JS(it's messy IMO), but you use the pre-built ones provided by your enviornment.

The other advantage with Javascript is that you already have all you need to start programming, namely a web browser.
Arion
 
Posts: 5
Joined: Sun Apr 24, 2005 6:41 pm

Postby jjmac » Thu Sep 01, 2005 12:13 am

overflow:
>>
As a first program, it doesn't get much simpler than that.
>>

:)

jm
http://counter.li.org
#313537

The FVWM wm -=- www.fvwm.org -=-

Somebody stole my air guitar, It happened just the other day,
But it's ok, 'cause i've got a spare ...
jjmac
LXF regular
 
Posts: 1996
Joined: Fri Apr 08, 2005 1:32 am
Location: Sydney, Australia

Previous

Return to Programming

Who is online

Users browsing this forum: No registered users and 3 guests