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.

programming languages

Status
Not open for further replies.

electronic mind

New Member
well, i finished my study in the univ. (Electronic eng.)
and i want to learn a PC language but im confused!!

so which one should i learn to help me with electronics as well as improving my computer skills specially when its related to the internet
 
You have many conflicting requirements.

However I would advise learning a low-level language such PIC Assembler.
That way you will gain a good understanding of the bits and bytes and the interfacing to electronic hardware.
(Dare I suggest Nigels tutorials?).

As for a high level language, I will leave that suggestion to others.

JimB
 
In another forum there are topics on the following programing languages, just see which ones are the most active by the numbers shown in parenthesis.

Of course knowing computer logic is a first step.

ABC (4)
Ada (411)
ADL (2)
Algol 60 (16)
Algol 68 (37)
APL (103)
AppleScript (41)
Assembly (224)
Awk (20)
BASIC (291)
Befunge (13)
BETA (10)
Bigwig (1)
Bistro (5)
Blue (4)
Brain-(censored) (16)
C (316)
C++ (945)
C-sharp (185)
Caml (4)
Cecil (3)
CHILL (4)
Clarion (48)
Clean (4)
Clipper (33)
CLU (4)
Cobol (150)
CobolScript (3)
Cocoa (4)
Comparison and Review (100)
Compiled (128)
Component Pascal (15)
Concurrent (19)
Constraint (48)
Curl (63)
D (49)
Database (12)
DATABUS (7)
Dataflow (10)
Declarative (30)
Delphi (565)
Directories (24)
DOS Batch (133)
Dylan (21)
E (5)
Education (12)
Eiffel (81)
ElastiC (2)
Erlang (270)
Euphoria (27)
Forth (285)
Fortran (925)
FP (3)
Frontier (60)
Functional (85)
Garbage Collected (186)
Goedel (3)
Hardware Description (77)
Haskell (65)
History (19)
HTML (403)
HTMLScript (70)
HyperCard (16)
ICI (4)
Icon (7)
IDL (16)
Imperative (77)
Intercal (17)
Interface (4)
Interpreted (174)
Io (8)
Java (3517)
JavaScript (601)
Jovial (7)
LabVIEW (93)
Lagoona (3)
Language-OS Hybrids (24)
Leda (5)
Limbo (8)
Lisp (436)
Logic-based (60)
Logo (48)
Lua (24)
m4 (2)
Markup (1490)
Mathematica (53)
MATLAB (170)
Mercury (4)
Miranda (11)
Miva (70)
ML (57)
Modula-2 (36)
Modula-3 (12)
Moto (3)
Multiparadigm (35)
Mumps (21)
NET (24)
Oberon (75)
Obfuscated (34)
Object-Oriented (161)
Objective-C (25)
Objective Caml (26)
Obliq (7)
Occam (11)
Open Source (70)
Oz (5)
Parallel (45)
Pascal (100)
Perl (1075)
PHP (1625)
Pike (8)
PL (14)
PL-SQL (58)
Pliant (12)
POP-11 (10)
Postscript (33)
PowerBuilder (107)
Procedural (77)
Prograph (24)
Prolog (75)
Proteus (2)
Prototype-based (18)
Python (518)
R (24)
REBOL (173)
Reflective (36)
Regular Expressions (114)
Rexx (245)
Rigal (4)
RPG (16)
Ruby (153)
S-Lang (1)
SAS (56)
Sather (11)
Scheme (143)
Scripting (122)
Self (18)
SETL (6)
SGML (43)
Simkin (6)
Simula (10)
Sisal (10)
Smalltalk (350)
Snobol (7)
Specification (22)
SQL (49)
Squeak (113)
Synchronous (12)
T3X (1)
Tcl-Tk (122)
Tempo (2)
TeX (422)
TOM (5)
TRAC (5)
Transcript (25)
Turing (13)
UML (177)
VBScript (27)
Verilog (20)
VHDL (33)
Visual (46)
Visual Basic (526)
Visual DialogScript (5)
Visual FoxPro (37)
Water (14)
Wirth (13)
XML (949)
XOTcl
YAFL
Yorick
Z
 
electronic mind said:
so which one should i learn to help me with electronics

What JimB said.

electronic mind said:
[...] as well as improving my computer skills specially when its related to the internet

What do you mean by that? What kind of programming would you like to do on the PC? What are the first software projects that come to mind that you would like to do? Most programming languages are able to interface more or less easily with the HTTP protocol. Assuming we're talking about the typical Windows/PC environment :

  • C/C++ would give you access to various internet-related APIs and components - free tools from GNU and Borland
  • same for Visual Basic (and Delphi, but don't touch that unless you already know some Pascal) but in a more user-friendly way - usually not free though
  • Perl is the champion of versatility, it can be used as a general purpose language, as a powerful text parsing language, as a server side language, scripting language, etc... easily portable between Unix/Linux, Windows and other platforms - free tools
  • Python is often refered as the object oriented cousin of Perl, not as widespread use, but clearly a powerful language, excellent portability too - free tools
  • In my humble opinion Java sucks at everything. But it does everything. But it sucks at everything. But it does everything. This summarizes all arguments regarding Java that you will find on various software development forums. I would steer clear of it. And I do.
  • Anything with ".NET" or C# in their name you should not learn first. Learn a standard language, then see if .NET makes sense for your projects. Someone might come up and tell you the exact opposite. Don't listen to them :p:lol:

Read about HTTP, FTP, SMTP, POP. Learn HTML. It's not a programming language as much as a formatting one. By looking at online HTML tutorials, you will probably come across CSS, Javascript (not related to Java in any way), XML, etc... It's all good.

Once you're comfortable with the above, look at PHP. It will allow you to generate web pages and do all server side tricks needed for a dynamic website. This very forum is written in PHP.

Alternative languages to PHP are ASP (mostly Microsoft specific) and JSP (Java).

And this is just the tip of the iceberg. For example, the last three languages (PHP, ASP and JSP) could very well be replaced by Perl or even C modules if you decide to learn those languages.

Scary, uh?

It's sounds worse than it is. Try to come up with a few project ideas, it'll probably be a lot easier to choose a first language.

I am currently an unemployed software developer, mostly because I refuse to work in Java or .NET. I am convinced they are just fads. Although Java is starting to look like a serious contender for the heavyweight title, .NET is jabbing its way in and is just waiting to launch a few big uppercuts to Java's chin. A wise and motivated guy would learn both and rake in the cash. I'm neither. So keep that in mind when reading the above ;):lol:
 
thanx guys
looks like im going either for Perl or C++

what i wanted to say is that i need a language that i can use with networks ,servers ,and so ....
beside i wanted to help me writing programs to processors and microcontrollers (so i want a compiler for that langugage to be available)

i beleive that C++ is used for many objects by the softwawre engineers
as well as its used to write complex programs which is not easy with assembly
 
electronic mind said:
thanx guys
looks like im going either for Perl or C++

what i wanted to say is that i need a language that i can use with networks ,servers ,and so ....
beside i wanted to help me writing programs to processors and microcontrollers (so i want a compiler for that langugage to be available)

i beleive that C++ is used for many objects by the softwawre engineers
as well as its used to write complex programs which is not easy with assembly

Then, yes, C++ is a good choice. But in my opinion, learning plain C first makes sense. You can then gradually apply object oriented programming (OOP) concepts to it, and it basically becomes C++. Put simply, C++ is C with OOP. Looking at Java code can help you grasp basic OOP concepts. There, I said something nice about Java. Just don't execute Java code on your PC. Your computer will be possessed, it'll start acting weirdly and it'll foam at the CD drive. Don't do it.

:lol:
 
electronic mind said:
thanx guys
looks like im going either for Perl or C++

what i wanted to say is that i need a language that i can use with networks ,servers ,and so ....
beside i wanted to help me writing programs to processors and microcontrollers (so i want a compiler for that langugage to be available)

i beleive that C++ is used for many objects by the softwawre engineers
as well as its used to write complex programs which is not easy with assembly

C++ is an exellent choice for PC programming and some of the larger microprocessors.

C++ compilers for the middle and smaller microprocessors and controllers are less frequent.
Learning C first is a very good advice if you want to have a wide range of micros to choose from.
Assembler is also something you should learn about, at least if you want to do hardware related and embedded projects. I've seen too many programmers with almost no knowledge of what makes the C++(or other high level) code tick and why time is an important aspect interfacing to the real world.

TOK ;)
 
electronic mind said:
thanx guys
looks like im going either for Perl or C++

what i wanted to say is that i need a language that i can use with networks ,servers ,and so ....
beside i wanted to help me writing programs to processors and microcontrollers (so i want a compiler for that langugage to be available)

i beleive that C++ is used for many objects by the softwawre engineers
as well as its used to write complex programs which is not easy with assembly

Then I would recomend learning C first.
C++ is just an extension.

as oposed to learning Perl, do Python. It is extreamly easy and fully Object orientated and is soo powerful

When I have finished my comparator program (in python) ill post
just a few GUI loose ends
 
Styx said:
electronic mind said:
thanx guys
looks like im going either for Perl or C++

what i wanted to say is that i need a language that i can use with networks ,servers ,and so ....
beside i wanted to help me writing programs to processors and microcontrollers (so i want a compiler for that langugage to be available)

i beleive that C++ is used for many objects by the softwawre engineers
as well as its used to write complex programs which is not easy with assembly

Then I would recomend learning C first.
C++ is just an extension.

as oposed to learning Perl, do Python. It is extreamly easy and fully Object orientated and is soo powerful

When I have finished my comparator program (in python) ill post
just a few GUI loose ends

What did you use for your GUI in Python?

I loved Python when I tried it. It seems like a good all around general purpose language both for learning and actually implementing something useful.

I once used Perl and Tk to come up with a cross platform utility w/GUI. Is Tk also used in Python? Or did you use something else?
 
The GUI I use is DrPYTHON I have found SPE but it has its probs

the toolkit to make a GUI is GTK with the GLADE extenstion so I dont have to build up the widgets in code I just import the GLADE file

Code:
#!/usr/bin/env python
#Licence: GPLv2.0


import sys,os
from comp import *
from comp_diode import *
from comp_DeSat import *


import pygtk
if sys.platform == 'win32':
	os.environ['PATH'] += ";lib;"
else:
	pygtk.require('2.0')
import gtk
import gobject
assert gtk.pygtk_version >= (1,99,16), 'pygtk should be >= 1.99.16'
import gtk.glade




Var_C = [{"label_HtL":False,"label_LtH":False,"input_HtL":False,"input_LtH":False,
"input_Rfb":True,"result_Rfb":False,"label_Rfb":True,
"result_LtH":True,"result_HtL":True,"label_result_HtL":True,"label_result_LtH":True},
["result_HtL","result_LtH","result_Rfb"],
["option_hyster","option_neg"]]

Var_D = [{"label_HtL_D":False,"label_LtH_D":False,"input_HtL_D":False,"input_LtH_D":False,
"input_Rfb_D":True,"result_Rfb_D":False,"label_Rfb_D":True,
"result_LtH_D":True,"result_HtL_D":True,"label_result_HtL_D":True,"label_result_LtH_D":True},
["result_HtL_D","result_LtH_D","result_Rfb_D"]]

Var_DS = [{"label_HtL_DS":False,"label_LtH_DS":False,"input_HtL_DS":False,"input_LtH_DS":False,
"input_Rfb_DS":True,"result_Rfb_DS":False,"label_Rfb_DS":True,
"result_LtH_DS":True,"result_HtL_DS":True,"label_result_HtL_DS":True,"label_result_LtH_DS":True},
["result_HtL_DS","result_LtH_S","result_Rfb_DS"],
["option_hyster","option_neg"]]



class appgui:
	def __init__(self):
		gladefile="GUI.glade"
		windowname="TESTING"  
		self.ref = False
		self.calc = True
		self.CC = comp()
		self.Var = Var_C
		self.wTree=gtk.glade.XML (gladefile,windowname)
		
		dic = {"on_quit_button_clicked" : self.quit_clicked, 
		"on_change_current_page" : self.selection_change,
		"on_option_hyster_group_changed" : self.calc_change,
		"on_option_ref_changed" : self.ref_changed,
		"on_changed" : self.var_changed,
		"on_window_destroy" : (gtk.main_quit)}
		
		self.wTree.signal_autoconnect (dic)
		return


#####CALLLBACKS
	def quit_clicked(self,widget):
		gtk.main_quit()
		return


	def selection_change(self, widget,gpointer, guint):
		#if text = "Comparator-Diode" : CC = comp_diode()
		#elif text == "Comparator-DeSat": CC = comp_desat()
		#else : CC = comp()
		#self.RES,self.VOLTS = self.CC.pack_variables(self)	
		#disp_results(self)
		if guint == 1: 
			self.Var = Var_D
			self.CC = comp_diode()
		elif guint == 2: self.Var = Var_DS
		else: 
			self.Var = Var_C
			self.CC = comp()
			
		self.ref = False
		self.calc = True
		#self.RES,self.VOLTS = self.CC.pack_variables(self)	
		#disp_results(self)
		return
	
	def calc_change(self,widget):
		self.calc = not(widget.get_active())
		print self.calc
		if self.calc:
			for x in self.Var[0].keys():self.wTree.get_widget(x).set_property('visible', self.Var[0][x])
		else:
			for x in self.Var[0].keys():self.wTree.get_widget(x).set_property('visible', not(self.Var[0][x]))
		#self.RES,self.VOLTS = self.CC.pack_variables(self)	
		#disp_results(self)	
		return
	
	def ref_changed(self,widget):
		self.ref = not(widget.get_active())
		#self.RES,self.VOLTS = self.CC.pack_variables(self)
		#disp_results(self)
		return
	
	def var_changed(self,widget):
		#self.RES,self.VOLTS = self.CC.pack_variables(self)
		#disp_results(self)
		return

	



if __name__ == '__main__':
	app=appgui()
	gtk.main()


Showing the top-level GUI script.
There are a couple more PY files that have the low-level functions and of course the GLADE file
 
I may have to put on my Flame-proof undies for this one ;-) Programming languages have been responsible for more holy wars than almost anything else in I.T.

In my "vast" experience it breaks down like this...

First of all the great C/C++ confusion.

C/C++ .. always grouped together, never should be. In spite of similar appearance, they are different languages...
An enormous number of people use C++ compilers to compile C programs and call themselves C++ programmers.

C is actually obsolete. This statement is likely to cause much wailing and gnashing of teeth, but if you think about it, it's true. This is not the same as saying the C programming paradigm is obsolete.

C++ is a wonderful general purpose language but requires expert ability to develop non-trivial programs quickly.

Visual Basic (6) is what I call an 80-10-10 language. 80% of development tasks are easy, 10% are difficult and 10% are impossible. Low-level programming nearly always lies in that last 10% without the use of external libraries most likely written in C++.

Java is highly portable and very CPU and Memory resource hungry. The portability does make it an appropriate choice for some projects, but the performance overhead can cause problems. Microsoft has attempted to produce its own "improved" flavour of Java which should be avoided.

In my experience Microsoft .Net programs are too easy to reverse engineer thanks to the use of MIDL (an intermediate language) and suffers very bad initial startup performance due to JIT (Just in Time) compilation. This makes .Net languages so far a really bad choice for real time and embedded systems. Having said this, the library is good and performance may improve over time.

If you are considering a .Net language, avoid VB .Net it takes the worst features of VB6, adds some new really stupid features and then weighs it all down under the bulk of the performance overheads of .Net. Not a smart move on behalf of Microsoft, they should have simply abandoned VB since VB .Net isnt really a viable migration path for existing projects anyway (anyone who has tried to migrate a non trivial VB6 application to VB.Net will have discovered this).

This leaves C# and Delphi.

Borland makes a compiler for C# as well as Delphi and of course Microsoft also makes a C# compiler.

Having used Borland pascal through its various incarnations, the only thing I'm going to say about Delphi 2006 is that the folks at Borland should stay away from magic mushrooms when designing their products.

C# on the other hand seems to be the best of a bad bunch in the .Net realm. At least compared to VB it has a language standard. A public language standard.

Actually there are a lot more languages than this as previous posts have noted but for broad spectrum programming, these are all I'm going to cover.

In summary:
VB6 - ok for a high level quick hack.
VB.NET - just plain bad. If you havent started programming, dont start with this.
C# - Looks more scary than VB to beginners, but really it is just VB wearing a halloween costume.
C++ - Nothing like C# (or C) it just looks the same. If you are doing low level programming, use this or assembly.
 
^^
err NO!

you would NOT use C++ for low-level programming! that is what C is for (or assem for lower)
C++ was a hidious bolt-on to C (actually it was an expansion of the hidious bolt-on which was C+) to bring it into the OOP world... it failed

C is not dead! C lives in the Linux Kernel, it is C-based. Just like the entire GNOME desktop (from the GTK toolkit all the way to Nautilus...)

The reason a C++ compile will comile C code is because it is an expasion over C. A C-compiler will not compile C++.

gcc and g++ give two different md5 checksums for the result. Which would I trust? the gcc output
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top