ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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).
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.
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.
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?
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.