Which languages are best to learn for pc applications?

M

Thread Starter

Mike

I'm interested in learning how to utilize pc's for control/automation/data acquisition applications, and I'm not sure what would be the best language(s) to learn for this.
I've taken an introductory course in computer interfacing, so I've learned some basics in C and Assembly. Not sure where to go from here.
What's the best "bang for the buck"??
Is it VB? Java? C++???
 
A

Arturo Martinez

I think that 'best language´ depend of application type; I mean that all langauges has advantages and disadvantages, that can be important or not for specific applications. I use Visual Basic because has advantages for my applications: more quickly and simple to development than C or Java, strong support for Database and third parts modules (OCX), and their disadvantages don't care: I no need I/O velocity of C, portability of Java, small size of executables, and so..
 
C

Curt Wuollet

C and C++ are most universal. Java is popular for e enabled and some business apps but is little used for shrinkwrap. The MS languages are popular but, of course, are only useful on that platform. I would say the best for providing background would be C then C++. C because you learn something about what is going on under the covers and good general practices in a small language and C++ to build on that with Object Oriented Programming. As we go from the PC era to the post PC era, languages suitable for embedded platforms are becoming important. I've found people who have no experience with low level languages have
a very hard time with anything but coding applications and sometimes simply changing environments. We often need to dip below that level for automation. YMMV and I do know people who make a living and do only VB and the like. It's actually quite hard to find hardcore programmers anymore who can hit the ground running in a variety of situations. I can work in several, but prefer C and would have to be pretty hungry to do COBOL or BASIC. Actually, I'm trying hard to forget everything but C. If I ever do large applications again, I'll brush up on C++.
A lot of folks my age grew up with microprocessors all the way from machine language to assembler to C and then HLL's as they became
available. Some are very good programmers, some are just hackers like me.

Regards

cww
 
Mike Piotrowski:
> I'm interested in learning how to utilize pc's
> for control/automation/data acquisition
> applications, and I'm not sure what would be
> the best language(s) to learn for this.

For learning programming, I'd recommend python.

After that, it depends on what you want to do - different languages have different strengths and weaknesses. You already know some C and assembly, which give you a reasonable grounding in what's actually happening in the computer.

> Is it VB?

If you're after Windows scripting.

> Java?

If you're after web programming.

> C++???

Only if it's already being used, or if you want it for your CV.

Jiri
--
Jiri Baum <[email protected]> http://www.csse.monash.edu.au/~jirib
MAT LinuxPLC project --- http://mat.sf.net --- Machine Automation Tools
 
B

Brian E Boothe

VB Just for Windows scripting ?? I think NOT

VB is one of your best start's for developing complete applications for the windows enviroment compiled EXE's and DLL's..and probably one of the
Easiests to Learn
I suggest learning minimal C/C++ for outport and inport instructions in C/C++.
 
Brian E Boothe:
> VB Just for Windows scripting ?? I think NOT

> VB is one of your best start's for developing complete applications for
> the windows enviroment compiled EXE's and DLL's..

Yeah, but it's not particularly suited to large projects. What's left is writing minor applications and scripting the applications which use VBA.

> and probably one of the easiest to learn

That it is; however, BASIC was developed in the sixties, and it's starting to show its age. When it was first designed, structured programming was mostly restricted to esoteric research, no-one had heard of object orientation, etc. Modern BASIC variants have these and more, of course, but this does not make for a consistent, coherent design, which is desirable in a learning language; more importantly, it does not make for learning good habits, like proper error-handling.

The visual aspect of VB - emphasising the design of the UI to the near-exclusion of all other design - is also troubling.

I suggest you take a look at python - you'll find it very similar to BASIC, but a lot cleaner and with all the mod cons like exceptions, user-defined types and hashes (arrays indexed by strings rather than by numbers).

> I suggest learning minimal C/C++ for outport and inport instructions in
> C/C++.

AFAIK, Windows makes it very difficult to actually use these instructions, so they may not be quite so useful...


Jiri
--
Jiri Baum <[email protected]> http://www.csse.monash.edu.au/~jirib
MAT LinuxPLC project --- http://mat.sf.net --- Machine Automation Tools
 
Definitely learn C/C++. C++ is the most popular, but most C++ compilers will accept
100% C programs as well. C++ has no changes
from C that effect automation codes (but it'll look "more modern" on your resume!).
The basics of C are best taught by the classic THE C PROGRAMMING LANGUAGE, by Kernighan and Ritchie.
Getting C to talk to the outside world is
partially covered by a few of the available books.

Visual Basic is also very good, but try
concentrating on C. VB creates GUI's but is
not very easy for basic control. I just use it
to make "a pretty face" for my control software.
 
A
I am fairly confident that the two languages that yield the greatest results with minimal effort are Visual Basic and Python.

Both of them are well-rounded "high-level" languages, which basically means instead of having to re-invent a wheel every time you describe a car, you have many existing wheels to chose from. High-level languages have a significantly slower execution speed, but that is of little consequence nowadays unless you're involved in "scientific" programming (i.e. making core OS components or codecs), which is something just 1% of programmers, mainly grad-school level, end up doing. The great majority of programming jobs nowadays are in the field of business: every company has computer systems that need tweaking. In most situations, being able to complete a solution several times faster is more important than the solution taking several milliseconds less time to execute.

VB may be a better choice if your work is centered on Microsoft Windows, and related applications / technologies. It is most effective language for easy simple GUI applications, application macros (VBA in Microsoft Office), and client/server-side Web scripting (ASP/VBScript). BASIC is the world's most popular programming language family (though Java is gaining momentum). Since VB is proprietary, well-established, and well spoken for, I'll concentrate the remainder of this post on Python.

Python is a better language for platform-independent programming. It has one downside big, though: it is far less popular than VB, Java, C/C++, and Perl. But popularity and quality don't always correlate. Python is one of the best languages to learn in terms of getting the job done as quickly and easily as possible. It is easier to learn than BASIC if you have zero programming experience to start. There are much fewer books on it than BASIC, but it is very intuitive and well documented online. Finally, both the language (interpreter), the documentation, and all Python utilities are free. (See www.Python.org.)

Python can replace Java as the language for Web applets (Jython), Perl for CGI, or VBScript / JavaScript / C# as the language for ASP and the .NET framework (ActivePython). It can be used for VB-like GUI applications with a number of toolkits, the best of which is wxPython. Python is also a common language for open-source scripting in applications and game engines. Code readability is very important, and Python is considered to be the most readable language since the Pascal/Ada era.

Python is the Esperanto of programming languages: anyone can learn it quickly, do many things with it, and once you master Python you can learn another modern language (Perl, PHP, Java, VB, Tcl) in 20% of the time and effort it would require to learn from scratch. From my experience, non-programmers learn Perl and Java faster if they learn Python first, and use it as a stepping stone. Learning C/C++ (or even Java) without knowing a simpler language first is like trying to learn to fly a 747 as your first plane. You'll crash.

In the end, the greatest factor in programmer employability isn't which language you know but what you can do with the languages that you know, and how quickly you can adapt to existing projects / languages. No professional programmer can get away with just 1 (or just 5) programming languages. Information technologies are always changing, and ability to learn new languages and standards is a skill in itself.

Programming languages fall into different categories, roughly: Assembly, high-level mainframe (COBOL, RPG), high-level 2 (Pascal, C/C++), high-level 2.5 (Java, VB), high-level 3 (JavaScript, VBScript, C# .NET, Perl, Python, Ruby), etc. The right level is appropriate for the right job. Within a specific level, it makes little real difference which language you use: a rose by any other name. When you've mastered one language in a category you can master another in a small fraction of the effort (with rare exceptions among very old languages).

The substance of being a good programmer is in understanding the factors that are shared among the languages: business problem solving, algorithmic logic, code flexibility and reuse, common syntaxes / sub-languages (SQL, regular expressions, glob) and libraries / API's (i.e. Win32, OpenGL), best practices, etc.

~~Alex~~
 
M

Michael Griffin

On December 28, 2003, Alex Libman wrote:
<clip>
> I am fairly confident that the two languages that yield the greatest
> results with minimal effort are Visual Basic and Python.
>
> High-level languages have a
> significantly slower execution speed, but that is of little consequence
> nowadays unless you're involved in "scientific" programming (i.e. making
> core OS components or codecs),
<clip>

Most "scientific" and engineering programming would use library calls for typical compute intensive work. These library functions are normally programmed in another language (e.g. 'C' or Fortran), so the execution speed of the main program is of little consequence in most cases. Python comes with an extensive library, while third party libraries can be purchased for VB (although these can be quite expensive).

> VB may be a better choice if your work is centered on Microsoft Windows,
> and related applications / technologies. It is most effective language for
> easy simple GUI applications, application macros (VBA in Microsoft Office),
> and client/server-side Web scripting (ASP/VBScript). BASIC is the world's
> most popular programming language family (though Java is gaining momentum).
<clip>

You haven't offered any statistics to support your opinions on popularity. The following list is from the "TIOBE Programming Community Index for December 2003" (http://www.tiobe.com/tiobe_index/index.htm) which attempts to provide an indication of the popularity of various programming languages. Details on the methodology used to derive this ranking may be found on their web site.

1 Java, 2 C, 3 C++, 4 Perl, 5 (Visual) Basic, 6 PHP, 7 SQL, 8 JavaScript, 9 C#, 10 Python, 11 Delphi/Pascal/Kylix, 12 SAS, 13 COBOL, 14 Fortran, 15 Ada,
16 Lisp, 17 Awk, 18 IDL, 19 Prolog, 20 Scheme

Some selected minor languages which may be of interest to people are: 31 Forth, 33 Labview, 39 TCL/TK, 41 VB Script

The above ranking is a bit different from the one you have suggested. In particular, Basic is far from being the most popular language and Java is doing more than just "gaining momentum".

> Python is one of the best languages (but) There are much fewer books on it
<clip>

A book store with a decent computer section should have a number of Python books from the usual computer book publishers. If you are looking for a particular book and can't find it in a store, it should be very easily ordered.

Despite some quibbles with a few of your points (including several I haven't addressed), I can't disagree with the main thrust of your message.

One additional point though that should be made is that in many cases the major value of a language is in the standard libraries rather than just the language's own built in commands. Therefore, if you are comparing two
languages you should pay particular attention to how useful these libraries are to the types of applications you wish to create.

--

************************
Michael Griffin
London, Ont. Canada
************************
 
C
I think it would be great if one could learn the basis for programming before considering a language. I have worked with several "high level language" programmers who know only a language and almost nothing about programming. While this is the goal of high level languages and maybe even desirable in a software house that does only applications, efficient automation and other applied sciences often require knowledge of what's under the covers. In my view, this trend is why we have such Godawful bloat and simplistic approaches to complex problems that fail and people dependent on tools that are almost completely wrong for the purpose. And widespread acceptance that this is a good thing. Or that lightspeed computers are somehow slow, unreliable and inefficient. When computers were slower and more unreliable, software quality and efficiency were better by orders of magnitude.

With all this and the scope of automation in mind, I would suggest that one learn from the foundation up:

Do a little assembler for bits and bytes and registers and memory organization, byte ordering and all the concepts important in, for example, RLL and IL. Most Instruction List programming is only slightly removed from assembler with the same processor. RLL still requires a reasonable understanding of memory structure.

Do C long enough to understand how languages abstract constructs and hide detail. And how the hll library interfaces work and pass parameters, etc. A little study of RTOS and interrupt handling should make sense at this point. And C++ if objects are important to your work.

Then you can properly evaluate high level languages as to what they should and shouldn't be used for. You will be a much better programmer, honest :^) And you probably won't use VB for automation.

The first two generations of programmers have generally been knowledgable in these areas. But it's declining rapidly and the results are blindingly obvious. I fear for the handoff to the next few. Hardware is not "high level". To make it so involves severe compromises in capability and flexibility. The hardware is getting phenominal, the software is getting abysmal. Seems to be a constant product that is achievable. It's nearly unbelieveble what great software on great hardware can achieve. We should strive for that goal rather than rejoice that any idiot can program now. The results adequately demonstrate that already. We have a unique opportunity to see how software really works at every level. Those who take advantage of that will lead the industry tomorrow. Those that know a language will have a job.

Regards

cww
 
I think it really depends on how steep you want your learning curve and on your style of learning. To be a real programmer, you need to know all the things Curt listed - a little assembler, some C, libraries, and high-level
languages; when to use each, and more importantly when *not* to use each.

What order you learn them in depends on your style of learning; if you prefer to start from the foundations and work up, learn them in the order listed. If you prefer gentle introductions, start with a high-level language like python and work more-or-less backwards on the list, then return to add a few more high-level languages. As long as you work through the whole list, the end result will be pretty much similar no matter the order.

And if you give up half-way, passing familiarity with python will be much more useful than passing familiarity with assembly.

Jiri
--
Jiri Baum <[email protected]> http://www.csse.monash.edu.au/~jirib
MAT LinuxPLC project --- http://mat.sf.net --- Machine Automation Tools
 
Curt:
> Unless you're doing embedded systems :^)

Actually, even if you're doing embedded systems, passing familiarity with python is more useful than passing familiarity with assembly.

If you just have a passing familiarity with assembly and little experience, you don't want to be programming them yourself anyway. However, the programmer who is doing the actual coding will be jumping for joy if you write him an algorithm in Python - even if it's a poor algorithm that needs to be completely reworked. It'll give you much better communication...

> On December 31, 2003, Jiri Baum wrote:
> > I think it really depends on how steep you want your learning curve and
> > on your style of learning. To be a real programmer, you need to know all
> > the things Curt listed - a little assembler, some C, libraries, and
> > high-level languages; when to use each, and more importantly when *not*
> > to use each.
> >
> > What order you learn them in depends on your style of learning; if you
> > prefer to start from the foundations and work up, learn them in the order
> > listed. If you prefer gentle introductions, start with a high-level
> > language like python and work more-or-less backwards on the list, then
> > return to add a few more high-level languages. As long as you work
> > through the whole list, the end result will be pretty much similar no
> > matter the order.
> >
> > And if you give up half-way, passing familiarity with python will be much
> > more useful than passing familiarity with assembly.

--
Jiri Baum <[email protected]> http://www.csse.monash.edu.au/~jirib
MAT LinuxPLC project --- http://mat.sf.net --- Machine Automation Tools
 
M

Michael Griffin

On January 3, 2004 11:55, Jiri Baum wrote: <clip>
> Curt:
> > Unless you're doing embedded systems :^)


Jiri Baum replied:
> Actually, even if you're doing embedded systems, passing familiarity with
> python is more useful than passing familiarity with assembly.
<clip>

"Embedded" covers a lot of ground. Either point of view may be valid, depending upon the characteristics of the system in question. In custom or low volume applications, a lot of systems consist of a PC with a data acquisition (or GPIB, stepper, etc.) board.

If the embedded system is based on a PC or PC-like hardware (as the original question stated), a language which offers an interactive mode (Python was suggested by Mr. Baum) has a lot of advantages for testing, debugging, and learning to work with the hardware. If you are poking away at a piece of hardware in order to figure out how it works, having to do a long compile-link-run cycle for each iteration can be very time consuming and discourages experimentation.

It is difficult to emphasise this enough. If you are new to the field, you will discover that the board (or other hardware) manufacturer's documentation is inadequate for learning how it works. If you are *not* new to the field, you will already know that the manuals are rarely detailed or clear enough to tell you everything you need to know about it. If you are working with a new piece of hardware, there is no substitute for experimentation and testing.

Various suggestions were made earlier as to what a "good" language would be, so I won't try to cover that ground again. However, I think the above provides some good criteria to judge them by.

--

************************
Michael Griffin
London, Ont. Canada
************************
 
Top