"I am finally learning to program"

Story: What Jon Stewart Said, I Say Too. A lotTotal Replies: 84
Author Content
rht

May 14, 2010
9:57 PM EDT
Beware, tc, in your quest to escape the forces of darkness you may have entered the twilight zone.

Why learn programming? Surely all you need is bash plus *dialog (or zenity or, if you are really anal, kaptain).

theBeez

May 15, 2010
6:08 AM EDT
Well, I must admit she puts her money where her mouth is. I really think it's a good thing, no sarcasm implied.
vect

May 15, 2010
4:30 PM EDT
Christians warn against the 'mark of the beast'. People who won't get the mark of the beast will be unable to purchase food at the store or find employment and they will have difficulty fitting into society.

I am not a christian, but it seems we are all being corralled into using software/hardware that allows government/corporations to access and control information about our lives.

As technological 'dangers' increase, technological 'defenses' are erected. Getting the 'defenses' will require you to give up privacy and control. People like TC, who insist on keeping their freedom, will be perceived as contributing to the problem.

TOR is probably a huge honey pot. Use TOR if you'd like a special red flag to appear beside your information.
dinotrac

May 15, 2010
5:12 PM EDT
I'll bite. I'm old and stupid. What is TOR?
techiem2

May 15, 2010
5:20 PM EDT
http://www.torproject.org/

gus3

May 15, 2010
6:23 PM EDT
But I don't see how TOR connects to Jon Stewart, except in the most obtuse way.
azerthoth

May 16, 2010
3:28 AM EDT
@vect zomgwtfbbq ... I'll share my meds, k?
gus3

May 16, 2010
3:48 AM EDT
@az, thanks. I'm not the only one scratching my head.
jezuch

May 16, 2010
5:51 AM EDT
AFAIK this "mark of the beast" is implied to be a RFID chip implanted to everyone at birth and mandated by law (along with mandatory entry to genome database). For our safety and convenience, of course. But it's the first time I hear it to be a Christian thing (despite the reference to the Bible).

Anyone read "Limes Inferior" by Janusz Zajdel?
jdixon

May 16, 2010
11:22 AM EDT
> But it's the first time I hear it to be a Christian thing (despite the reference to the Bible).

You've never read the Revelation of St. John the Divine? Hmm, the first link Google gives to the text is this one:

http://www.raptureready.com/resource/kjv/Revelation.html

But there are any number of them. It's the last book of the New Testament in the King James Version of the Bible. It's the primary Christian source of information about the "end times", before Christ's return. While not a difficult read, as with most prophecy it's rather vague and difficult to interpret. There are a lot of varying (and often contradictory) interpretations of it out there.
azerthoth

May 16, 2010
3:44 PM EDT
*zoom* and their off and running.

Vect starting strong out of the gates, jezuch hot on his heals. jdixon makes a surprise move and takes them both in the first rounding ...
jezuch

May 16, 2010
3:52 PM EDT
Right. Misunderstaning all around ;)
jdixon

May 16, 2010
5:16 PM EDT
> Misunderstaning all around ;)

The interpretation of the mark of the beast being a RFID chip or some other type of computer related implant is fairly common among Christians these days. It's a rather obvious conclusion to reach, and a significant number of Christians have done so.

That's going to be one of the big stumbling blocks in the government ever implementing such a system in the US.
azerthoth

May 16, 2010
6:28 PM EDT
... jdixons horse seems to have the bit in his teeth. approaching the second rounding he is still charging hard. Both horse and rider thus far having completely avoided the clue by four obstacles. The tension from the riders whipping their horses is fairly palpable as jdixon leads the field into the second rounding...
vect

May 16, 2010
7:12 PM EDT
I didn't realize that my message was so cryptic at the time I posted it. I live in metro Los Angeles and conversation about scary technology is very common here.

There are religious fanatics here that carry signs at street intersections with messages about god's wrath, hell, abortion and the end times. It's not an everyday thing, but christians here are active enough that non-christians will know about things like the mark of the beast.

There is a general feeling of pessimism about technology that _some_ people have. There is an idea that we are facing a sort of 'end-game', where most of us will permanently depend on technology that enslaves and destroys us OR where technology is just used for very nasty things.

Facebook can be seen as a trojan horse for this type of technology. A lot of people depend on facebook to maintain their network and to advertise themselves. To some people, _not_ having a Facebook account makes less sense than having a Facebook account. These people leave their personal information in the un-guarded possession of Mark Zuckerberg.

Is it possible that information from places like Facebook is used for statistical tests or scenario tests or some kind of tests usefully employed for manipulating the population? If you think it's possible, then you must recognize that people may have already begun to depend on technology used to manipulate them.

The iPhone tracks its gps position all of the time. Apple knows the movement patterns of individuals and groups of individuals and could similarly run tests on this data to gain information that is useful for controlling or manipulating groups in ways you may not have thought of.

----- azerthoth,

You seem to be confused. How about telling us what's confusing you, rather than comparing the discussion to a horse race?
azerthoth

May 16, 2010
7:55 PM EDT
its not confusion, its sarcasm, if its too subtle for you maybe a blunt 'there was and is no need to haul religion into the discussion' will be clear enough for you. Nothing constructive will ever come from its inclusion in logical discussion. So with a little humor and sarcasm I tried to remind a few that the TOS also states something rather similar about inclusion of religion in discussion. Sorry if your on of those that needs the clue by four approach.

*we now return to our regularly scheduled mockery*
vect

May 16, 2010
8:14 PM EDT
That's a lame reason for commenting here.
TxtEdMacs

May 16, 2010
8:19 PM EDT
az,

Quoting:*we now return to our regularly scheduled mockery*
Sorry, busy with other things today. However, had I joined I would have been on the wrong side pertaining to the TOS standards.

Well,

YBT
vect

May 16, 2010
8:51 PM EDT
Open Source Software is relevant to discussion about abusive software/technology. Users have a level guaranteed control over Open Source software that they don't have with proprietary software.

If a proprietary software like Facebook is abusive, potential users have 3 options. 1 They can tolerate the abuse and use Facebook. 2 They can stop using Facebook. 3 They can use an open source alternative like Diaspora.

If there is no open source alternative like Diaspora, users who care about privacy are at a disadvantage to everyone else who benefits from using Facebook. Open Source Software gives us an alternative that allows us to opt-out of using abusive software.

Religion is not entirely relevant to Open Source software, but what is relevant is that christians have beliefs that we will be required to use technology that controls us. TC has recognized that she is being controlled by business and technology she has decided to use OSS alternatives to boycott abusive companies.

My point has not been to focus on christianity. The point is to observe the danger of things like Facebook and RFID devices and the usefulness of Open Source software for fighting these dangers. This is directly on topic with TC's original story.
azerthoth

May 16, 2010
9:50 PM EDT
Coming out of the second turn vect closes the gap, its a neck and neck race now folks. The cognizance hurdles are still ahead before the third rounding. Which of our riders will realize his horse is dead and stop whipping it? The tension is incredible ...
vect

May 17, 2010
12:01 AM EDT
Yes you're trying to be annoying. I see that.
tuxchick

May 17, 2010
12:13 AM EDT
Vect is right on all points, that is exactly what I was trying to say.

Quoting: it seems we are all being corralled into using software/hardware that allows government/corporations to access and control information about our lives.


That sums it up. Anyone is welcome to point out trends or any kind of significant leadership that indicate the opposite, because I sure don't see them.
azerthoth

May 17, 2010
12:56 AM EDT
Your use of religion to validate your opinions is specious. It adds no factual weight to your argument. It is therefor superfluous in relevancy and unneeded. It must be assumed then that it is included only to include some moral 'right' in a way intended to offend. My use of sarcasm was a friendly way to try and get you to see that, since you refuse, let me include my own 'religious' argument to your points.

Science flies you to the moon. Religion flies you into buildings.
jezuch

May 17, 2010
2:23 AM EDT
Quoting:Your use of religion to validate your opinions is specious.


Nah, it's just a convenient borrowing. Everybody heard about the apocalypse, right?

You don't have to be religious to make references to the Bible. That's why I misunderstood the original message (I'm not religious myself).

Quoting:Science flies you to the moon. Religion flies you into buildings.


Aye, Preacher of the Church of Science :)
Alcibiades

May 17, 2010
3:15 AM EDT
But what no-one has offered to TC is any practical advice on what she should learn! Come on people, give some practical encouragement.

My own suggestion is Python, and consider using PythonCard as the IDE if you want to get started right away with GUIs. And the book to learn Python from? Python for Software Design by Downey. Probably others will have furious alternative advice!
jdixon

May 17, 2010
8:33 AM EDT
> My own suggestion is Python...

I'd have to second that. It seems to be a very approachable language, speaking as a non-programmer.

> So with a little humor and sarcasm I tried to remind a few that the TOS also states something rather similar about inclusion of religion in discussion.

That's not quite what it says. And note that except for explaining myself, I have not included religion in the discussion, merely pointed to an outside source for further information, since someone else raised the issue.
number6x

May 17, 2010
10:36 AM EDT
I'll third Python(although I have used it much lately).

It is a good language to learn both object oriented and procedural concepts in. There is a wealth of good literature, a very active and friendly community and it is often used in administrative tasks. The last reason will make it seem immediately useful to someone with TC's background.

I always learn a language a year. This year I am cheating by re-learning Python. I am working through two Python 3.1 books. http://www.qtrac.eu/py3book.html http://www.mindviewinc.com/Books/Python3Patterns/Index.php

The most common version currently found is Python 2.6. Python 3 is now stable at version 3.1 and the great Python migration has begun(to migrate over large bodies of water pythons will often hide in coconuts and be carried by unsuspecting swallows). I think learning either version would be fine. You probably won't find a lot of existing 3.x Python work out there today, but two or three years from now it will be common. If you choose to learn 3.1 you will run across 2.x examples that won't work quite right, so just be aware.

As a second choice I would look at the book "Learn to Program" http://pine.fm/LearnToProgram/ This is based in Ruby
grosspatzer

May 17, 2010
10:49 AM EDT
> My own suggestion is Python...

I'll third that one. I'm a DB admin by trade, and a few years ago I got drafted by my church to rationalize about six different sources of parishioner data (spreadsheets, MS Access, proprietary Windows DBs, index cards ...) into a sane administration platform (had to mention religion to go along with the thread ...). I used Python, which I was learning on the fly, to write code for resolving all the data issues and populate a mySQL database for an open-source app called Churchinfo (kudos to Mike Wilt and friends for maintaining the project). I've since incorporated Python into my daily work routine (admin scripts, log parsing, etc.), it's easy to learn, syntactically clean, and powerful.

OK, back to lurking evilly in the background...
DarrenR114

May 17, 2010
12:03 PM EDT
Anyone suggesting Python and/or MySQL deserves to be banished to the ninth level of Hell for eternity.

PostgreSQL is a much better place to start - MySQL is nowhere near enterprise-ready. If you don't believe me then take a look for any articles on migrating from PostgreSQL to MySQL - and when you've discovered that you can't find any, then look at which big enterprises have migrated from MySQL to PostgreSQL because MySQL just can't cut it.

http://episteme.arstechnica.com/eve/forums/a/tpc/f/633092781... http://en.wikibooks.org/wiki/Converting_MySQL_to_PostgreSQL http://www.wikivs.com/wiki/MySQL_vs_PostgreSQL http://www.xach.com/aolserver/mysql-to-postgresql.html

As for Python - it is a POSITIONAL language - and anyone who has been a developer with any established enterprise for any length of time can tell you what a pain this is for maintainability - especially for any module that extends for more than one printed page. Also, with Python, you end up with Vendor Lock-in as far as databases go, because Python is close to useless for anything but MySQL.

It would be better to start with bash and then move on to PERL. Follow those up with PHP and Java. Throw in a dash of Eclipse as the IDE and install a Liferay-tomcat bundle so you can show all your friends what you're doing. I highly recommend using Liferay as a springboard because it's quick and easy to get started and there is so much you can do with it (Liferay is a full-blown Portal, and is JSR-268 compliant.) http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html http://tldp.org/LDP/abs/html/ The fine folks at Geekstuff have some good bash tutorial articles: http://www.thegeekstuff.com/

http://www.perltutorial.org/

http://java.sun.com/docs/books/tutorial/

http://eclipse.org

http://liferay.com

Just some thoughts from a guy who's been a professional programmer for over 25 years, worked with every major DB that's ever been, and even taught college-level courses to aspiring software developers.
Sander_Marechal

May 17, 2010
4:41 PM EDT
Quoting:Just some thoughts from a guy who's been a professional programmer for over 25 years


I can see why. Per. Java. Tomcat. Big Databases(tm). Talk about job security. With such complex, large and enterprise-y constructs you insure your boss will always need you for maintenance.

Quoting:PostgreSQL is a much better place to start - MySQL is nowhere near enterprise-ready.


There's no such thing as "enterprise ready". Also, PostgreSQL isn't better or worse than MySQL. They're different databases with different uses.

Quoting:As for Python - it is a POSITIONAL language


Which doesn't matter at all, as any programmer who has used Python can tell you.

Quoting:Also, with Python, you end up with Vendor Lock-in as far as databases go, because Python is close to useless for anything but MySQL.


Bull. Python supports many different databases. Some, but not all are listed here: http://wiki.python.org/moin/DatabaseInterfaces

Sorry Darren, but you sound like the kind of enterprise-y "developer" that the people at The Daily WTF make fun of.

TL;DR I fourth (fifth?) Python.
tuxchick

May 17, 2010
5:12 PM EDT
I'm going to start with brushing up my mighty Bash skillz, because it is rather awkward to get all confused and not know when it's a shell feature or your code that's doing something. I already know some basic Python, Perl, and C, so the next step will be one of those in-depth. Maybe I'll write a coin-toss script in Bash to choose which one, and then we can have long threads arguing about how random is a particular randomizer, really? :)
DarrenR114

May 17, 2010
5:57 PM EDT
@Sander - Position doesn't matter???? I can tell you've never been on a TEAM of programmers tasked with maintaining code written by someone else who is long gone from the company.

And yes, I am an "Enterprise-y" developer who is one of many that actually write the vast majority of software apps being developed.

Also, try reading a bit more accurately - I didn't write that Python doesn't support many different databases - I said it was close to useless for anything but MySQL.

And I stand by that statement, for instance - There is no "unified" db layer like the DBI::DBD (PERL) or JDBC (Java).

Unlike Python, PERL truly does support many different databases in an almost seamless manner. And anything you can do in Python, you can do better and more efficiently in PERL.
vect

May 17, 2010
10:08 PM EDT
Quoting:its sarcasm, if its too subtle for you maybe a blunt [...] Sorry if your on of those that needs the clue by four approach.


azerthoth,

Sarcasm and friendliness do not apply to your posts. You've intimated here that I'm dumb, which is insult not friendliness. Your posts are annoying bluster and insult.

Sarcasm is no replacement for intelligence.
vect

May 17, 2010
10:39 PM EDT
For general-purpose programming, any language with garbage collection and object creation is basically as good as another. Even if you're not using the best language for a task there's nothing wrong with that.

There are professional wedding photographers out there who can effectively use very average camera equipment because they're knowledgeable enough to work with what they've got and play to the strengths of their tools.

If I were just now learning to program and I was not planning to make a career out of it, I'd start by learning something that had sex appeal, like Haskell or Javascript.
gus3

May 18, 2010
12:01 AM EDT
Sorry, but I have to laugh at "sex appeal" in the same sentence as "JavaScript" and "Haskell".

Maybe I'm just getting old(er), but there's nothing about any programming language that elevates my heart rate.
vect

May 18, 2010
12:52 AM EDT
gus, maybe you should go to a few bars tonight and try something new.
gus3

May 18, 2010
12:57 AM EDT
Too late, I'm already...

Ah, never mind.
Sander_Marechal

May 18, 2010
2:21 AM EDT
Quoting:@Sander - Position doesn't matter???? I can tell you've never been on a TEAM of programmers tasked with maintaining code written by someone else who is long gone from the company.


I have, actually.

Quoting:I said it was close to useless for anything but MySQL. And I stand by that statement, for instance - There is no "unified" db layer like the DBI::DBD (PERL) or JDBC (Java).


Again, bull. Python has DBAPI: http://www.python.org/dev/peps/pep-0249/
vect

May 18, 2010
4:25 AM EDT
gus,

Have you forgotten curiosity and the joy of learning new things? Have you ever planted a garden? have you ever run in a marathon? Have you ever learned a foreign language? Do you remember the time when you learned about imaginary numbers? Or when you put on your first pair of roller skates?

Those things are sexy and being sexy is what life is all about.
gus3

May 18, 2010
11:11 AM EDT
Trust me, I have not forgotten the joy of learning new things. I speak three languages and read seven, I can do complex math, and recently gained a better understanding of Turing-machine equivalence (they're all just glorified calculators). But running a marathon is out of the question for me, due to an injury from half my life ago.

Lighten up, dude.
azerthoth

May 18, 2010
2:56 PM EDT
@vect nowhere in there did I intimate a lack of intelligence. I'll admit that you could infer I said you had a lack of decorum and propriety, but not a lack of intelligence.

@TC sorry to be sidebarring so much. Really it is a great thing to endeavor to learn, and I wish you the best of luck. I tend to like python as it can operate both as a high or low level language, although I have only ever dabbled a bit with it in low level.
DarrenR114

May 18, 2010
3:36 PM EDT
@Sander,

I doubt it. If you had, then you'd understand the difficulty of gleaning through source code written years earlier by someone who is no longer with the company. If you don't understand the difficulty of properly lining up pages upon pages of printed code (which you have to do when reviewing Python Code) then you obviously have a very limited breadth of experience developing software outside of the classroom environment.

BTW - that's an interesting API - but that's ALL it is - an API - a specification. You can't use it directly.

So that opens another can of worms - finding and installing the necessary database drivers that actually implement the specification. And what's this? I find THREE for PostgreSQL (Psycopg2, PypgSQL, and PyGreSQL) but all are slightly DIFFERENT from the others. Not exactly UNIFORM or UNIFIED as you implied. http://www.pygresql.org/ http://pypgsql.sourceforge.net/ http://initd.org/psycopg/
Sander_Marechal

May 18, 2010
4:49 PM EDT
@Darren: Printed code? Ah yes. 25 years of experience. You started coding in the 80's. As for old code, I read and maintained plenty of it. Every horror from DCL on VMS to spaghetti PHP. I've never needed to print code.

Quoting:BTW - that's an interesting API - but that's ALL it is - an API - a specification. You can't use it directly.


Which is different from your JDBC how? That's also just an API and also required drivers. A cursory search of PostgreSQL JDBC drivers lists 10 different impementations: http://developers.sun.com/product/jdbc/drivers/search_result...

TC is interested in learning to program to build new stuff to get away from existing abusive software companies. She's not interested in maintaining legacy systems. In this day and age, Python is a far better way to get started.
vect

May 18, 2010
5:10 PM EDT
azerthoth,

Maybe your communication is bad? you insulted me without realizing it (though I think you realize it and aren't able to admit it). Your lousy spelling and grammar are consistent with the idea that you have bad communication.

I want to give you the benefit of the doubt and believe the best about you, but it's too difficult for me to take you seriously. Paying attention to you is a waste of time.

---- gus,

You're right. I need to lighten up, -I'll just off-load a few more of these heavy posts I'm carrying around.
DarrenR114

May 18, 2010
6:48 PM EDT
@Sander,

In this day and age, PERL is STILL much superior to Python - when you consider things like standards, community, ease of implementation, learning curve... You name the metric and PERL is superior to Python.

BTW, your list of "10 different implementations" is not actually a list of "10 different implementations" - It is a list of "10 different vendors". And I'm being generous in that description since not all the links actually lead you to an actual JDBC driver. You should have followed the links in the first column - for example the link to Abacus doesn't lead to a PostgreSQL JDBC driver at all; the links to IDS lead into an ODBC driver - NOT JDBC; the links to jxDBCon lead to a site for a (quite OLD and out-of-date) FRAMEWORK for developing JDBC drivers, but there is no JDBC driver to be downloaded; the link to i-net points to what claims to be a remote JDBC connector - but again, this is no more a JDBC driver for PostgreSQL than it is for MySQL (if you look at the right-hand column you'll see this is for CSV and flat file DBMS). The ONLY link that will lead to an actual JDBC connector for Postgres is the one for http://jdbc.postgresql.org. And on that site, you will find there is ONE driver for JDBC3 (one DB API) and ONE driver for JDBC4 (another separate DB API with a different scope).

This is very different from the Python situation, in that you have 3 DISTINCT implementations for one DB API (Python).
hkwint

May 18, 2010
6:53 PM EDT
Far too late, but just in time to join I hope.

TC, as shown, it depends a bit on your personal preferenced way of beating the proprietary companies we all love. Err, I mean love to hate.

If you want to make eye-candy or 3D-applications 'better than Vista/Leopard' I think Qt and OpenGL is the way to go. Normally, most devs use C++ to 'instruct' OpenGL and Qt to do stuff, but Python can be used as well. If performance is an issue (for eyecandy it is, I believe) you need to find out how to compile Python. I don't know too much about that, except for that "I believe it's possible to a certain extent".

However, if you want to be 'future / cloudproof', you might better go the HTML5/JavaScript/WebGL way (my way currently, though I just got my feet wet).

Python is great for learning to program. The language and it's libraries are rather elaborate though, in my opinion. If you want to learn a language 'in depth', you'd better be sure to know how deep it is before you dive in.

There might be some reasons not to use it: http://bitcheese.net/wiki/nopython

Of course, there are also other ways to 'beat' said companies. Maybe study mathematics, so you can improve Theora and Schrodinger to become better and more efficient (requires C-coding though). Or even better, become a patent expert so you can help people code around the patents of patent trolls. And if you like a touch challenge, calculate how much damage 'patents abuse and lawyers' do to your society. When done, I'm pretty sure - given your location - you can start a class action lawsuit on behalf of society against Lawyers, USPTO and the Government who condones this issue. Start here: --> http://www.researchoninnovation.org/bio.htm

For those who want to increase their hartrate: Consider esotheric languages like Brainfuck (if you're brainless that one might work?) or LOLCODE. Or even better, use the second to prove the first is Turing complete: http://forum.lolcode.com/viewtopic.php?id=51
k314159

May 18, 2010
7:12 PM EDT
It depends on why you want to learn to program. I think C is one of the best initial languages to learn since the language is small and it requires one to know what is going on at the machine level to some extent.

If you mainly want to do web programming then take the advice of the previous posters. Learn Perl or Python. I think both are fine languages although they are very different.

If you want to do desktop development, then I would start with C and then learn C++ or Java or Python. I'm a bit partial to C++, but garbage collection is really nice to have.
Sander_Marechal

May 19, 2010
3:46 AM EDT
Quoting:You name the metric and PERL is superior to Python.


Readability. Learning curve. Availability of libraries (thanks to SWIG). Very important for beginning programmers.

Like many people have remarked, Python is executable pseudo-code. Perl is executable line-noise.

And thanks to SWIG, there are python bindings for a vast number of C-libraries.
DarrenR114

May 19, 2010
2:27 PM EDT
Readability: You gave no supporting evidence for Python being more readable that PERL. Due to the Positional restrictions, nested blocks of code, two or three levels deep that spread across multiple printed pages, are less readable in Python. And it's worse if you are trying to follow such nested logic on the screen ... Point 1 for PERL.

Learning Curve: You presented no evidence of an easier learning curve for Python. Considering that you have to be sure that you line up your nested blocks of code properly from the get-go, and all other things being equal, Point 2 for PERL.

Availability of libraries again goes to PERL: In CPAN (http://cpan.org/ ), there are currently 82019 modules.... While in PyPI (http://pypi.python.org/ ), there are only 9923 modules.... According to the SWIG site itself, http://www.swig.org/, SWIG is also usable to PERL as well as Python... Point 3 for PERL. And thanks to SWIG, there are PERL bindings for a vast number of C-Libraries.

And since that was a bit dishonest of you to claim SWIG as an advantage for Python: -1 point for Python because of your dishonesty.

As for your snide comment about PERL - that's an OPINION - minus 1 point for Python.

So the total count, using your own metrics, is PERL 3, Python (-2). PERL wins.

Using you as its prime advocate,the Python community strikes me as being that new kid on the block who is trying to make a reputation for himself but only proves to be a snotnosed brat.
bigg

May 19, 2010
2:59 PM EDT
Is it just me or is it hot in here? These programming language flamefests remind me of John Deere vs. Allis-Chalmers arguments.

Should the Wizards take John Wall or Evan Turner with the top pick?
Sander_Marechal

May 19, 2010
3:39 PM EDT
@Darren: I'll give you CPAN, but not readability and learnability. Perl is famous as a write-only language. It's hard to read, hard to maintain and hard to learn. But don't take my word for it: http://www.linuxjournal.com/article/3882

Quoting:As for your snide comment about PERL - that's an OPINION


Whereas your comments are merely filled with facts? O_o
jdixon

May 19, 2010
3:56 PM EDT
> You gave no supporting evidence for Python being more readable that PERL

And you gave none for PERL.

> You presented no evidence of an easier learning curve for Python.

And you gave none for PERL.

> As for your snide comment about PERL - that's an OPINION...

As are your statements about PERL. Pot, meet kettle.
mrider

May 19, 2010
4:50 PM EDT
I didn't plan on joining this argument, but a good programming language flame fest always calls me. :)

I love Perl. I really do. I easily write 10x the Perl code as Python. (I'm starting to sound like one of those Windows shills.) *But*:

> Due to the Positional restrictions, nested blocks of code, two or three levels deep that spread across multiple printed pages, are less readable in Python. Um, * http://en.wikipedia.org/wiki/Refactor . Seriously.

Also, your argument breaks down as soon as you need to deal with any complex data structures. E.g.:
#!/usr/bin/python
class Person:
    def first(self, fn = None):
        if(fn):
            self.first_name = fn
        return self.first_name
    def last(self, ln = None):
        if(ln):
            self.last_name = ln
        return self.last_name
bob = Person()
bob.first("Bob")
bob.last("Jones")
print("%s %s" % (bob.first(), bob.last()))


Yes Perl can be more concise:
#!/usr/bin/perl -w
use strict;
my @people;
$people[0]{first_name} = "Bob";
$people[0]{last_name} = "Jones";
print( sprintf("%s %sn", 
    $people[0]{first_name},
    $people[0]{last_name}) );


Or yes, Perl can use object structures:
#!/usr/bin/perl -w
use strict;
package Person;
    sub new {
        shift;
        my $self = {};
        bless($self);
        return $self;
    }
    sub first {
        my $self = shift;
        if(@_) {
            $self->{"first_name"} = shift;
        }
        return $self->{"first_name"};
    }
    sub last {
        my $self = shift;
        if(@_) {
            $self->{"last_name"} = shift;
        }
        return $self->{"last_name"};
    }
1;
my $person = new Person;
$person->first("Bob");
$person->last("Jones");
print( sprintf("%s %sn", $person->first, $person->last) );


But what rational person is going to look at either Perl example and think "that was easy"?

EDIT* The first two sentences from the article on refactoring overview are pertinent here:

"Refactoring is usually motivated by noticing a code smell.[2] For example the method at hand may be very long, or it may be a near duplicate of another nearby method."
gus3

May 19, 2010
6:13 PM EDT
Please shorten the first line with "printf(sprintf". It's clobbering the margins for the comments.
Sander_Marechal

May 19, 2010
6:58 PM EDT
Quoting:But what rational person is going to look at either Perl example and think "that was easy"?


I don't even consider that first Perl example equivalent of that Python code. The equivalent of that first example in Python would be (no objects, just an array of hashes/dicts):

#!/usr/bin/python
people = [{"first_name": "Bob", "last_name": "Jones"}]
print("%s %s" % (people[0]["first_name"],
  people[0]["last_name"]))
mrider

May 19, 2010
7:11 PM EDT
@Gus:

Done. Sorry.



@Sander:

No argument. My point wasn't to make exact duplications of code. My point is more along the lines of - look how easy the Python is to understand. Now look at what one would do to replicate similar behaviour in Perl.

Yes you can write a similarly ugly Python version. But, can you make a similarly nice looking Perl version?

And again: I love Perl. Perl is concise. Perl is flexible. Perl can probably turn random keystrokes into a Turing complete language. But it takes special effort to make Perl readable by non Perl programmers, and "real" programmers would probably sneer at the results.
gus3

May 19, 2010
8:02 PM EDT
@Sander:

You, too. Please shorten that last line of code.
DarrenR114

May 20, 2010
11:50 AM EDT
@jdixon,

What I wrote was that PERL was more readable that Python *because* the positional restrictions are not built into the syntax. THAT in itself is a supporting example. To expand on that reasoning: Because blocks of code are easier to delineate in PERL (since they have obvious start and end points, unlike Python) PERL code is easier decipher (e.g. 'read'). I don't have to try to figure out if a line of code is indented with 4,5, or 8 spaces or just a single tab. I can quickly see where a block of code begins and where it ends even when scanning across 2, 3 pages or 4, 5 screens.

What I wrote was that because a beginning programmer doesn't have to worry about how far they've indented the beginning of a block of code, PERL is easier to learn. THAT in itself is a supporting example. To expand on that point: they'll have an easier time learning the meat of programming logic since they aren't distracted by whether they pressed the space bar 4, 5 or 8 times, or the tab once. I guess you also overlooked that I mentioned "all other things being equal".

I presented specific examples. Your friend Sander, did not.

@Sander, I fail to see how your Python example is any easier to read or understand than the equivalent PERL: ============================================== #!/usr/bin/perl

my %person = ("first_name", "Bob", "last_name", "Jones");

print("$person{'first_name'} $person{'last_name'}"); =============================================== Edited to add: The more closely equivalent PERL would be: =============================================== #!/usr/bin/perl

my @people = ({first_name => "Bob", last_name => "Jones"}, {first_name => "Homer", last_name => "Simpson"});

print "$people[0]{'first_name'} $people[0]{'last_name'}"; ================================================

Or if you want to use a formatted string to print: ================================================= #!/usr/bin/perl

my @people = ({first_name => "Bob", last_name => "Jones"}, {first_name => "Homer", last_name => "Simpson"});

printf("%s %s", $people[0]{'first_name'}, $people[0]{'last_name'});

=================================================

And yet, I fail to see how the PERL equivalent is any more difficult to comprehend.

gus3

May 20, 2010
1:07 PM EDT
Sigh. I give up.
jdixon

May 20, 2010
2:10 PM EDT
> Your friend Sander, did not.

My friend? Gee, Sander, we've gotten really well acquainted all of a sudden. Did you know?

> What I wrote was that PERL was more readable that Python *because* the positional restrictions are not built into the syntax.

That's an opinion. I know of people who would argue the exact opposite, that positional restrictions make the language more readable. Not being a programmer, I don't really have an opinion on the matter.

> What I wrote was that because a beginning programmer doesn't have to worry about how far they've indented the beginning of a block of code, PERL is easier to learn.

Again, an opinion. Some folks learn better in a more structured environment, which counter to what you're arguing.
DarrenR114

May 20, 2010
2:42 PM EDT
@jdixon

There is a universal truth to learning - the less distractions there are, the easier it is to learn the desired material. Building pointless restrictions into the syntax of a language does nothing but add to the distractions. There is NOTHING in PERL preventing a programmer from using indentation (aka "whitespace") so in reality there is no "readability" advantage based on indentation syntax for Python. But because it's not required in PERL, a new programmer has one less thing to worry about. With Python, a new programmer has to ensure not only that the keywords, function calls, and underlying logic are correct, but also that everything indented correctly.
Sander_Marechal

May 20, 2010
3:55 PM EDT
Quoting:Because blocks of code are easier to delineate in PERL (since they have obvious start and end points, unlike Python) PERL code is easier decipher (e.g. 'read').


I disagree. Blocks are easier to see in Python *because* of the whitespace. Python code is always neatly indented. By definition. In Perl you have to look for the curly braces because indentation is optional. Indentation makes code more readable.

Quoting:@Sander, I fail to see how your Python example is any easier to read or understand than the equivalent PERL


Read my post again. I said no such thing. All I said was that the first Perl snippet that mrider posted wasn't equivalent to the Python code he posted. But the Python code he posted is a lot easier to read than the second Perl example he posted.

Quoting:Gee, Sander, we've gotten really well acquainted all of a sudden. Did you know?


Nope, but what the hell. Slumber party at my place? ;-D
jdixon

May 20, 2010
4:06 PM EDT
> Building pointless restrictions into the syntax of a language does nothing but add to the distractions.

One person's pointless restriction is another person's sensible structure. Sensible structure in a language is not a distraction.

As I said, this is all opinion. There is no consensus on which is better.

> Blocks are easier to see in Python *because* of the whitespace

I tried to tell him there were people who argued the exact opposite. :)

I've heard people argue both sides of that argument. I personally don't have an opinion.

tuxchick

May 20, 2010
4:40 PM EDT
Maybe these deep discussions on programming languages could start with linebreaks so that comments are not cut off at the right. Which are plainly visible to me, do I have special eyeballs and no one else can see this? Use slashes to indicate line-continuations in code, or post code on Pastebin.
gus3

May 20, 2010
5:07 PM EDT
tc, see my earlier comments.
tuxchick

May 20, 2010
5:09 PM EDT
I did gus, sorry to paint everyone with the same broad brush. OK everyone who has special eyeballs like me, don't read my last two comments!
hkwint

May 20, 2010
5:38 PM EDT
Quoting:Building pointless restrictions into the syntax of a language does nothing but add to the distractions.


Go tell ISO! They have all kind of 'pointless restrictions' for technical drawings. And you know why? Because if not, all drawings are different to such a degree that they are more difficult to understand. If you ever saw American or European technical drawings, you might know what I'm talking about.

And you know why they have these silly restrictions - called Standards? Because it's easier for people to (learn to) read drawings if they're all the same!

So if indentation in Perl is not standardized, it's actually harder to learn (reading those) than if you'd add 'silly restrictions'.
mrider

May 20, 2010
6:00 PM EDT
@tuxchick:

I genuinely do not see what you see unless I ramp my fonts up to ridiculously large size (like 48pt). But I appreciate the fact that "it works for me" isn't good enough. Does any of the code I posted need to be broken up further? I'll be happy to do so if necessary.



Otherwise I'm done posting in this thread. It's apparent that reason is not prevailing. :(
theBeez

May 20, 2010
7:21 PM EDT
I like Forth. Forth is the most consistent programming language there is. You read it from left to right. Every whitespace terminates a token. A name can be composed of all the rest.

People love languages, because "they do so many things for them". Forth is tiny and simple. Forth does nothing. You maintain your symbol table. You manage your stacks. Those who are unable to balance their occasional malloc() and free() calls can't cope without garbage collection, because they have a habit of treating their storage resources like a student tends to do his dorm - the electronic equivalent of Mum and Dad so to say. This kind of people will love Forth, because their have to balance both the return and the data stack - not alone between function calls, but also with each and every branch and loop instruction. The slightest imbalance will cause a devastating crash and tear down your entire system.

Still, Forth programs are extremely small. Most subroutines can be written in the space of a C prototype and are consequently one line long. Forth doesn't dictate any format. You can indent Forth code any way you like (there are so-called "long" forms and "short" forms, but these are just uninteresting conventions nobody actually follows). Most Forth compilers don't even care whether you feed them Mac, DOS, Unix ASCII or even blockfiles (chunks of diskspace, 1K long, unformatted).

Forth has no type checking, since there are no types to check. Forth has one single datatype: the WORD. A WORD can be (depending on the processor) 16, 32 or 64 bits. Forth has no parameters or function prototypes as well, which really cuts down the code size. There are complete line-editors, OO-extensions and full blown floating point add-ons in 1K of source. But there is a dark side. C allows you to shoot yourself in the foot, Forth will blow your head clean off.

Consequently, Forth is the language of choice of elite programmers (e.g. NASA). Most Forth programmers write their own compiler, preferably a compiler that can compile the compiler and little else. There is a ANSI standard for Forth, but most programmers don't follow it, instead they provide a convenient interface to a non-existent ANS Forth compiler with their programs, so you can't run it anywhere, but on the compiler it was originally written for. Or you can adapt the program so it runs on yours. Since Forth is so terse and comments (although there are many ways to define them) so rare, it usually takes less effort to rewrite the entire thing. That's why Forth is such a rich language. There are so many incarnations of "Hello world" and "99 bottles of beer" to choose from!

The rest of the world may have lengthy discussions about which language is best: Python or Perl, both multi megabyte monsters that will take the breath out of the best processors available to mankind and turn them to the equivalent of a 50-year long smoking asthmatic obese old man.

Yes, my dear children, garbage collection, heap bashing, type- and range checking do not come for free.
Steven_Rosenber

May 20, 2010
7:46 PM EDT
Ladies and gentlemen, I believe we have a winner.
tuxchick

May 20, 2010
10:44 PM EDT
mrider, I might have been wrong. LXer has a funny thing with too-long lines; it does something to make the comments column narrower than the comments, so the right sides of sentences get cut off. But now I'm looking at it and it's fine, so maybe it was already fixed and I had my browser window too narrow. But I know I wasn't delusional, gus3 saw it too! (OK shared delusion.) It's a good thread, not much new for me but always entertaining when coder geeks argue languages. Just don't say "Visual Studio" and it's all good.
tuxchick

May 20, 2010
10:47 PM EDT
Aha! Now I see the problem with too-long lines in the comments-- you have to expand the window way wide. When there are not too-long lines you can make a nice narrow browser window, and the lines in the comments wrap. But they don't wrap when there are long code lines in the comments.
gus3

May 20, 2010
11:35 PM EDT
Alternate temporary "fix" in Firefox: Press Ctrl-KeyPadMinus to shrink font.

And no, tc, you weren't wrong, and you weren't hallucinating.

Beez, if it's RPN you want, go whole hog:
/TimesNewRoman 48 selectfont
609 1293 moveto
(Go Postscript!) show
showpage
Koriel

May 21, 2010
1:13 AM EDT
Believe it or not Forth was the first language I ever programmed in commercially, I also wrote a simple Forth based OS in 8 bit Z80 for the Sinclair ZX Spectrum when i was a teen, ahh the glory days of a mispent youth when i should of really been out partying and gettin laid :)
jezuch

May 21, 2010
2:23 AM EDT
Quoting:Python or Perl, both multi megabyte monsters that will take the breath out of the best processors available to mankind and turn them to the equivalent of a 50-year long smoking asthmatic obese old man.


That reminds me of Greenspun's Tenth Rule:

"Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp."

On one occasion someone claimed during a conference speech that Python is the new Lisp. Upon hearing that, some elderly man with gray hair stood up and asked: "can Python programs modify themselves?". The speaker answered: "No, John, they can't." The rest was silence. [This was John McCarthy himself, inventor of Lisp, and I remind you that Lisp was invented in 1958.]

(I'd like to find the source of that story, to correct any errors I obviously made, but I'm out of time right now.)
theBeez

May 21, 2010
3:34 AM EDT
@Koriel I had an org* when my first, non-trivial Forth program worked. ;-)
Sander_Marechal

May 21, 2010
3:34 AM EDT
@jezuch: Great story. I've dabbled with Lisp a bit. It's a fantastic language that can do amazing thing. Unfortunately it's very hard to wrap your head around it. They say that to really understand Lisp is like some sort of epiphany that has a lot of consequences on any coding you will do thereafter. I haven't had that yet. Sadly. I'm still looking for some small programming task that I can use Lisp for, so that I can really use it instead of just following tutorials.
theBeez

May 21, 2010
5:29 AM EDT
@ Sander_Marechal LISP: Lots of Irritating, Superfluous Parentheses. ;-)

Without kidding: in Forth circles LISP is considered to be the prefix brother of Forth. Just as mind boggling. Personally, as a Configuration Manager I have to deal with lists, endless lists, each and every working hour of the day, so I'm glad I can do without them when I'm programming for fun! BTW, adding basic lists functionality is trivial in Forth, e.g.:

: cons ( k v - a ) swap 2 cells allocate throw tuck ! tuck cell+ ! ; : car! ( v a - ) ! ; : cdr! ( v a - ) cell+ ! ; : car@ ( a - v ) @ ; : cdr@ ( a - v ) cell+ @ ; : cons0 ( - a ) 0 0 cons ;

The reverse is true as well: http://webhome.csc.uvic.ca/~djohnson/parser.html

jezuch

May 21, 2010
5:03 PM EDT
Quoting:Unfortunately it's very hard to wrap your head around it.


I wonder how much that is only because we're conditioned to think in imperative languages. When I learned about functional programming I felt like it was like I always wanted to do my programs (OK, maybe not immediately). The thing is that I learned it after lots and lots and lots of BASIC, Pascal, C, Java, assembler and stuff like this while nobody told me there's an entire parallel universe just aroud the corner. They were hiding the truth from me!!! I think this one-sidedness is a great tragedy of CS education. You need both (to see that functional style is better ;) )

And because functional prgramming only now starts to break through to the mainstream, I can't do it at work (although we were discussing trying out Scala some time ago). But I do it anyway - a p*ss-poor attempt in Java, anyway. I use a lot of nested function calls and my variables are no variables at all (they don't change once they're assigned, like in a SSA (Static Single Assignment) form).

PS: That only a genius like McCarthy can understand functional programming, is a lie - perpetrated by drones that fear change. Very much like with Linux and Windows. PPS: I very much like Haskell and would like to recommend it too! PPPS: Sorry for the rant.
gus3

May 21, 2010
7:23 PM EDT
Lisp was an eye-opener for me, but not in the way commonly touted. Lisp was what finally got me to understand the Turing-equivalence theorem: a problem solvable on one Turing-complete machine, is solvable on any Turing-complete machine. A lesser theorem is that "any iterative procedure has a recursive equivalent, and vice-versa."

http://gus3.typepad.com/i_am_therefore_i_think/2010/02/my-fi...
herzeleid

May 21, 2010
7:37 PM EDT
Quoting:a problem solvable on one Turing-complete machine, is solvable on any Turing-complete machine. A lesser theorem is that "any iterative procedure has a recursive equivalent, and vice-versa."
Ah, hearing all these computer sciencey things gives me a lump in my throat, just remembering the good old days back in college....
gus3

May 21, 2010
8:36 PM EDT
@herzeleid:

I can only wish they had taught me these things in my CompSci courses.

But discovering them for myself brings both amazement and memorability.
Sander_Marechal

May 22, 2010
4:28 AM EDT
I have always *loved* This Groklaw article: An explanation of computational theory for lawyers: http://www.groklaw.net/article.php?story=20091111151305785&q...

You can pretty much see how the math directly maps to Lisp S-expressions, thereby showing that all computer programs are math. Brilliant!
hkwint

May 22, 2010
10:21 AM EDT
I always like browsing this one: http://www.dmoz.org/Computers/Programming/Languages/

Plenty of resources over there, but I'm not sure how up to date it is nowadays. In the pre-Wikipedia-era it was the best source, however.
gus3

May 22, 2010
10:36 AM EDT
The Roots of Lisp: http://www.paulgraham.com/rootsoflisp.html

Read the whole thing from the beginning, so when you get to the surprise, you'll understand it. It's easy to find; it's titled "The Surprise".

Posting in this forum is limited to members of the group: [ForumMods, SITEADMINS, MEMBERS.]

Becoming a member of LXer is easy and free. Join Us!