LinuxQuestions.org
Visit Jeremy's Blog.
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 08-30-2009, 08:48 PM   #61
joeBuffer
Member
 
Registered: Jul 2009
Distribution: Ubuntu 9.04
Posts: 328

Rep: Reputation: 42

I searched for this thread, trying to figure out where Sergei Steshenko's signature came from.

I have read through a book and some tutorials on PERL, and just a week or so ago started reading "How to Think Like a Computer Scientist: Learning with Python." (I haven't finished it yet.) They both seem to be good languages, but I'm far from being an expert on this subject.
Not being an expert, I would say that PERL seems to me (to put it simply) to be more "heavy-duty" in ways. It seems to me to be more complex, and not just in the syntax.
PERL OOP - and some things about the rest of the language - seems a little messy to me. Not in a permanent sort of way, just in a "this takes a lot of getting used to." sort of way.
Also, I see that Eric Raymond finds Python to be a very good language.
http://www.linuxjournal.com/article/3882

Last edited by joeBuffer; 08-30-2009 at 11:56 PM.
 
Old 08-30-2009, 09:51 PM   #62
Dan04
Member
 
Registered: Jun 2006
Location: Texas
Distribution: Ubuntu
Posts: 207

Rep: Reputation: 37
Quote:
Originally Posted by Sergei Steshenko View Post
Well, even in "C"

Code:
#define UNLESS(cond) if(!(cond))
- any language with macros allows such a trick.

And syntax sugar, well, sometimes is really sweet.

But my point is different - languages evolve, so a claim that if a language doesn't [have] a feature it means it doesn't need it is funny.
True as stated. However, I would agree with the statement "If a language doesn't have a feature and the workaround for the lack of that feature is trivial, then the language doesn't need that feature." I've never felt the need for "unless" in Python (or C++, or Java, or ...) because "if not" works just fine, and doesn't even require more keystrokes than "unless".
 
Old 08-30-2009, 11:34 PM   #63
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by Dan04 View Post
True as stated. However, I would agree with the statement "If a language doesn't have a feature and the workaround for the lack of that feature is trivial, then the language doesn't need that feature." I've never felt the need for "unless" in Python (or C++, or Java, or ...) because "if not" works just fine, and doesn't even require more keystrokes than "unless".
You are on a dangerous path - you have to demand removing 'for' statement because by definition it is implemented through 'while'.

Or, since 'for' is shorter than 'while', demand removing 'while' statement while leaving 'for', which, actually, is the only looping construct one needs.
 
Old 08-30-2009, 11:56 PM   #64
joeBuffer
Member
 
Registered: Jul 2009
Distribution: Ubuntu 9.04
Posts: 328

Rep: Reputation: 42
A question for Sergei:
You say "Python's catching up." Do you think that in the future Python might be a better language in your opinion than it is now?
---
http://www.python.org/about/success/

Last edited by joeBuffer; 08-31-2009 at 01:47 AM.
 
Old 08-31-2009, 01:49 AM   #65
Dan04
Member
 
Registered: Jun 2006
Location: Texas
Distribution: Ubuntu
Posts: 207

Rep: Reputation: 37
Quote:
Originally Posted by Sergei Steshenko View Post
You are on a dangerous path - you have to demand removing 'for' statement because by definition it is implemented through 'while'.
I said a trivial workaround. This applies very well in the case of "unless", which can always be easily written as "if not". It takes a little more effort to convert

Code:
for item in iterable:
   print item
to

Code:
iterator = iter(iterable)
while True:
   try:
      item = iterator.next()
      print item
   except StopIteration:
      break
 
Old 08-31-2009, 08:41 AM   #66
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by joeBuffer View Post
A question for Sergei:
You say "Python's catching up." Do you think that in the future Python might be a better language in your opinion than it is now?
---
http://www.python.org/about/success/
Yes, why not ?

The point, though, is that Perl 6 is making progress too, and slowly its features even migrate into Perl 5.
 
Old 08-31-2009, 08:43 AM   #67
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by Dan04 View Post
I said a trivial workaround. This applies very well in the case of "unless", which can always be easily written as "if not". It takes a little more effort to convert

Code:
for item in iterable:
   print item
to

Code:
iterator = iter(iterable)
while True:
   try:
      item = iterator.next()
      print item
   except StopIteration:
      break
A trivial thing is to replace 'while' with 'for'.
 
  


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
LXer: Review: Programming in Python 3: A Complete Introduction to the Python Language LXer Syndicated Linux News 0 01-26-2009 04:50 AM
python update - Unable to load GTK2 Python bindings: No module named gtk itpedersen Linux - Software 2 10-03-2008 03:44 AM
LXer: Charming Python: Python elegance and warts, Part 2 LXer Syndicated Linux News 0 08-31-2007 08:40 AM
LXer: Move to python 2.4 / Changing the packaging style for python packages LXer Syndicated Linux News 0 06-13-2006 07:54 PM
python problem - compiled from source - python -V still showing old version txm123 Linux - Newbie 1 02-15-2006 11:05 AM

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

All times are GMT -5. The time now is 06:32 AM.

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