LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-12-2009, 07:43 PM   #16
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled

Quote:
Originally Posted by DiBosco View Post
Suggesting good programmers you know would never work on Python is bizarre and then saying maybe some good programmers here might use it is insulting.
I took that to mean his more-skilled colleagues were biased against it, thereby preventing him from knowing any python programmers with skill. As in a situational confine. No need for offense based on your own reading of the statement; that's pretentious.
Kevin Barry
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 12-13-2009, 02:22 AM   #17
DiBosco
Member
 
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mageia
Posts: 807

Rep: Reputation: 40
Hmmm, it's not pretentious, that 's not the right word. Over sensitive maybe, but pretentious means something different.

Now I'm being pedantic.

If I was over reacting or misinterpreting, then apologies.
 
Old 12-13-2009, 02:53 AM   #18
ernst
Member
 
Registered: May 2006
Location: Sydney
Distribution: Debian etch, SkoleLinux
Posts: 77

Rep: Reputation: 15
Python has dynamic typing and can easily be used in an object oriented way. A huge plus in my mind.
Obviously it depends on the programmer whether they think object wise or procedural.
 
Old 12-13-2009, 09:10 AM   #19
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by DiBosco View Post
Suggesting good programmers you know would never work on Python is bizarre and then saying maybe some good programmers here might use it is insulting.
That puts a very different spin on it than what I actually said.

Quote:
Any language can be hard to follow if not well written and well documented.
...
if you write Python code in a well structured way and comment it well, it will be as readable as any language.
Obviously I agree. I think my statements already implied most of that.

But I think the language design is a big factor, especially when the programmer has less skill and/or motivation for writing well structured code.

I still think the design of Python leads you toward badly structured code, in contrast to the design of Java, which leads you toward well structured code.

In support of that idea, I have both my own understanding of the language features of many languages, and a bunch of anecdotal evidence from correcting the work of many other programmers. One programmer, whose work I corrected a lot, worked in both Python and C++, preferred Python and knew it much better than C++. His C++ work was shoddy, but his Python work was so much worse (an unstructured disaster that he could never understand himself even a few weeks after finishing any section). Another programmer worked in Java and C++, preferred Java and knew it better than C++. Her C++ was a similar quality to the first programmer I mentioned, while her Java code was almost OK. I've seen a lot more samples in various languages from various programmers that each work mainly in one language. Those all also support my observation that bad programmers make a worse mess in Python than in other languages, but that is not only just anecdotal evidence, it also lacks any control for the relative skill of the various bad programmers.

I know enough about programmers in general and about the effects of language design in general, to conclude that some good programmers are writing good code in Python. I have never actually looked at any good Python code, but I can still assume it exists.
 
Old 12-13-2009, 09:24 AM   #20
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
I was thinking Shell when I first read his post - why can't he just use the Shell?
 
Old 12-13-2009, 09:52 AM   #21
DiBosco
Member
 
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mageia
Posts: 807

Rep: Reputation: 40
Quote:
Originally Posted by johnsfine View Post
That puts a very different spin on it than what I actually said.
In which case, I apologise to you.

I've never done any Java (never interested me as it produces slower programs than native code for my money), so I can't comment on it. I certainly find that I've seen some of the worst written code in C and C++. You can obfuscate that so much.

I will respectfully disagree about writing neat code in Python though.
 
Old 12-13-2009, 01:29 PM   #22
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by General View Post
I think I have a need to learn a programming language or similar, but I'm at a loss to know which one fits my needs well. ...
Some of the choices depend on the format of the files you want to textually manipulate. If, for example, they are .pdf files then probably "forget it", if they are OOo files then it's going to be tricky ...

Last edited by catkin; 12-13-2009 at 01:36 PM. Reason: Didn't like it; better now
 
Old 12-13-2009, 03:43 PM   #23
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by ghostdog74 View Post
Perl,Python


Perl,Python


Perl,Python


Perl,Python


Perl,Python


Perl,Python


Perl,Python


Perl,Python


Python

Conclusion: Python.

Of course, Perl - I am able to understand what I wrote even years ago.
 
Old 12-13-2009, 05:57 PM   #24
titanium_geek
Senior Member
 
Registered: May 2002
Location: Horsham Australia
Distribution: elementary os 5.1
Posts: 2,479

Rep: Reputation: 50
Whatever language you pick, learn how to code in a way that can be understood. "You mean I can name this object/method/variable just about anything? cool, let's go for pizza, popcorn and hotdog." I am guilty of this, name it anything, but make that anything descriptive of what the thing does!

TG
 
Old 12-13-2009, 11:57 PM   #25
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
I'd go with Perl; it's very good with text, even foreign langs and widechar situations. Note that the inventor Larry Wall is actually has an English degree, not a CS one.
The regex engine built-in to Perl is very powerful, in fact it's used by some other langs (see pcre: perl compat regex).
You'll need the Llama book as above to get started, then I recommend the Perl Cookbook http://oreilly.com/catalog/9780596003135; worth it's weight in gold and the following docs/tutorials
http://perldoc.perl.org/
http://www.perlmonks.org/?node=Tutorials
search.cpan.org for a massive library of pre-written modules you can use and do get the Mastering Regular Expressions book http://regex.info/, avail in several langs as you can see.
Perl is actually compiled-on-the fly, so its pretty swift. Not quite as fast as C, but much easier to write, & waay faster thnn shell.
Explanation http://www.perl.com/doc/FMTEYEWTK/comp-vs-interp.html if you really want to know the details.

As mentioned above though, learning to program properly/clearly is your key need, in any language.

At the end of the day, it's your choice; maybe you should do a little work in a few of the langs recommended and see if they gel for you.
 
Old 12-14-2009, 09:18 AM   #26
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by chrism01 View Post
I'd go with Perl; it's very good with text, even foreign langs and widechar situations. Note that the inventor Larry Wall is actually has an English degree, not a CS one.
The regex engine built-in to Perl is very powerful, in fact it's used by some other langs (see pcre: perl compat regex).
You'll need the Llama book as above to get started, then I recommend the Perl Cookbook http://oreilly.com/catalog/9780596003135; worth it's weight in gold and the following docs/tutorials
http://perldoc.perl.org/
http://www.perlmonks.org/?node=Tutorials
search.cpan.org for a massive library of pre-written modules you can use and do get the Mastering Regular Expressions book http://regex.info/, avail in several langs as you can see.
Perl is actually compiled-on-the fly, so its pretty swift. Not quite as fast as C, but much easier to write, & waay faster thnn shell.
Explanation http://www.perl.com/doc/FMTEYEWTK/comp-vs-interp.html if you really want to know the details.

As mentioned above though, learning to program properly/clearly is your key need, in any language.

At the end of the day, it's your choice; maybe you should do a little work in a few of the langs recommended and see if they gel for you.
I think that Larry Wall has both degrees.
 
Old 12-14-2009, 07:37 PM   #27
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You may be right, I didn't check. I know a big deal is made of the effect the English degree has on the design of Perl.
In either case, a good lang and prob good for this OP.
 
Old 12-15-2009, 04:45 AM   #28
General
Member
 
Registered: Aug 2005
Distribution: Debian 7
Posts: 526

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by resetreset View Post
I was thinking Shell when I first read his post - why can't he just use the Shell?
A worthy comment. I've been using BASH for the last 6 years. I guess I assumed that was a "crude" or "inefficient" way of doing things. My code is like: do this, then do that, then do that, then finish.

Recently, I took up the study of LaTeX. I was extremely skeptical at first about it, thinking it would just be inefficient and a waste of time. But, after studying LaTeX for just a few months, I've written many of my own macros and now my work is much more organized and I can assemble lengthy and complicated documents in a very short time. I've come to see word processors as "crude" and "inefficient" tools for most of my work.

My current job affords me much time, which I intend to use for educating myself before returning to school. I thought maybe it was time to advance beyond the shell, but since that is unknown territory for me, I have no idea what new tools I will find there. I don't see any books named, "Natural Language Processing for the Unix Shell" or "Linguistics for BASH", so I assume I need to find myself something a little more powerful.

Anyway, I'm exploring everyone's suggestions closely. I notice if I type 'python' I'm dropped into a sort of shell, where I can type in various commands. Is this a "safe" sandbox in which I can test things out? I mean...can I accidently delete files and stuff from inside this?
 
Old 12-15-2009, 05:11 AM   #29
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by General View Post
I don't see any books named, "Natural Language Processing for the Unix Shell" or "Linguistics for BASH", so I assume I need to find myself something a little more powerful.
natural language processing is more advanced. you can either find a toolkit with commands that you can execute on the shell, or modules that can be used with languages such as Python or Perl. You can search the net for "Python natural language processing" or "Perl natural language processing" to see if you can find anything you like.

Quote:
Anyway, I'm exploring everyone's suggestions closely. I notice if I type 'python' I'm dropped into a sort of shell, where I can type in various commands. Is this a "safe" sandbox in which I can test things out? I mean...can I accidently delete files and stuff from inside this?
Python has a shell, believe it or not, if you don't want to use bash shell as your normal shell, you can use Python shell, although i don't see many do that. example from my screen
Code:
>>> import os
>>> os.getcwd()
'/home/images'
>>> os.mkdir("test")   <--- shell: mkdir
>>> os.chdir("test")   <--- shell: cd
>>> f=open("file","w") <--- shell echo "test" > file
>>> f.write("test"+"\n")
>>> f.close()
>>> for line in open("file"):  <<---- shell: cat file 
...  print line
...
test

>>> os.listdir(".")   <---- shell: ls *
['file']
>>> os.remove("file")   <---- shell :rm file
>>> if not os.path.exists("file"):   <---- shell: [ ! -f "file" ]
...  print "file does not exists"
...
file does not exists
>>>
so you can see, files won't get deleted , unless you tell it to. !

Last edited by ghostdog74; 12-15-2009 at 05:13 AM.
 
Old 12-18-2009, 01:45 PM   #30
Caesar Tjalbo
Member
 
Registered: Aug 2006
Location: Ņuņoa
Distribution: KaOS
Posts: 94

Rep: Reputation: 16
Quote:
Originally Posted by johnsfine View Post
I still think the design of Python leads you toward badly structured code
I think the design of Python doesn't lead you to any structure. It's what makes Python great for those who want to learn how to code and those who already know how to code. There's a balance here, which may or may not appeal to you depending on preferences: the relative freedom Python gives can easily lead to a coding mess but its freedom makes it also easier to structure in advance (or refactor when insight progresses).

Python allows me to freely mix procedural, functional and OO programming aspects or use global variables. Python invites to sit down and start coding without thinking first. I don't see that as weaknesses but I recognize pitfalls for sloppy coding.

It's all about coding standards, having them and applying them. Python's not like an old interpreter BASIC that almost tried to work against you if you tried to structure your work. But still, software design and coding is something one has to learn.

Given the question of the OP, I'd say Python is a valid suggestion: easy to learn, easy to use a general programming education, capable, useful for prototyping solutions AND still understandable after 6 months.

Last edited by Caesar Tjalbo; 12-18-2009 at 01:48 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
which language is this?.... rajesh84210 Programming 10 08-12-2009 12:33 PM
Good linux chinese language language program? darsunt Linux - Software 1 04-10-2009 12:06 PM
which language? caminoix Programming 14 06-27-2005 04:57 PM
what language? andrewlkho Programming 4 07-20-2003 12:22 AM
Next Language Task Programming 5 07-18-2003 08:54 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration