![]() |
|
programming background - Printable Version +- kanji koohii FORUM (http://forum.koohii.com) +-- Forum: Learning Japanese (http://forum.koohii.com/forum-4.html) +--- Forum: Off topic (http://forum.koohii.com/forum-13.html) +--- Thread: programming background (/thread-9929.html) Pages:
1
2
|
programming background - vix86 - 2013-02-16 On windows there are no hash-bangs, but you can usually look through the source code and try and find a print statement. If its Code: print "Hello World."But if its Code: print("Hello World.")The problem is that you can use a print() statement in Python 2 and it'll work, but I believe it'll throw an error if you try and do a print "hi" in Python 3. In my experience though, most programmers don't use print() in Python 2, possibly because its not very Pythonic. programming background - Oniichan - 2013-02-16 Thank you partner55083777 and vix86. I appreciate both the short (python 2) and long answers. I've decided to end my ignorance of basic programming since my experiences with turtle graphics and c64 basic in the 80s have only taken me so far. So today it's the rudiments of powershell and tomorrow python 2. programming background - dizmox - 2013-02-16 I read through most of http://www.amazon.com/Programming-Principles-Practice-Using-C/dp/0321543726/ref=sr_1_sc_1?ie=UTF8&qid=1360997884&sr=8-1-spell&keywords=introduction+to+programming+with+C%2B%2B+straustrup. I think C# is a lot easier to work with because of .NET but once you've learnt C++, C# is easy to figure out (whereas I imagine it'd be harder going from C# to C++). I don't really know any scripting languages. I've never actually created any great programs of my own except a 3D breakout game when I was learning DirectX. It's just a skill to help me find a job really (I should probably learn SQL for this but it's incredibly dull). programming background - vix86 - 2013-02-16 Going from "anything" to C++ would probably be difficult. Recently some people took a look at the complexity of the main 3-4 popular languages in use right now, and found that C++ was hands down one of the most complex languages. Most of this was determined by looking at how complex the compilers for each language are. Really though, C#/Python/Java/etc. Most of these languages would work well and you could easily transition from them into C/C++. The main thing you need to pick up is the concept of object oriented programming. The only thing you don't get by learning to program using a higher level language, is the understanding of how memory works. In particular, the concept of allocating memory and working with references to it, is abstracted out in higher languages. This is done rightly-so though, because these are often the areas which lead to problems (buffer overflows, memory leaks, etc.). But understanding "Pass By Reference" vs "Pass By Value" can be very difficult if you have never worked in C or C++ and have no understanding of pointers. programming background - dizmox - 2013-02-16 I think C++ is a good language to learn first precisely because of it's complexity - it introduces most of the important concepts. I think an understanding of how memory works is pretty essential. I like the book I linked because it teaches general guidelines for good programming instead of just getting the student to memorise syntax and technical features of that particular language. programming background - vix86 - 2013-02-16 dizmox Wrote:I think C++ is a good language to learn first precisely because of it's complexity - it introduces most of the important concepts. I think an understanding of how memory works is pretty essential.C++ was the second language that I learned and that was in high school. I think throwing people into a complex language like C++ off the bat could probably turn people off to programming pretty quickly. I know that people that learned programming the 70's and 80's cut their teeth on some very difficult languages and in some pretty unfriendly environments for learning, but there's really no need for that now. I think easing people into programming using higher level, more verbose langauges, is better these days. If people enjoy it, then I think its important to introduce them to C/C++. Most Comp Sci programs do that now. They start people on Java/Python, then introduce them to C/C++. In their OS class (if they take one), they'll usually get a dose of ASM programming then as well. Some programs also hit people with purely functional languages like Haskell too. programming background - undead_saif - 2013-02-16 partner55083777 Wrote:I'm not a programmer, but from what I know, that's not necessarily true.Hyperborea Wrote:Learning to program well takes a long time and learning to build bigger systems takes even longer and most programmers never really get good at that.This is so true, haha. It depends on, the programming language to learn (some are easier than others), the difficulty of the code to write (a calculator isn't as complex as a 3d game), and what you're planning to do (for example, modifying an open source code or using a very good library, isn't like writing a complete program from scratch). Zarxrax Wrote:Programming is pretty freaking hard, and its just like learning a foreign language in the sense of the amount of dedication it takes to become good at it. And just like with a foreign language, you have to enjoy doing things with it, or you probably aren't going to stick with it.Are you sure? Programming requires logical thinking, something similar to solving mathematical problems, but I wouldn't call that "pretty freaking hard", at worst case, a mimicking style would be sufficient. @OP I would like to add that it's not really necessary to be a profession programmer in order to write programs, an alternative path is to learn the basics of the language, jump to an simple example code related to what you're planning to do, learn from it, and consult the Internet and documentations when needed. Then try two write you own code. EDIT: BTW, anyone got the chance to use Assembly? I learned ASM for a RISC (PIC Microcontrollers), it's a very challenging language when writing a code for non-trivial things, but you get to know your hardware and how long your code will run EXACTLY! EDIT2: in bold (thanks vix86) programming background - chamcham - 2013-02-16 vix86 Wrote:C/C++ is a horrible language to learn first.dizmox Wrote:I think C++ is a good language to learn first precisely because of it's complexity - it introduces most of the important concepts. I think an understanding of how memory works is pretty essential.C++ was the second language that I learned and that was in high school. I think throwing people into a complex language like C++ off the bat could probably turn people off to programming pretty quickly. I know that people that learned programming the 70's and 80's cut their teeth on some very difficult languages and in some pretty unfriendly environments for learning, but there's really no need for that now. There are so many ways to shoot yourself in the foot. The complexity can get in the way of getting the job done. Especially, when you have no idea why you're getting core dumps, bus errors, or memory leaks. Yes, in theory, they should never happen if you do things right, but they do and are rather hard to debug at times, especially for a beginner. Learn an easier language first (like Python or Ruby) and get used to the workflow and design patterns of programming. Then, once you get that done move on to a more complex language like C++ to understand lower level details. programming background - vix86 - 2013-02-16 undead_saif Wrote:@OP I would like to add that it's really necessary to be a profession programmer in order to write programs, an alternative path is to learn the basics of the language, jump to an simple example code related to what you're planning to do, learn from it, and consult the Internet and documentations when needed. Then try two write you own code.This sounds like a bit of an exaggeration. Its true that many people learn a new language or API through example, but once you get familiar with the language/API/library, it becomes easier to create your own programs using it. You don't have to be some master programmer to write your own programs nor do you necessarily have to copy tons of code to create the program. But even professionals copy code, its the whole point of cookbooks really. programming background - undead_saif - 2013-02-16 vix86 Wrote:Ops! I miss typed, I meant "it's NOT really necessary to be a profession programmer in order to write programs,"undead_saif Wrote:@OP I would like to add that it's really necessary to be a profession programmer in order to write programs, an alternative path is to learn the basics of the language, jump to an simple example code related to what you're planning to do, learn from it, and consult the Internet and documentations when needed. Then try two write you own code.This sounds like a bit of an exaggeration. Its true that many people learn a new language or API through example, but once you get familiar with the language/API/library, it becomes easier to create your own programs using it. You don't have to be some master programmer to write your own programs nor do you necessarily have to copy tons of code to create the program. Sorry! And yes, that was what I was kind of trying to say. programming background - oefirouz - 2013-02-16 chamcham Wrote:I understand I may be unique here, but I struggled to learn how to program with python, and succeeded when I used C.vix86 Wrote:C/C++ is a horrible language to learn first.dizmox Wrote:I think C++ is a good language to learn first precisely because of it's complexity - it introduces most of the important concepts. I think an understanding of how memory works is pretty essential.C++ was the second language that I learned and that was in high school. I think throwing people into a complex language like C++ off the bat could probably turn people off to programming pretty quickly. I know that people that learned programming the 70's and 80's cut their teeth on some very difficult languages and in some pretty unfriendly environments for learning, but there's really no need for that now. C is much more logical if you understand how computers work. There's a lot of magic going on behind the scenes in python, less so in C. Things like pointers came very naturally. Things like dictionaries, sets, iterables, lists, etc don't really make much sense until you understand what's going on behind the scenes. Anyway, those are my 2 cents. Try python and C first. My only experience with Ruby has been writing Obj Oriented code, and I wouldn't recommend a beginner start with an Obj Oriented approach. And I agree C++ is a bad idea first. programming background - dizmox - 2013-02-16 Not saying it's the best to start with (this would surely depend on your goals) but I think the difficulties of C++ are being a little exaggerated. True, there are lots of advanced features can run into problems, but you don't have to use them. You can even use it like C if you want. Just an awareness of the most important ones (ie. not template metaprogramming) is important I think. I quite enjoyed going through the book I linked, and I was pretty much a beginner at the time. There was never really any moment of real difficulty, except for maybe figuring out callbacks (function pointers). To be honest I found that in the early stages grappling with Visual Studio or your IDE of choice is the biggest source of frustration for any language. At least with the code you can just copy from the textbook and it'll work. programming background - Inny Jan - 2013-02-16 Difficulty in learning C/C++ is of different kind than difficulty in learning Python. Python comes with a rich library of utilities (strings, regular expressions, lists, etc.) which are simply not present in pure vanilla C. C++ improves a bit on that but getting to know STL before having a good grasp of the language is not a good idea. In Python you learn how to handle, using an easy syntax, the richness that is already there, whereas in C/C++, before you are able to do anything useful, you need to learn how to handle memory so there are no memory leaks, what to do so you don't dereference null pointers, what is this virtual destructor, and so on. And all this with syntax that is full of gotchas. (Like for example, why this declaration Code: std::vector<std::pair<int, int>> pairs;programming background - Stansfield123 - 2013-02-17 While the choice of language matters, the real key is in picking WHAT one learns first, not what language one learns it in. In college, they usually start you out with a course called "Algorithms", or something similar (might have "basic", "data structures", etc. in the title - or, alternatively, it might be titled "And now we worship Donald Knuth as God and study TAOCP as our new Bible" http://en.wikipedia.org/wiki/Donald_Knuth ), and another course on Assembly. And "Algorithms" (which is about basic methods and data structures used in programming) can easily be taught using C or C++ (though my college used Borland Pascal for some weird reason). But, of course, you wouldn't be using the full power of C++, you'd be using the basic syntax, to learn material that isn't language specific. This course will eventually be followed by a course dedicated to C++, which comes after Assembly and possibly C are completed. programming background - vix86 - 2013-02-17 Classes entirely on ASM have fallen out of vogue in recent years. I've looked at a number of university course lists and they don't teach it as a singular course any more. You get some exposure to it in "Operating Systems" and there may even be a project in some classes to build a rudimentary OS, as an application of theory. But even in these instances ASM only takes up a small fraction of the course. programming background - Javizy - 2013-02-17 Stansfield123 Wrote:While the choice of language matters, the real key is in picking WHAT one learns first, not what language one learns it in. In college, they usually start you out with a course called "Algorithms", or something similar (might have "basic", "data structures", etc. in the title - or, alternatively, it might be titled "And now we worship Donald Knuth as God and study TAOCP as our new Bible" http://en.wikipedia.org/wiki/Donald_Knuth ), and another course on Assembly.You can actually take Princeton's algorithms course free online here. Some of the assignments are pretty interesting, and it could be quite motivating, depending on the OP's goals, but you definitely need a CS101 background to keep up with the coding. I think some people take it in their second year. I think the CS101 course on Udacity I mentioned is a good starting point, because it teaches all the basics like variables, functions, scope, flow control, basic data structures, recursion etc, and it's all in Python with auto-graded quizzes/assignments. Plus, you get to understand a (little) bit about how Google's page ranking system works by partly implementing a basic version over the course. programming background - overture2112 - 2013-02-17 undead_saif Wrote:EDIT: BTW, anyone got the chance to use Assembly? I learned ASM for a RISC (PIC Microcontrollers), it's a very challenging language when writing a code for non-trivial things, but you get to know your hardware and how long your code will run EXACTLY!Doing toy stuff with MIPS in school was fun (eg. hand translating c++ code to gain a better understanding about vtables and stuff, ai programming contest, etc) but I semi-regularly have to deal with x86 for work (writing compilers) which is a bit of a drag. Knowing how long your code will run *exactly* certainly stops applying once you're using superscalars with massive pipelines, branch prediction, etc
programming background - vix86 - 2013-02-17 Hyperborea Wrote:Honestly though, I think C++'s time is almost over. It's overly complex (if it has one way to do something you are guaranteed to find that it has 6 other ways to do it too), it has no safety net, it takes longer to write code in it, that code has more bugs, it's harder to debug, etc. Not to say that there won't still be code in the language or some new code won't still be written in it but that the bulk of development focus is moving elsewhere. This is from somebody who started to write code in C++ in 1989 when it was still just a preprocessor generating C code.C/C++ is never going away. It may fall more and more out of the lime light for application development but it will always have a place. C is the closet you can get to working with the computer without a lot between you and the compiler; and without having to work in ASM. C++ is a bit further removed but its still effectively working with the computer at about the same level as C, but its much better on watching type-casting. Quote:On assembly, I agree that it has fallen very far from use. It's become really quite difficult for a human to write good assembly with today's processors.This is really what killed assembly. The operator code base has grown frighteningly large (looking at you x86/amd64 with your backwards comparability) and the number of registers has grown with it. Also, since most of the things you want to do with a computer these days require calls to APIs and libraries, it becomes unfeasible to use ASM as you would be spending most of your time loading libraries and pushing data for calls and little time actually doing what you want. Device drivers and optimizing graphics routines are about the extent of it and as you said; most drivers are written in C these days. Between compilers and Boost libraries, code is already optimized far better than most of us could ever hope to do. programming background - chamcham - 2013-02-18 No C/C++ will never go away, but the market will shrink. C is very good for embedded systems programming where you need low level access, but don't want to go down to assembly programming. C++ is a speed demon, even if it's very complex. Google Chrome is written in C++. And stock trading software is often written in C++. Also, C/C++ is good for algorithms. So you might have Python code that glues everything together, but for the core algorithms that really needs to go fast, you can write them in C/C++. Lastly, with the Microsoft Surface tablet, apps can be written in C#,C++, and Javascript/HTML5/CSS. So for the people that want to rewrite their C#/C++ application as a Surface app, they can leave their core code intact. In a way, I'm a bit afraid to see tablet apps written in C++. Unless you're awesome at C++, the code will be quite buggy. You have to be a really good programmer to make stable C++ apps. It exposes a lot of low-level detail that can lead to increased speed, but it can be a double edged sword. For the computer science geek, C++ can be very fun and useful. But for Joe Schmoe "I'm just learning to program and don't know anything about computers", it's tough to recommend C++. In a perfect world, everything would be written in Haskell..... :-p |