Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

What to study alongside C?

2»

Comments

  • Registered Users Posts: 2,003 ✭✭✭Colonel Panic


    I'm well versed on the FAQ and FQA, but good call posting that link!

    I use a subset of the language and always know the price of what I use.


  • Registered Users Posts: 40,055 ✭✭✭✭Sparks


    I use a subset of the language
    One of the funniest things about C++ is that everyone does that... and they all use slightly different subsets.
    /headdesk


  • Registered Users Posts: 2,003 ✭✭✭Colonel Panic


    Yeah by my subset is the best!


  • Registered Users Posts: 2,912 ✭✭✭pog it


    oscarBravo wrote: »
    If someone can give me an example of how they'd like to write Python code and how it won't let them do it, I'd appreciate it.

    What's off-putting about it from the pov of beginner is that it is another thing to worry about on top of getting the code right.
    It may well teach good practice.
    But just because someone doesn't want to be forced to indent in an exact way does not mean they don't want to indent at all. Of course indentation is necessary to read and review your own code, even if it's a tiny program.
    No beginner would want it all starting at the start of the line as in your rather extreme example! :)


  • Registered Users Posts: 2,912 ✭✭✭pog it


    Sparks wrote: »
    The indentation is something that you very quickly forget about with Python to be honest. Most editors will handle it for you anyway.

    Nice one, hadn't realised this. Well I am just starting with Ruby and after a week of it I'll give Python the same amount of time and just go with one of em!
    Thanks for your help!


  • Advertisement
  • Registered Users Posts: 2,912 ✭✭✭pog it


    fergalr wrote: »
    I find that when someone is learning the program, the most important thing is not how hard the syntax is - its how 'consistent' the abstractions the person has to learn are. What kills a learners momentum is when something isn't working the way they expect, and they just can't figure out why. Because the abstraction that they learned is leaking.
    And I'd just be concerned that ruby (or more correctly, ruby as currently written, and in libraries etc.) would do that more than python.


    Will take your advice on this.


    Don't write yourself off. Like, seriously. If you are still interested in this stuff, you are probably properly interested.

    I remember you from that thread too and you were really helpful! I think I asked about copying and pasting as a way to start to learn. Can't believe that I even considered that! :)

    Anyway thanks again for the help, should be exciting few months ahead. Am only doing it about 10 - 20 hours a week though so it will be slow progress.


  • Technology & Internet Moderators Posts: 28,780 Mod ✭✭✭✭oscarBravo


    pog it wrote: »
    But just because someone doesn't want to be forced to indent in an exact way does not mean they don't want to indent at all.
    There's nothing in Python that requires you to indent in an exact way, other than the requirement that all the lines in a logical code block have the same amount of whitespace at the start. The following is legal (if fugly) Python code:
    if a > b:
     c = a
    else:
           c = b
    
    So, the only actual requirement is consistent indentation within a code block, and the only argument that I can see against the requirement for consistent indentation within a block is a desire to use inconsistent indentation, and I still don't understand why that's a problem.


  • Registered Users Posts: 2,912 ✭✭✭pog it


    Okay, got it.

    Is there any disadvantage to learning python over ruby? In terms of what you can do to make a website that can handle things like registering users, users' portal and profile, an area to pay for services, a forum (as a side thing: not the main raison d'etre of the website), and other things like users interacting with another, and so on?


  • Registered Users Posts: 2,003 ✭✭✭Colonel Panic


    Nah, there's no limitations like that. All scripting languages do in this situation is handle incoming web requests and spit out dynamically generated responses. The rest is up to you and the assorted web framework libraries developed for each language.


  • Technology & Internet Moderators Posts: 28,780 Mod ✭✭✭✭oscarBravo


    Much of our business software is written from scratch in Python. It started as a billing application, and expanded to include various CRM functions, ticket tracking, resource allocation and some network monitoring. I don't think you need worry too much about limitations.


  • Advertisement
  • Registered Users Posts: 1,931 ✭✭✭PrzemoF


    Sparks wrote: »
    The stream operators are only the smallest, tiniest, least inconvenient piece of C++'s evil.
    Try reading the FQA sometime...
    This is great:
    "Empirical studies indicate that 20% of the people drink 80% of the beer. With C++ developers, the rule is that 80% of the developers understand at most 20% of the language. It is not the same 20% for different people, so don't count on them to understand each other's code."

    I think it was good (and lucky) decision that I decided to avoid learning c++ (I'm not working as a paid developer) :D


  • Registered Users Posts: 1,922 ✭✭✭fergalr


    PrzemoF wrote: »
    This is great:
    "Empirical studies indicate that 20% of the people drink 80% of the beer. With C++ developers, the rule is that 80% of the developers understand at most 20% of the language. It is not the same 20% for different people, so don't count on them to understand each other's code."

    I think it was good (and lucky) decision that I decided to avoid learning c++ (I'm not working as a paid developer) :D

    I've mixed feelings about C++.
    I agree its not necessary for a lot of people to learn; but I wouldn't say its lucky to avoid learning it as such.

    Its possible to create an awful mess with C++, if you aren't using standards, or different people are using different styles/techniques in the same codebase. (Check out Google's C++ coding standard btw.)

    And also, when people really get into complex uses of templates, it gets horrible.

    But, at the same time - I've just had several different projects I've worked on, where, at one point or another, I've just ended up having a moment of awe at what you can do with C++.

    You can do awful things with C++, and its a bit of an abomination from a design point of view. But its an extremely flexible language.

    If you need speed, or small memory footprint, the compilers are amazing and can get you there.

    It allows you to simultaneously have very tight, controlled code, but also have it embedded in a big, high-level-of-abstraction object hierarchy.

    If you need to do something really funky and dynamic, you can do that too.

    If you want to lock down an area of code a bit better, well, you can start putting const everywhere and go nuts with your use of the type system and use quite powerful compiler checking; you can do advanced template meta-programming; write towards really low level interfaces easily; etc.

    Its like that scene in Jackie Brown about the AK-47...

    Its not the language of the future; and its not exactly a more elegant weapon from a more civilised age; but I can see why its had the good run that its had, and I can see why its still fairly dominant in fields like games programming.


  • Registered Users Posts: 2,003 ✭✭✭Colonel Panic


    Namespaces, const correctness and using scope to manage memory and other resources are the three parts of C++ that I use quite heavily. Other than that, the C++ I write looks a lot like C.

    I agree with your post, although rumours of C++ outliving it's usefulness seem to pop up as often as PC gaming being "dead" but that's not going anywhere!

    Even when I write in other languages, there's always some C++ skulking about. My iOS stuff uses ObjectiveC for the UI only, my Python stuff uses SQLite with C++ extensions etc etc.

    It's definitely not always the right tool for the job, and the size and widespread use of it means that standards and features get added at a glacial pace (C++03 to C++11 via all sorts of stuff labelled C++0x for example...).


  • Registered Users Posts: 40,055 ✭✭✭✭Sparks


    fergalr wrote: »
    And also, when people really get into complex uses of templates, it gets horrible.
    I don't think you're describing it right. It's not so much horrible, as it is the most annoying, persnickity, fiddlly, scream-inducing pain in the hole you ever encounter with a debugger.

    (I've just spent waaaay too much time trying to chase after a bug that required me to get into a templated function via a function pointer from a templated class with the compiler merrily inlining all the time. I may be somewhat biased by reality).
    its an extremely flexible language.
    Because it's not finished and doesn't actually do anything...
    If you need speed, or small memory footprint
    ...then use C. At least you'll be able to debug it. Also, that's a really rare set of requirements these days...
    It allows you to simultaneously have very tight, controlled code, but also have it embedded in a big, high-level-of-abstraction object hierarchy.
    Which is pretty much the reason I've lost hair this week via gdb, so take the idea that that's a good thing and place it back where it came from for more careful consideration please :)
    If you need to do something really funky and dynamic, you can do that too.
    After a week's hard work, maybe, but you get it out of the box with other tools, so why bother?
    If you want to lock down an area of code a bit better, well, you can start putting const everywhere and go nuts with your use of the type system and use quite powerful compiler checking; you can do advanced template meta-programming; write towards really low level interfaces easily; etc.
    And it will still break in odd ways where you least expect it, as the FQA happily documents...
    Its not the language of the future; and its not exactly a more elegant weapon from a more civilised age; but I can see why its had the good run that its had, and I can see why its still fairly dominant in fields like games programming.
    Yes, it's called economics. C++ is the programming world's version of VHS - not as good as Betamax, but its owners had the better sales team so we're stuck with it. Though some of us have heard of this thing called "Dee Vee Dee"...


Advertisement