What language? is python good?

In summary: Java's beans (and I guess C#'s controls).In summary, the individual is in their last year of high school and has an interest in learning to program, particularly for the purpose of studying electrical engineering. They are unsure of which language to learn, but have heard that Python is a good all-around language, while others have recommended Delphi for its hardware interactivity. They are seeking recommendations for learning materials and other languages to try out. Some individuals in the conversation express their opinions on Java, C, and Python.
  • #1
foges
53
0
Im in my last year of high school and for about two years now I've wanted to learn to program, but i havnt really gotten into it.

Basically I am going to study electrical engineering in a bit over a year (military service comes first) and I would like to learn a language that is useful for that purpose.

I don't want it to be limited to programing robots or circuits though. I want to be able to use it to make for example: applications that interact with websites, like getting prices off ebay or something.

What is a good language for this. I've heared that Python is a good all around language. Then again I've heared others recommend delphi because apparently its more hardware interactive than other languages. What do you guys think?
 
Technology news on Phys.org
  • #2
Python is an excellent general-purpose programming language, and it even does a very good job of some specialized tasks like scientific computing.

If this is your first programming language, Python is an excellent choice. You will be essentially forced to learn C at some point in your career though, simply because it is so ubiquitous.

- Warren
 
  • #3
thanx a lot. Can you recommend any book? or should i start out with the tutorials on the python website, then byte of python, then dive into python?
 
  • #4
Start with a hello world tutorial like this: http://www.penzilla.net/tutorials/python/intro/ and build your way up.

Once you are fairly comfortable with python try some other languages out and get a feel for them and why they are different etc... you might not want to stick to python, I know a lot of people dislike its special treatment of white-space, and other non-standard programming language features. At the same time though others don't care.
 
Last edited by a moderator:
  • #5
foges said:
thanx a lot. Can you recommend any book? or should i start out with the tutorials on the python website, then byte of python, then dive into python?

Check out the official Python website:
http://www.python.org/about/gettingstarted/

Also, beginner's guides at:
http://wiki.python.org/moin/BeginnersGuide/Programmers

Python was designed as a language to teach programming. It is wonderfully consistent. It has very little "it works like this except on Tuesday" for such a powerful language. C++ is a nghtmare in this regard.

Since you mention it, there is a site called "Dive into Python", but it's really for more experienced programmers http://diveintopython.org/
 
Last edited by a moderator:
  • #6
As far as I know, Java is the most widly spread and popular language in the world having more active developers than any other language (and jobs aswell)

http://www.tiobe.com/tpci.htm

it is also the language of choice for teaching programming at numerous universities across the globe.

I have had 2 programming lessons at my university both of them consisted of Java and the second one of C aswell.

If I got to learn programming by myself, I would start with C, just to get the basic of procedural programming (loops, if statements,etc) compilation and then when it would be time for pointers I would switch to Java and learn OOP(Object Oriented Pradigm - the most popular paradigm and IMHO the most useful).
 
  • #7
Jheriko said:
Start with a hello world tutorial like this: http://www.penzilla.net/tutorials/python/intro/ and build your way up.

Once you are fairly comfortable with python try some other languages out and get a feel for them and why they are different etc... you might not want to stick to python, I know a lot of people dislike its special treatment of white-space, and other non-standard programming language features. At the same time though others don't care.

Thanx, I am trying those tutorials, I am on the second page though and my IDLE isn't giving me the response it should:

Code:
>>> inta = 100
>>> fact = [COLOR="DarkOrange"]def [/COLOR]factorial (n):
	
SyntaxError: invalid syntax
PS: the the orange def is supposed to be highlighted not coloured

Im prety sure I am typing everything that's on the website in the yellow box:

http://www.penzilla.net/tutorials/python/datatypes/
 
Last edited by a moderator:
  • #8
foges,

That tutorial is bad! It definitely contains code that will not run in modern Python interpreters.

You can change the code to this:

Code:
inta = 100
def factorial (n):
    if n == 0:
        return 1
    else:
        return n * factorial(n-1)

fact = factorial
intb = fact(100) # 100! is pretty damned big, notice python doesn't choke.

There's no real reason at all to use the 'fact' identifier to mean the factorial function, though. Why not just do it this way?

Code:
inta = 100
def factorial (n):
    if n == 0:
        return 1
    else:
        return n * factorial(n-1)

intb = factorial (100) # 100! is pretty damned big, notice python doesn't choke.

- Warren
 
  • #9
haki said:
As far as I know, Java is the most widly spread and popular language in the world having more active developers than any other language (and jobs aswell)

I can guarantee you that this will not be true indefinitely. Java has already crested its peak popularity, and will eventually decline into obscurity (where it belongs).

- Warren
 
  • #10
chroot said:
I can guarantee you that this will not be true indefinitely. Java has already crested its peak popularity, and will eventually decline into obscurity (where it belongs).

- Warren

I am curious as to why you have made this comment. Can you be more specific?
 
  • #11
Ronnin said:
I am curious as to why you have made this comment. Can you be more specific?

From the same data source given by haki:

http://www.tiobe.com/tpci.htm

You can see for yourself the trend that Java's popularity is declining. This is important to me, because Java is, in my opinion, a bloated, extremely verbose, unnecessarily rigid and syntactically painful language. The only advantage it has is that it has a very large standard library, though the libraries available for other languages like Python are really almost as complete.

- Warren
 
  • #12
I myself have never used Python. I'm sure I'm going to draw ire of many stating my preference is C# at this time. I have used Java (JSP & Beans) to some extent but have had little exposure to their Server Faces. I was just curious as to whether Python had the same control extensability as Java and C#. I'm not nearly the purist I use to be and find myself doing more customizing than building core web logic (state management for example) as I use to. I am interested in your take because as you have stated the buzz around Java has for the most part has faded.
 
  • #13
I don't exactly know what you mean by "control extensibility," but I have never found anything that I can do in Java or its cousin C# (or even distant languages like Perl and shell scripts!) that I could not do more easily in Python. Your mileage may vary, but I believe Python is the coolest language on the planet at the moment. Sure, some people think it's a bit weird that the tab character is a meaningful component of the language's syntax, but, once you get over the bias and begin using the language, you quickly realize just how nice it is after all.

- Warren
 
  • #14
I'm no cheerleader for any language. I am curious to how Python works when implimenting web logic such as state maintainance. How hard is it to do a simple select from a DB and render a table or XML to the browser. I'm looking at it from a standpoint of how hard is it to port existing code from another language to Python.
 
  • #15
I'm sure it's as competent as any other language. It has DB modules, CGI modules, and XML modules included in the default install. I'm not a web programmer, though, so I can't give you specific examples. Google "python cgi" for all the examples you could ever want.

- Warren
 
  • #16
I believe I have hijacked this thread long enough. Chroot, I appreciate you take. I have played around with Linux as a web platform and have used Apache w/ Tomcat for JSP and servelets. I knew you had done some work on this forum so I was just curious as to your opinion. Thanks for your replies.
 
  • #17
chroot said:
From the same data source given by haki:

http://www.tiobe.com/tpci.htm

You can see for yourself the trend that Java's popularity is declining. This is important to me, because Java is, in my opinion, a bloated, extremely verbose, unnecessarily rigid and syntactically painful language. The only advantage it has is that it has a very large standard library, though the libraries available for other languages like Python are really almost as complete.

- Warren

That is ofcorse your opinion in mine you shouldn't have commented on something you do not understand. I haven't programmed in Python soo I will not comment on it, if you haven't done any serious work in Java please do the same.
 
  • #18
chroot said:
but I have never found anything that I can do in Java or its cousin C# (or even distant languages like Perl and shell scripts!)

If you put your mind to it, or choose a sufficiently difficult problem with sufficiently stringent constraints you are essentially forced to use C++ or assembler or to invent a similarly tight language. For instance a while ago myself and a small group of devs I was working with were looking for a scripting language to incorporate into a interactive 3d renderer. Python was not sufficient (at that time anyway, I understand that there are now quite a few compilers which generate code in memory from Python, where as at the time all we could find was the slow and clunky interpreter), although in its favour no major script on the market was sufficient for our needs either, also Python was far and away the best script we toyed with.
 
Last edited:
  • #19
haki said:
That is ofcorse your opinion in mine you shouldn't have commented on something you do not understand. I haven't programmed in Python soo I will not comment on it, if you haven't done any serious work in Java please do the same.

Well, let's see here, haki...

I began programming in Java in 1996, and taught classes on the language to high-school seniors in 1997. I have written literally dozens of major applications in the language, including this one that I wrote for National Semiconductor in 2002. This program included some 200 classes, for a total of some 50,000 lines of Java. It did everything from communicating with hardware via USB, to mathematical analyses on data, to image processing -- and, of course, had a quite nice user interface.

Here's a screenshot of it:

http://www.virtualcivilization.org/WaveVision-LowRes.jpg

It's still available from National Semiconductor:

http://www.national.com/appinfo/adc/wv4.html

I know Python literally as well as I know Java. I have written enterprise-wide applications that allow our design engineers to analyze analog waveforms from simulations, store them in databases, and perform regression analyses with a number of different waveform viewers. If you don't believe me, I'd be happy to take some screenshots of it.

Now, what was that you said about me commenting about something that I "don't understand?"

- Warren
 
Last edited by a moderator:
  • #20
ooooo ... pwnt.
 
  • #21
To a high school student who plans to study Electrical Engineering, I would recommend starting with the Mathematica programming language.
 
  • #22
Crosson said:
To a high school student who plans to study Electrical Engineering, I would recommend starting with the Mathematica programming language.

Mathematica is not strictly a programming language, its more of a highly specialised script. You don't need to understand too many programming concepts to use it, so I'm not sure how good it would be for learning programming in general...
 
  • #23
As I recall from the Java Whitepaper[1], Java as a language was designed to be simple (very little syntactic suggars) and Robust (rigid and verbose) and a few more things. What you wrote as shortcomings are actually the design goals of Java.

But, I admit that pre Java 5.0 it wasn't that nice to program in Java as is now.

[1] http://java.sun.com/docs/white/langenv/
 
  • #24
The problem with learning a first programming language is you need to learn at least 5 things at once: The specifics of that language, software design principles, (object orientation/modularity/information hiding/whatever is the fashionable buzzword this week), some basic algorithms, GUI design, and debugging techniques.

For the second language it gets easier, since you only have to relearn the first one.

In the long run I don't think it matters much what language you start with. I got paid to write my first program in about 1970, and I reckon I've learned a new language every 2 or 3 years since then. The only language I've used that has survived the whole time period was Fortran (and even then, Fortran 90 doesn't look much like good old Fortran II).
 
  • #25
haki said:
As I recall from the Java Whitepaper[1], Java as a language was designed to be simple (very little syntactic suggars) and Robust (rigid and verbose) and a few more things. What you wrote as shortcomings are actually the design goals of Java.

Regardless of whether its lousiness was a design goal or not, it's still lousy.

- Warren
 
  • #26
As long as Sun are behind Java it won't go away.

I aggree as an enduser it can be very slow, but it seems very flexible in that it is independent of the 'enviroment' it sits on..
 
  • #27
Python is even more flexible than Java in terms of inter-platform compatibility, because it not only runs anywhere, it can also operate with a wide variety of windowing toolkits.

Sun itself may well go away one day (this is also looking quite likely), and Java will hopefully follow it to the grave.

- Warren
 
  • #28
I hope not, as I like Solaris, but its getting opened up anyway...
 
  • #29
I have just never been able to get inot python, I love Java, and would recommend it to anyone, especially as a first language, however, I would be grateful if someone could give me a good python tutorial (book or website) that is, how should I say this, not boring? or rather is indepth and has a lot of applications besides the standard "Hello world!" I guess I just need to get past the first few chapters in python to begin to like it more
 
  • #30
Yeah, there is no need to wish Sun to bancrupt and saying that Gosling envsioned a lousy language.

Sun is shining for Sun, sales are growing, markets expanding, Java will be here for quite some more time.
 
  • #31
mgiddy911 said:
would recommend it to anyone, especially as a first language, however, I would be grateful if someone could give me a good python tutorial (book or website) that is, how should I say this, not boring?

Check out www.byteofpython.info, its for beginners. I am reading my way through it, so i don't know if its a great book, but it seems good enough.
 
  • #32
Sun is not doing so well, actually. They opened today at 6.14, which is the lowest of related companies. Their height was 64.3125 back in 2000, right in the middle of the Java boom. While they did increase revenue by 2 billion in 2006, their net income went from -107 million in 2005 to -864 million in 2006. Back in 2003 they lost 3 billion. Even though an increase in revenue is arguably a good thing, Sun has certainly not been in a strong position for a long time.
 
  • #33
Ermm.. 'share price' isn't a good indicator of how well ca company is doing relitave to other comapnys in a sector. Its better to look at Revenue, and Market capitalisation.

Anyway Sun won't go away, its a IT giant, I can't see them going bankrupt unless something eronish happens to them
 
  • #34
Anttech said:
Ermm.. 'share price' isn't a good indicator of how well ca company is doing relitave to other comapnys in a sector. Its better to look at Revenue, and Market capitalisation.

Anyway Sun won't go away, its a IT giant, I can't see them going bankrupt unless something eronish happens to them

You are right, it's not the the greatest indicator for outright comparison. However, Sun is also the lowest of the ten or eleven other top companies competing in the sector if you do a more indepth analysis--Microsoft being number one. Revenue is rather meaningless if you continue to lose money. Share price isn't a good indicator by itself, but combined with losses it is relevant.

Sun does look like they could turn around, but it is doubtful if they continue their pattern of losses.
 
  • #35
chroot said:
Python is even more flexible than Java in terms of inter-platform compatibility, because it not only runs anywhere...

I don't understand this, they both work using the same underlying princple of intepreting virtual instructions at run time... how can one be more flexible than the other?

Perhaps Python has been implemented on some major platform that Java has not and I am just not aware of it...
 

Similar threads

  • Programming and Computer Science
Replies
8
Views
866
  • Programming and Computer Science
Replies
10
Views
2K
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
7
Views
438
  • Programming and Computer Science
4
Replies
107
Views
5K
  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
Replies
11
Views
1K
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
9
Views
1K
  • Programming and Computer Science
Replies
9
Views
1K
Back
Top