Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Language transition.

  1. #1
    Join Date
    Jan 2006
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Language transition.

    Every time someone new to programming (who is interested in it) comes along and asks where to start. Of course, we start a flamewar of which language is best for beginners.

    In this thread I would like to propose that we look at transitioning between two languages that are completely different in one particular feature set, memory management.

    Personally, I think that C is a good starting language because it abstracts the system away a little bit but not enough where there is no machine (like Haskel, Scheme and some others do).

    Those advocating that the beginner should start from a scripting programming language (Python, Perl, Ruby are the big 3 in this category). Once the beginner decides that he needs/wants to learn a language where there is no automatic memory management. How is that person supposed to learn to manage memory without getting fed up with C or C++ and just use the first language (s)he learned?

    As for going from having to do memory management to it being automagic, I see this as a much simpler step as memory management becomes "one less thing to worry about."
    I am infallible, you should know that by now.
    "My favorite language is call STAR. It's extremely concise. It has exactly one verb '*', which does exactly what I want at the moment." --Larry Wall
    (02:15:31 PM) ***TimToady and snake oil go way back...
    42 lines of Perl - SHI - Home Site

  2. #2
    Join Date
    Aug 2006
    Location
    60°27'48"N 24°48'18"E
    Beans
    3,458

    Re: Language transition.

    Quote Originally Posted by slavik View Post
    Of course, we start a flamewar of which language is best for beginners.
    Of course we do. That's what we're here for

    Personally, I think that C is a good starting language because it abstracts the system away a little bit but not enough where there is no machine (like Haskel, Scheme and some others do).
    Depends a bit on how you want to look at it. In Scheme you need to be machine-ishly mindful of your environments at least when you start using set!... but personally I think Scheme is a great tool at teaching computational abstraction from the starting point of the concept of computation as mathematical function evaluation. But of course I digress here...

    How is that person supposed to learn to manage memory without getting fed up with C or C++ and just use the first language (s)he learned?
    By learning it. Seriously, malloc/free are just two more functions, there's nothing magical about them. Then you just need the concepts of stack and heap and there you go.

    If the person is fed up enough to use the original language, good for him. He'll come back when he genuinely needs to manage his memory.

    I don't code to manage memory. I code to get something done, and manage memory if I must.

    I see this as a much simpler step as memory management becomes "one less thing to worry about."
    ... until the person got fed up of trying to learn to program because of memory management and segfaults before he got to that point.

    I don't understand this "max immediate pain is good for you so you'll know how bad a place the world is, son... now go get the paddle" mentality.
    LambdaGrok. | #ubuntu-programming on FreeNode

  3. #3
    Join Date
    Sep 2006
    Beans
    2,914

    Re: Language transition.

    why start this thread at all?

  4. #4
    Join Date
    Aug 2006
    Location
    60°27'48"N 24°48'18"E
    Beans
    3,458

    Re: Language transition.

    Because that's what we do, have flamewars on what sort of languages n00bs should start with. Duh. It's half the fun
    LambdaGrok. | #ubuntu-programming on FreeNode

  5. #5
    Join Date
    Apr 2007
    Beans
    14,781

    Re: Language transition.

    I try to avoid flame wars, but usually recommend Python and C, in that order.

    I am highly tempted to say "Start with C", but do not because of several issues. The first one is speed. Learning basic programming concepts with Python is much easier. You can use variables, conditions, loops, functions, and other universal concepts without worrying exactly what a "string" is to a processor.

    One can start with Python, write trivial example programs until they understand the concepts, then they can (and should) get closer to the machine.

    C is perfect for this. It is a very useful and widely used language, and requires a bit more thought of how programs actualy work.

    As for the GC of Python, that is a very good point. Learning how to manage memory is a vital part of programming, however, it is not immediately rewarding. I doubt anyone understood what good pointers were at first, and malloc is even more confusing at first.

    No matter where one starts, one should strive to move on. Learning with training wheels (a GC) doesn't mean they will rely on it forever, and are incapable of learning otherwise.

    C never really made sense to me, until I studied assembly. Then it made perfect sense.

    I also found studying Lisp to make me a better programmer in other languages, because of the new paradigm involved.

    So for people setting out to learn, I highly recommend:

    * Python, to get up to speed quickly and not be disappointed
    * C, to understand what is going on, and to know what power one can have
    * Lisp, to understand logic and to see imperative languages in a new light

    (Note the languages are not in stone, I could have said Perl, Assembly, and Haskell, the concept is the same)

  6. #6
    Join Date
    Dec 2007
    Location
    Ankara
    Beans
    41
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Language transition.

    C, then C++. I first learned actionscript and HTML. Then i learned C, and then C++. I'm head of the olimpiad team in my school, and I teach them only C (I'm thinking of teaching C++ too).

    I was trying to learn Visual Basic too, but VB isn't just my type. C++ is everything for me, i can do what i think. It has all i want. Nothing less, but a bit more. Brainf#$k seems cool too, i'll try to learn it sometime, just for fun.

    By the way, Assembly should be learned. I'm thinking of learning it to do some calculations faster, but it doesn't seem easy And it shouldn't be the first language to learn.

  7. #7
    Join Date
    Apr 2007
    Beans
    14,781

    Re: Language transition.

    Quote Originally Posted by revanthedarth View Post
    By the way, Assembly should be learned. I'm thinking of learning it to do some calculations faster, but it doesn't seem easy And it shouldn't be the first language to learn.
    If you don't know it, giving advice on it can be tricky.

    It isn't difficult, and some think it should be the first language. I think that is only true if that person is already knowledgable about the inner workings of the hardware.

    My wiki has a section on it, and a forum member here wrote a good tutorial (if incomplete) tutorial for it.

  8. #8
    Join Date
    Aug 2006
    Location
    60°27'48"N 24°48'18"E
    Beans
    3,458

    Re: Language transition.

    Quote Originally Posted by revanthedarth View Post
    I'm head of the olimpiad team in my school, and I teach them only C (I'm thinking of teaching C++ too).
    Why?

    Testing solutions to problems is so much quicker on something else. I like checking out different algorithms, and fast prototyping is so much more convenient on higher-level languages... and as algorithm choice dominates running time almost always, you even get a pretty good idea of the efficiency differentials.

    If you're coaching other people for some kind of a competition, it's problem solution skills they're mostly testing, not bit-pushing skills.

    C++ is everything for me, i can do what i think. It has all i want. Nothing less, but a bit more.
    Don't restrict your toolset like that... they're all Turing-complete, but some languages are a better choice sometimes than others.

    By the way, Assembly should be learned. I'm thinking of learning it to do some calculations faster, but it doesn't seem easy
    Assembly is actually quite easy. It's probably worth "learning" up to the point that you know what it looks like and why it looks like the way it does, but modern compilers beat you most of the time in actually producing code, so you'd be hard pressed to come up with anything faster, unless it's some really specific trick with some particular fancy instruction.
    LambdaGrok. | #ubuntu-programming on FreeNode

  9. #9
    Join Date
    Dec 2007
    Location
    Ankara
    Beans
    41
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Language transition.

    Well, i have to use C actually, because in Turkey, we use C/C++ in olimpiads. But first step of the olimpiads aren't about a programming language at all. I don't know pascal, but i can solve pascal problems, it's like that. It's about loops. (But the second exam is about programming, just like IOI)

    And, pseudo-codes are easier to write, but if you want to make it a real code, you must be familiar with the language you use.

    Anyway, I'll try to learn Assembly, once I'm familiar with GLSL. Thanks for the support

    And, I know C++ more than any language. That's why i love C++. I'm not saying it's the best language and nothing can be better, but it's doing the trick.

    And, I'm teaching them combinations, permutations etc, all you need for the exam. But when i said "Only C", i meant no other languages.
    Last edited by revanthedarth; December 23rd, 2007 at 12:01 PM.

  10. #10
    Join Date
    Sep 2006
    Beans
    2,914

    Re: Language transition.

    @OP congrats, you started another worthless flame war.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •