LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-23-2005, 04:12 AM   #1
Murdock1979
Member
 
Registered: Oct 2003
Distribution: Slackware Debian VectorLinux
Posts: 429
Blog Entries: 2

Rep: Reputation: 30
Linux Programming


Hello!

I am seasoned DOS/Windows programmer and want to give a shot at Linux programming.

I started off with DOS's GW-BASIC, and then slowly moved up to C, C++. But when Windows became popular, it became virtually impossible to create a decent program just using C++. Eventually, Micro$oft came out with their Visual Basic, C++ line of products, which I found surprisingly powerful. I am currently concentrated in Visual Basic. (Now they've got .NET, but I'm not there yet...why reinvent the wheel?)

So, for Linux programming, there are two main issues that concern me:
1. It is a multitasking environment
2. How to properly do GUI programming
3. Device communication

In Windows, you have objects, COM, OLE, etc. etc.

How does Linux do it?

Thanks!

Murdock
 
Old 09-23-2005, 06:57 AM   #2
addy86
Member
 
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Rep: Reputation: 31
Re: Linux Programming

Quote:
Originally posted by Murdock1979
1. It is a multitasking environment
2. How to properly do GUI programming
3. Device communication
1.) Is this a question? If yes: yes, Linux is a multitasking environment.
2.) There are many ways: you could use SDL (recommended for games), or maybe this article helps you: Linux GUI Application Development for Windows Programmers
3.) I don't know what exactly you mean. Look at open(2), write(2), read(2), ioctl(2).
 
Old 09-23-2005, 07:53 AM   #3
Murdock1979
Member
 
Registered: Oct 2003
Distribution: Slackware Debian VectorLinux
Posts: 429

Original Poster
Blog Entries: 2

Rep: Reputation: 30
Thanks for the quick response!

Actually, I wasn't asking a question. I know that Linux is multitasking. I was expressing my concern, because DOS programming is extremely simple due to its non-multitasking environment, while Windows programming, if your not using micro$oft's visual studio, will take around 2 lifetimes to write something useful. Part of the reason Windows programming is so cumbersome is due to its multitasking nature (always needing to communicate with the mother OS and have concern for its peers). I was wondering how Linux compares in this concern.

When I asked about device management, I guess my question is also about multitasking, since a device is managed by the OS and not the individual programs, I was also mentioning that issue.

Any further help will be great!
Murdock
 
Old 09-23-2005, 10:19 AM   #4
rstewart
Member
 
Registered: Feb 2005
Location: Sunnyvale, CA
Distribution: Ubuntu
Posts: 205

Rep: Reputation: 38
Hi,

The two environments are very, very different. In Windows everything happens because of message events and programming applications in that environment is generally writing a bunch of event handlers. This is because the GUI is the OS. In Linux you may, or may not need a GUI. The Linux OS, or kernel is responsible for the multi-tasking, memory management, device I/O, etc. The interactions with these sub-systems is as little, or as much as you require.

Take multi-tasking for example; You can write a very simple CLI type of application that does not need to do anything extra because of multi-tasking. From the application's point of view, it is running as the only executable on the system and has complete and total access to all system resources - sort of like your DOS application example. Alternatively, you can write an application that spawns off many sub-tasks where each of the sub-tasks may or may not interact with each other and/or may or may not even do things in parallel (not true parallel as there is still only one CPU in a non-multi CPU system). In the multi-tasking (multi-threading) case, each of the threads may be assigned different functions based upon events, etc.

For GUI programming there is raw "X", although I would not suggest that you do things at this level, and there are interface support libraries such as SDL, GTK, etc.

For device interaction, there is nothing like COM, OLE, etc. Each "device" that you want to interact with should have a published interface, you communicate with it using that interface. That interface may be direct function calls through a vendor provided linkable library, the kernel's read/write/ioctl interface, or any number of IPC (inter-process communications - shared memory, message queues, sockets, etc) mechanisms.

Basically what this boils down to, is that there really isn't a simple answer to your question. It depends upon what you need to accomplish. The Linux system is a very powerful set of building blocks, how you choose to use those blocks are up to you.
 
Old 09-23-2005, 12:42 PM   #5
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
To the extent you might have been doing system programming, the differences between Linux (basically, the POSIX API) and Windows (the Win32 API) are actually less than you might expect. Linux shines (IMHO ;-)) over Windows.

However, to the extent you've been writing apps under VB6 ... well, I haven't found anything even remotely close to Visual Studio. And my regard for Visual Studio 6 (and the integrated MSDN help) extends to C/C++. On Linux, I used "vi" as my editor, "gdb" as my debugger, and "man" as my API reference. I really haven't experienced anything better (including glade2, KDevelop and Eclipse). But none of them hold a candle to Visual Studio...

ANYWAY:

Since you seem to be in the market for "something different", why not experiment with Python?

Just a thought .. PSM

Last edited by paulsm4; 09-23-2005 at 03:32 PM.
 
Old 09-23-2005, 01:57 PM   #6
cuiq
Member
 
Registered: Aug 2004
Location: Philly
Distribution: Debian Lenny, FreeBSD
Posts: 577

Rep: Reputation: 30
....or Gambas


peace V
 
Old 09-23-2005, 02:15 PM   #7
MicahCarrick
Member
 
Registered: Jul 2004
Distribution: Fedora
Posts: 241

Rep: Reputation: 31
I think it's also worth checking out, in addition to eclipse for C/C++ IDE, is Anjuta as the IDE with Glade for designing the Interface in GTK. Combining the two using is about as close to a Visual Studio as I've seen. But yes, it is far from Visual Studio.

And also, in regards to MSDN, it would be worth checking in to the DevHelp project for library API reference at your fingertips.
 
Old 09-24-2005, 07:01 PM   #8
primo
Member
 
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
Be careful extrapolating concepts from both worlds.

Here we have RPC but it's not the same thing. Search for sockets. There are inet sockets and Unix domain sockets for interprocess comunication. They share the same API and it's trivial to build a library that abstracts both.
 
Old 09-26-2005, 12:58 PM   #9
Murdock1979
Member
 
Registered: Oct 2003
Distribution: Slackware Debian VectorLinux
Posts: 429

Original Poster
Blog Entries: 2

Rep: Reputation: 30
Has anyone tried Kylix 3 Open Edition from Borland?
 
  


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
Difference between Top Down programming & Bottom up programming minil Programming 1 06-17-2005 02:42 AM
New Forum for Linux-Gurus[Programming/Administration] or Linux-Advanced Users [ Progr raees LQ Suggestions & Feedback 5 04-12-2005 07:35 PM
3d Programming Linux RohanShrivastav Programming 4 03-21-2005 08:30 PM
Linux Programming!! diegofalciola Programming 7 12-08-2003 09:17 AM
Exp. Windows/Linux-Script Programmer - Need Linux Programming Mentor! ruttiger Linux - Newbie 2 10-28-2001 11:00 AM

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

All times are GMT -5. The time now is 11:01 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
Open Source Consulting | Domain Registration