LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-26-2005, 05:57 AM   #1
caminoix
Member
 
Registered: Mar 2005
Location: cracow, poland
Distribution: Linnex, Gentoo, KateOS, PLD
Posts: 53

Rep: Reputation: 15
which language?


hello

i'm generally a newbie to programming; my whole experience is turbo pascal and javascript some time ago.

i'd like to start writing programs for linux and i want to learn a new language, only i don't know which one.
i need it to be able to do two things:
1. handling keyboard interruptions;
2. relatively easy creating graphical applications.

could you please help me in choosing?

ps. is c++ very hard to learn?
 
Old 06-26-2005, 06:21 AM   #2
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
Java . Very portable, easier then C/C++ and has an inbuilt graphical interface, very well documented and supported by Sun Microsystems. Found in everything too, in Web-browsers with the form of applets to Nokia cell phones games. Very easy to handle keyboard and mouse inputs, which makes it suitable for games as well (not joypad inputs, at least not with Java 1.4.x).

I'm reading a book now called Developing games with Java and it rocks (not for the beginner though).

On the top of it, you have plenty of Books, Tutorials and IDE's freely available on the net and support of big ones as IBM and Sun.

That's of course, just my opinion. Still, every Linux hacker should know some scripting language as perl or python too
 
Old 06-26-2005, 06:54 AM   #3
caminoix
Member
 
Registered: Mar 2005
Location: cracow, poland
Distribution: Linnex, Gentoo, KateOS, PLD
Posts: 53

Original Poster
Rep: Reputation: 15
oh dear. i'd crossed out java on the list 'cause i was pretty sure it's much too difficult.

i've just realised i made a mistake in the post. i should've written "intercepting", not "handling" keyboard interruptions.
i need a program to change "/a" to "a with a little stroke over it" and the like in openoffice.
i understand java can do it?

thanks for the tip
 
Old 06-26-2005, 07:23 AM   #4
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
I'm not quite sure what intercepting means in this case.. sorry for my ignorance :\. I'd give Java a go if I was you. Read this tutorial and see how it feels actually:

http://java.sun.com/docs/books/tutorial/index.html

see how both the "Hello World Application" and the "Hello World Applet" feels like. If you think it's way difficult, python is nice. I've just did a spaceship game with Python and Pygame, it's clearly much easier then Java and very powerful too.

I'm just interested in one thing when it comes down to Programming: Games. It's difficult for me to decide which language is "cooler" to program games with . I'm not sure what you would like to develop though . If it's just for learning purposes, then any language will do. Now, if you have an application/game in mind, then you've to think carefully. If you need speed, you certainly won't find it with Java... for example...

EDIT: Here is a screenshot of my game by the way
http://www.geocities.com/kooltux/games/frontier.jpg

Last edited by Mega Man X; 06-26-2005 at 07:34 AM.
 
Old 06-26-2005, 07:51 AM   #5
caminoix
Member
 
Registered: Mar 2005
Location: cracow, poland
Distribution: Linnex, Gentoo, KateOS, PLD
Posts: 53

Original Poster
Rep: Reputation: 15
the screenshot looks very nice is it ready for download yet, i mean the game?

yes, i know speed is not what java's designed for...

there's just one app that i currently have in mind.
i'm studying linguistics and i need loads of very strange signs very often. let's take the german "o umlat" (with two dots over it) for an easy example. that sort of stuff, just much more complicated and much more often, and certainly not limited to just one language or just one font.
so, i need an app which would sit down there in the memory, a daemon, i think it's called, and would read all the keys i press on the keyboard and once it would spot a combination of say, ":"+"o", it'd automatically change it to "o umlaut".
is it doable with java? with python? c/c++?

":"+"o" means colon-o without a space, but it got changed to an emoticon

Last edited by caminoix; 06-26-2005 at 07:53 AM.
 
Old 06-26-2005, 08:17 AM   #6
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
Hey mate thanks . Well, the game needs to have the code a little cleaner before I put it to download. Although, I enjoyed a lot programming with Pygame (in fact, it's the first time I understood what I was doing, thanks for python being so clear), a lot of peoples have been facing a lot of dependencies issues to get it to run in Windows.

I've tried to build an exe with py2exe, but did not work. Asked a few peoples on IRC, still no go. That's why I'm dumping pygame for my future projects and going java, since I need network support for online gaming and not speed.

That game in pygame I'm doing is called The Final Frontier and it's a heavily modified version of a tutorial from Linux journal. I might release it soon, but again, I'm not going to code with pygame for a while. I'm trying to focus on Java for the moment .

I understand now what you mean about the keys. I never did it myself, but I know Java handles keyboard inputs in 3 different ways:

- keyPressed()
- keyReleased()
- keyTyped()

I think if you make a function for keyTyped, you could create combos, as emacs does. Still, keyTyped is pretty much useless for games so I won't be able to help you out much...

This is just a guess, as I've no experienced with the keyTyped() event, but I think it's pretty much what you are looking for
 
Old 06-26-2005, 10:06 AM   #7
sekelsenmat
Member
 
Registered: Apr 2005
Location: São Paulo - Brazil
Distribution: Mageia Linux 1
Posts: 353

Rep: Reputation: 30
Re: which language?

Quote:
Originally posted by caminoix i'm generally a newbie to programming; my whole experience is turbo pascal and javascript some time ago.

i'd like to start writing programs for linux and i want to learn a new language, only i don't know which one.
Since you already know Turbo Pascal, why don't you try FreePascal + Lazarus???

Lazarus is a very powerful Delphi-like RAD environment. Using FreePascal and Lazarus you can build multiplatform programs and compile for Linux, Windows and MacOS.

http://www.lazarus.freepascal.org/

It uses the powerful FreePascal compiler: http://www.freepascal.org/

Quote:
i need it to be able to do two things:
1. handling keyboard interruptions;
With object pascal you can handle keyboard strokes using the system "messages" sent to your windows. Very easy, just like this:

MyWindow = class(TForm)
.... (buttons and stuff maintained by Lazarus)
private
procedure HandleKeyDown(Msg: TMsg; Key: Word; Shift: Boolean; ...); message LM_KEY_DOWN;
procedure HandleKeyUp(Msg: TMsg; Key: Word; Shift: Boolean; ...); message LM_KEY_UP;
end;

Any key down message sent to the window you go throght that procedure. You could also place it a button or a component you created.

This I just wrote from what I remember doing, so the parameters / message names should be a little different.

If you are talking about low level interruption, just include assembler code!

Quote:
2. relatively easy creating graphical applications.
As easy as Delphi. As easy as Visual Basic. Just drag the components into the window and set their properties.

Quote:
ps. is c++ very hard to learn? [/B]
It is considered more difficult then pascal to learn.
 
Old 06-26-2005, 10:29 AM   #8
mohama
Member
 
Registered: May 2005
Location: solar-system->earth->northern hemisphere
Distribution: ubunutu+knoppix+suse
Posts: 197

Rep: Reputation: 31
answer

hi ,

go to programming forum ... search a thread sent by (( mandrakelinux )) with title 'different between c and java' ...

good luck ,
bye,
 
Old 06-27-2005, 08:41 AM   #9
davholla
Member
 
Registered: Jun 2003
Location: London
Distribution: Linux Mint 13 Maya
Posts: 729

Rep: Reputation: 32
Quote:
Originally posted by Megaman X

I'm reading a book now called Developing games with Java and it rocks (not for the beginner though).

Is this the book you mean ?
http://www.amazon.co.uk/exec/obidos/...795177-9919011
 
Old 06-27-2005, 09:49 AM   #10
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
Hi davholla!

That's the one. Awesome book. If you go to the author's homepage, you can test a game that we(by we, I mean, the readers, ghehe) are slowing developing along the book, besides all the source included within the book:

http://www.brackeen.com/javagamebook/

It's a must have on the book case ^_^

Last edited by Mega Man X; 06-27-2005 at 10:33 AM.
 
Old 06-27-2005, 10:36 AM   #11
davholla
Member
 
Registered: Jun 2003
Location: London
Distribution: Linux Mint 13 Maya
Posts: 729

Rep: Reputation: 32
Hi Megaman,

Thanks for that, when I finish head first Java I will get this.
At the moment my Java is basic but I have only just started.

Does the book cover games for mobile phones ?

David
 
Old 06-27-2005, 11:49 AM   #12
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
You're welcome davholla =)

Nope, only fullscreen games with Java Standard Edition. Not even Applets or Windowed games are covered here. For cell-phones, take a look into Micro Java Development, by David Fox. I haven't read it myself, but the author of Developing games with Java recommended him and by the quality of his book, I think he knows what he is saying ^_^

Either way, you will love that book. I have only known Java and games for applets, but creating stuff in Fullscreen and getting reasonable speeds really changed my thoughts about Java...
 
Old 06-27-2005, 12:25 PM   #13
caminoix
Member
 
Registered: Mar 2005
Location: cracow, poland
Distribution: Linnex, Gentoo, KateOS, PLD
Posts: 53

Original Poster
Rep: Reputation: 15
thanks for help, guys
as a matter of fact, since almost everyone was saying "take java" or "take c" or "take python" or "take c++", i got to the conclusion that it doesn't really matter what i begin with, and whatever i pick, there will always be those hip-hip-hurraying and those turning their noses up.

i eliminated c as a no-point-doing-that-if-i-can-get-to-c++; i eliminated java as too slow (?); i eliminated python as perhaps not getting low enough. i was left with c++ and that's what i've started doing yesterday and it looks pretty ok so far. we'll see. i guess once i'm done with a little more than just the basics, i'll take a look at python. i don't want to learn two languages at once 'cause i'm sure i'd mix them both up completely.

THANK YOU ALL FOR HELP
 
Old 06-27-2005, 01:53 PM   #14
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
Actually, you've taken a good decision ^_^. The concept of programming is always the same, regardless the language. A variable is a variable, a function is a function and it will be used in the very same way in any language.

What you've to consider when deploying an application is: Type of application, time to develop, audience and speed, among other factors. Java is much faster then you think if used effectively and if necessary, java code can be compiled into binaries instead of byte code and python is very powerful and no near as high as you believe either... even pointers can be used with Python. But it's better to let you find those things by your own =)

Good luck with programming. Check LinuxQuestions reviews for some tips about books, you will need plenty of them ^_^

Last edited by Mega Man X; 06-27-2005 at 01:54 PM.
 
Old 06-27-2005, 04:57 PM   #15
caminoix
Member
 
Registered: Mar 2005
Location: cracow, poland
Distribution: Linnex, Gentoo, KateOS, PLD
Posts: 53

Original Poster
Rep: Reputation: 15
perhaps you're the most right: it looks like all these languages are in fact pretty much the same and i think i guess it doesn't really matter which one i begin with. what counts is that i actually began
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Best first language? NotJustANewbie Programming 33 09-04-2005 06:03 AM
D language greg108 Programming 33 11-18-2004 08:53 AM
Which language? scuffell Programming 1 07-01-2004 08:17 PM
which language? 2k. Programming 4 11-04-2003 09:44 AM
Which language is best? awdoyle Programming 16 03-23-2003 07:34 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration