Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: C vs. Perl

by etcshadow (Priest)
on Oct 22, 2003 at 15:52 UTC ( [id://301254]=note: print w/replies, xml ) Need Help??


in reply to C vs. Perl

Uh, hello? malloc()? realloc()?

I mean, I prefer writing code in perl, too... but "you can't do this utterly simple thing in C" business is just silly.

Yeah it takes more lines of more difficult C to do the same thing, but what the hell? They're different languages. There are things better done in C for various reasons (but they can be done in Perl) and things better done in Perl (but they can be done in C).


------------
:Wq
Not an editor command: Wq

Replies are listed 'Best First'.
Re: Re: C vs. Perl
by podian (Scribe) on Oct 28, 2003 at 17:43 UTC
    I am sorry if I have confused you all. I did not say that C is bad, or it can't be done in C. I was just trying to
    point out that Perl (and Java etc.) already has a lot of built in stuff and it makes life easy to write stuff. Of course, you could also do it in assembly code, but why?
    I agree that you could do certain things in C for speed. I also agree if I have all the necessary
    libraries (such as Vectors) I would not mind writing in C.
    I was also wondering that if I have an example like this, people who are learning perl will get excited about perl!
    In C, for example, if you do not know how many elements are there, you could, say, allocate 100 elements first, and then when you reach 100, you could allocate 200 elements and then move those 100 elements to the new array! Why do I want to do that when a language already does that for me.
    I was also looking for a place for this and could not find a proper category (Please suggest one).
Re: Re: C vs. Perl
by sauoq (Abbot) on Oct 22, 2003 at 21:24 UTC
    "you can't do this utterly simple thing in C"

    Perhaps you didn't read the node... you certainly weren't quoting it.

    He didn't say you can't do that simple thing in C. He implied that such a simple thing was much simpler to do in Perl than in C.

    -sauoq
    "My two cents aren't worth a dime.";
    
      Well he said "How would you do this in C?", which could be interpretted as a rhetorical means of asserting the claim that it couldn't be done (particularly if you take his quote in context). Regardless of whether you think that he was asserting it's impossibility or just claiming that it was ridiculously hard, his statement was clearly rhetoric.

      I was just answering rhetoric with rhetoric. Specifically with hyperbole. I know he wasn't claiming that it couldn't be done at all... but his claim was ridiculous none the less. The worst thing is that he picked a particularly silly example, as it could be done in a very small and simple C program.


      ------------
      :Wq
      Not an editor command: Wq
        I know he wasn't claiming that it couldn't be done at all... but his claim was ridiculous none the less.

        By what measure?

        Assuming "his claim" was that writing his silly example would be easier to do in Perl than C, he's correct by any decent metric I can think of.

        So, podian, a new monk and perhaps someone relatively new to programming in general finds a neat website dedicated to this great language he recently started learning and voices his wonder at the expressive power of high-level languages, apparently hoping to start a discussion he might learn from — and he gets downvoted to -10 or less because several of you miss the point entirely and mistake it as an opportunity to correct someone rather than teach him.

        Shame on you.

        -sauoq
        "My two cents aren't worth a dime.";
        

        P.S. The only truly ridiculous things in this thread, IMHO, are the responses that seemingly take up arms to defend C's isomorphism to Perl, which is both obtuse in the context of the original post and redundant because perl is written in C.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://301254]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-18 19:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found