Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Computer Language Discussion + PIC Programmers

Status
Not open for further replies.

3v0

Coop Build Coordinator
Forum Supporter
It seem that there is still some interest in discussing computer languages.

The thread has been started here in that it is not restricted to micro controllers.

Feel free to talk about A and B and even A vs B but keep it civil. Keep in mind that if you are only fluent in on language that you have an unjustified bias in favor of it. The same maybe true to the person on the other side of the fence.

Lets try to stay with more productive talk about specifics rather then generalizations.

No trolls.

3v0
 
Last edited:
This should prove to be a fun and interesting thread. I am not a programming type, I am far from a programming type. Matter of fact, on a scale of one to ten with a ten being a programmer I fit in around a negative three. :)

However, and don't laugh, I have worked a little with Visual Basic. I said, don't laugh! I have written a few basic applications for data acquisition and for what I needed to do VB worked out quite well. Mostly collecting data from a collection of sensors and placing it in a file or dumping it into an Excel sheet / workbook. With zero formal schooling in any language VB did what I needed done and it really doesn't get any simpler.

Fortunately, I have an actual programming team at my disposal for real projects. I admire those guys.

I also have written and played around with some VBS scripting applications. I once managed to send myself about 50 SMS text on my cell phone before I figured out what I did wrong. I wanted a single text sent from my PC. :)

Anyway, despite my inability to actually program I look forward to some good stuff in this thread.

Ron
 
Lucky enough for me I use any language, so if you want to know why I mainly code in C.... Speed of coding. I can write a new program in hours... I know basic's have RAD capability (Rapid Application Development). But they don't have enough low level abilities... bitwise etc...

I suppose it all comes dome to platforms.... I mean Linux / unix was built on C so it is best language to use.. Pic18's have been C optimised.. So again C is a good tool to use.. C on low range / mid range.. Too much overhead.... Assembler wins every time..

Windows... seem to favour C++.. moving over slightly to C#.. OOP has this domain covered...

The Arduino's and Netduino's seem to spawn from Window programmers. I mean, C++ on a tiny AVR, but it seems to work.

I like C#.. it's a good compromise C++ / visual basic / Java. I would love to hear thoughts on this language..

As usual.. the .Net team seem to hide anything low level from newer style programmers, Anyone with little ASM / IO knowledge are kept away from these tasks.
 
I hold similar views to Ian. For me a programming language is just a tool, and for reference I know C, Assembly (for TI C64x series of DSP), and VHDL for hardware description. I have dabbled with Delphi (Object Orientated Pascal) and Python a bit in the past.

Everyone would agree ( I hope!) that good hand optimised assembly can easily beat C and other languages in terms of speed and code size - at the expense of prolonged development time and an increasing difficulty to manage the code as project size and complexity increases.

On the other hand sloppy assembly from beginners can be much slower than optimised C. Not Optimised Properly - NOP :D

The development time saved by using a higher level language is of a much greater importance for me, and I will use the quickest route to get a job done that meets the specification required.

@Nigel: Python (with suitable libraries) is becoming quite prevalent in academia as a replacement for Matlab. Anyway, I would severely doubt that lecturers comment Nigel, people tend to use C in python projects if there are bottlenecks. Then there is C’s use in Linux/Unix and many more projects.
 
Last edited:
In the early days, code size was of importance as memory was expensive. But with massive memory devices of today at low cost, one can be more frivolous with memory chip size selection. I would agree that in the past the ASM was a preferred choice as it saved on memory space, but with today's technology, that is no longer an issue. So at this point, productivity becomes the issue, and C still seems to be king in the productivity arena.

It is tried and true, has mega quads of data to prove it, masterfully books written on the subject, thousands of years of combined experience to support it. Nuff said?
 
Last edited:
My daughter recently did a programming module (as part of her Masters Degree in Chemistry?), and they were taught Python - the lecturer stated that C was "on it's way out"

They reckon so... but Python Pearl and Ruby are all scripted so not much use on embedded systems.. I don't think C will disappear just yet as most scripted languages require memory the size of Africa to house the libraries and runtime environment.... C++ too has huge overheads.

I also run graphical applications on an EMX module.... It has to have 4 meg for all the crap that comes with C# ( I think the user gets quite a bit ) but even so.... Rendering a circle in a scripted language brings the system to a virtual halt......
 
Ian Rogers said:
I like C#.. it's a good compromise C++ / visual basic / Java. I would love to hear thoughts on this language..

I have only toyed with VB and Java. About five years ago I used C# when I was automating a greenhouse for the wife. I liked it then and am thinking it should be better now. The objects are far easier to use then in C++. Although C# is a resource hog it impressed me enough to say I will use it the next time I do major work on the PC. As I recall it was not hard to run the PC generated intermediate code on the linux box with mono.

Back in my university days I used forth on Z80's and embedded basic on Z8's. These days I use C because as others mentioned that is has the momentum. Prior to PC's I had an H11 and UCSD Pascal which I enjoyed. In class I used Fortran, PL1, ASM's, COBOL, Pascal, Modula2 and various AI (artificial intelligence) languages. One AI class had us using a different language each week to do our programming assignments. While I have forgotten much of the AI but is sparked an interested in languages that is still with me.

I did not relate the above to brag. But as background to relate the following. When a person first learns to program he will tend to think in that language. After you learn several languages thinking about programming becomes more abstract. It makes you a better programmer and learning new languages is a very natural thing.
 
Last edited:
I have only toyed with VB and Java. About five years ago I used C# when I was automating a greenhouse for the wife. I liked it then and am thinking it should be better now.

The Microsoft C# IS Java really.... It was spawned from the legal battle between Java and Microsoft's J..... ooohhh remember J... they got their hand wrapped with that one... (One Bill didn't win).

I like C# it's actually better than the new visual basic .net... More professional. the free version will let you do almost everything you need to do.
 
I was told that C# is rooted in the Borland Builder stuff. Borland hired some key people form Borland.

Version 1.0 of C# was released with Visual Studio 2002.... You may be right about Borland, but this was the first sighting by me..... After Bill's battle with sun we had a brief J# that replaced the J++.... C# was soon in the place of J#... I thought Borland focused mainly on Delphi ( I used to like that as well ), This version of Pascal was superior to Java, I wouldn't have thought they would bother with a Java clone.
 
I've used C in linux and played around with C++ a little bit in VisualStudio. I did a tiny bit with PIC ASM way back when, but I moved quickly to C for programming microcontrollers. I really can't say one is better than the other because, as 3v0 mentioned in the first post, one can be somewhat biased when they use one language more than another. I agree with what Ian said earlier. Different languages could apply to different applications. A could be better than B in one situation, but B is far superior to A in another.
 
Right now, I find the documentation too big to fit in my head that can't memorize very well. Yes, I do remember 3-4" wide binders of nothing but documentation that fit on a couple of shelves. PC screens are now have the wrong aspect ratio and they are impossible to read an (8..5 x 11) formatted page. It's almost as if you need a couple of iPads/tablet computers to have the 200-350 page manuals.

Documentation is so hard to write. Effective documentation is hard to come by.

I learned LabVIEW when it was in it's infancy and it was constantly changing. I was charged in building a data acquisition system at a time when X-Y recorders were on their way out and their wasn't much available. I was also acting as a project manager and I had a programmer that I was supervising. Both of us didn't know Labview. It was a real challenge.

In the end, the project(s) were too big because it required both hardware and software design and the technology wasn't quite there yet. I made my view known, but I was told the "money is available now". As time progressed, the technology changed dramatically. An example was a monochometer with IEEE interface and LabVIEW drivers.
 
Last edited:
The Microsoft C# IS Java really.... It was spawned from the legal battle between Java and Microsoft's J..... ooohhh remember J... they got their hand wrapped with that one... (One Bill didn't win).

Yes, but Sun is now owned by Oracle; Microsoft is still Microsoft. That seems to be a recurring theme for people who take on Microsoft and other Goliath's in American courts.

One of my son-in-laws does medical application programming and uses Java quite a bit. He was not aware that Google and Oracle were now locked in a battle over IP infringement involving Java. You might find this news item of interest: https://www.marketwatch.com/story/google-and-oracle-ceos-face-off-in-court-2012-04-17?dist=countdown

As for my own interest in this subject, the only language I have ever used is MPASM, so I have nothing to add with respect to comparisons. However, one comment in the other thread to the effect that C used with microcontrollers was not much different than Assembly with relocatable code pieces and/or subroutines stuck in my head.

I wonder if others have additional comments on that comparison.

John
 
However, one comment in the other thread to the effect that C used with microcontrollers was not much different than Assembly with relocatable code pieces and/or subroutines stuck in my head.

One can extend ASM to the point where you have another language based on asm. Each time you create or encapsulate some functionality in a library routine you are blessed or burdened with the efficiency of that code. If ones does a good job overall it can still be quite efficient. The down side is you now have another language to deal with. The downside is that the less the language looks like asm the higher the learning curve will be. I want to note that this sort of thing can happen in HLL's too.

One advantage of C over asm that I was not allowed to touch on in the other thread is that because C provides abstraction at the processor level, the programmer can not make a mistake at the processor level. He is blessed, or cursed, with the machine level coding as generated by the compiler unless he embeds asm code.

But as pointed out by others in the other thread the most powerful optimizations are done at the algorithmic level.

Back when blueroomelectronics was publish the junebug news letter I worked on a comparision of code generated by several 18F compilers. I think the list included C18, swordfish, and one other compiler. I compiled a simple loop. The code generated by the compilers were close enough so as to not favor one over the other. It was also close to what an ASM programmer might write. Do not get me wrong, I am not saying the compilers in general were that good, just at this level.
 
Last edited:
However, one comment in the other thread to the effect that C used with microcontrollers was not much different than Assembly with relocatable code pieces and/or subroutines stuck in my head.

Usually C programmers use libraries that hide much of the hardware. Beginners do not usually know how to access memory locations directly etc. However C as a language does not hide the hardware. It is possible to access any memory location directly, define variables in precise memory locations, jump anywhere in the code arbitrarily etc. But, you need to be an experienced programmer and know how the hardware works in order to build programs like that in C. And some features, like locating piece of code to a specific memory location, depends on the compiler. The final result always depend on the compiler unless you use inline assembly.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top