|
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. |
On June 21 2012 08:32 billy5000 wrote:Show nested quote +On June 18 2012 14:15 sluggaslamoo wrote:On June 13 2012 08:23 RoyGBiv_13 wrote:On June 13 2012 08:10 mcc wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote:On June 12 2012 21:22 mcc wrote:On June 12 2012 20:50 stafu wrote: In my slightly biased opinion, learn C first, then C++. If you can learn C and C++ to a decent degree, everything else is easy. C is not the best first language really. I think the old way of Pascal->C->C++->whatever is still the best. You can replace Pascal with similarly clear not OOP language and you can replace C++ with Java/C# as they have better designed OOP aspects. Reason is that before learning OOP you should learn proper structural programming and OOP aspects of Java/C# just get in the way of achieving this goal. C is bad at this as it has a lot of "unnatural" quirks. So after you master basics of structural programming , you move to C to learn the whole pointer and memory management thing. After that OOP. C# may be more natural choice due to the previous step being C, but it does not really matter. I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Depends what you mean by not worth learning. Basically no language is worth learning in the long run just because of itself. Languages change and new ones emerge, the point of that succession was to hypothesize what is the best way to become a well rounded programmer. The point is not to learn the language, but to gain more general skills. Languages can be learned very quickly and in the process of learning are only as importnant as far as they help you to achieve that goal. Pascal is clear enough language, without too many quirks, so it fits the role of good language to teach basics of structural programming. Actually any modern practical language is probably bad for that role as they all need to support too many features that are not useful in learning process, but are crucial in practice. As for your progression, I think the lack of C/C++ is kind of a weakness. But more importantly why would you move from C# to Java (joking  ) and from Java to VB.Net (not joking  ). VB is work of the devil. Agree with this guy ^ Its been said a million times before, but worth repeating that there is no linear progression to these things, and there is no right way to learn programming. I learned off Pascal when I was 13, before I even know what a real program was or that there ever were other languages. It worked, because then when I saw C and Java, I at least knew how to run my own program. (Best skill to learn from C/Pascal is the ability to just run the damn thing, which is an often overlooked skill) I'd say that you should start with Python or Java though, because being able to do something out the gate is the best feeling. If you enjoy writing your own data structures, and coming up with awesome solutions, you'll end up picking up C/C++, whereas if you like the OOP parts of those languages, you'll move towards even higher level languages. Also, VB is the work of the devil. On June 13 2012 22:44 Tobberoth wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote:On June 12 2012 21:22 mcc wrote:On June 12 2012 20:50 stafu wrote: In my slightly biased opinion, learn C first, then C++. If you can learn C and C++ to a decent degree, everything else is easy. C is not the best first language really. I think the old way of Pascal->C->C++->whatever is still the best. You can replace Pascal with similarly clear not OOP language and you can replace C++ with Java/C# as they have better designed OOP aspects. Reason is that before learning OOP you should learn proper structural programming and OOP aspects of Java/C# just get in the way of achieving this goal. C is bad at this as it has a lot of "unnatural" quirks. So after you master basics of structural programming , you move to C to learn the whole pointer and memory management thing. After that OOP. C# may be more natural choice due to the previous step being C, but it does not really matter. I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Would I be better off starting with something like python? Whats your reasoning for that progression? Why not start with C# and then not learn the others? Do you have any need for any of those languages? I'd say that out of those languages, C# is probably the most useful one in a professional context, with Java in close second (but it depends on your area, java is used a lot more in many contexts) while the other two languages are not all that useful. VB.net is used by a lot of corporations but 1. It's extremely easy to learn if you know C# and 2. nowadays, .NET languages are interchanagble, so you could technically write your code in C# and then convert it to VB.net automagically. I agree, but there is an order in which you should learn paradigms which is why Pascal/C should be learned first, followed by Java/C#, followed by Javascript/Ruby/Lisp, followed by Haskell, etc.You should learn the paradigms in this order. Structured -> Object Oriented -> Imperative Functional -> Declarative Functional. Going backwards is far more difficult and you will learn a lot slower and develop bad habits. Learning them in the order mentioned above will ensure that you have the best chance of having stronger fundamentals when learning programming. For example, you need to know functional decomposition to do any language, but you only need to know object decomposition in OOP/FP. Learning Pascal first teaches functional decomposition because that's the primary skill required in structured programming. Functional decomposition can be (and should be) applied to Java, but with Java there is a bigger focus on object decomposition, which can't be applied to Pascal. The catch is that object decomposition is a lot harder when you don't understand functional decomposition and you end up coming up with some really awkward designs. There is nothing more frustrating than seeing objects decomposed without a second thought applied to functional decomposition, because the developer who coded it started with Java. So if you want to progress in the a way that ensures the best chance of being a solid programmer, you should follow the order mentioned above. Not everybody learned it this way, and I'm sure there's some experts out there that started with Haskell. But just from my own experience I think this is the best way. Just out of curiosity, what time frame am I looking at for the average programmer?
With a good enough education you can become better than 90% of programmers within a year. Spend a couple months on Pascal doing non-trivial stuff and learning how to properly do structured programming and use functional decomposition. Also learn dynamic memory allocation and pointers although not that important in this day and age, still nice to know how it all works.
Then spend 6 months doing Java, and learning how to properly do Object Orientation, learn the 4 concepts down to the core, Abstraction/Encapsulation/Inheritance/Polymorphism. Also it is very important to learn Responsibility Driven Design, its just as important as learning the four main concepts, because it will teach you the mindset on object decomposition and how objects should work together to achieve the desired goal.
Then spend a couple months on Ruby learning TDD and a different style of OO (look up Alan Kay and Smalltalk) and using some minor functional algorithms like inject/map/tap/etc, learning how monkey patching/open classes/mixins work, and a couple months on Haskell on functional programming. Then take your pick on what you enjoy most after that.
Knowing what it is you need to learn, knowing how to do things correctly, is key. Theory is much more important than practice in the beginning. Although you should be doing both all the time 
I've been a programmer since 9 years old, but 90% of what I know about programming was only in the last few years. I'm 22 now. All the prior years of programming before getting a formal education have really just helped with problem solving speed, but most of it was wasted time, because I didn't have internet, and nobody told me how to do things properly.
|
On June 22 2012 12:06 Azerbaijan wrote:Ok, I am new to programming as of about 3 weeks ago. I have decided to learn C first which has so far been extremely challenging but I'm really enjoying it. My Grandpa gave me a copy of "The C Programming Language" and I've been follwing the first chapter's examples and exercises and then experimenting with what I'm learning in my own simple programs. I made a pretty simple number guessing that I'm pretty proud of but I used the scanf function which I have sinced learned is not a good choice for serious programming because its inefficient and doesnt error check very well. So I've gotten to the part in my book that explains getchar and putchar and I'm having a problem with getting the example programs to run. + Show Spoiler +#include <stdio.h> #include <stdlib.h>
main() { double nc;
for (nc = 0; getchar() != EOF; ++nc) ; printf("%.0f\n", nc); }
Sorry I haven't been able to figure out how to post the code properly  Anyway if I'm reading that right the loop is checking how many characters I enter until it encounters a null and then should be printing its count. The program runs fine with the compiler not giving me any errors but it won't give me any output and I really don't know why. Im using code blocks to compile if that might be part of the issue. Anyone know what I am missing here?
EOF is not a newline. EOF is a special sequence as far as I know. If you run in Windows, I believe in Windows EOF is signaled by CTRL+Z in the command prompt. So to stop your loop, press CTRL+Z, not Enter, which is what I assume you pressed?
I have an opengl game that I made using glut. It runs fine for me, but if I move the .exe to another computer, the computer requires that I install glut. Is there a way for me to run the .exe without installing anything? Thanks.
|
On June 22 2012 12:45 Blisse wrote:Show nested quote +On June 22 2012 12:06 Azerbaijan wrote:Ok, I am new to programming as of about 3 weeks ago. I have decided to learn C first which has so far been extremely challenging but I'm really enjoying it. My Grandpa gave me a copy of "The C Programming Language" and I've been follwing the first chapter's examples and exercises and then experimenting with what I'm learning in my own simple programs. I made a pretty simple number guessing that I'm pretty proud of but I used the scanf function which I have sinced learned is not a good choice for serious programming because its inefficient and doesnt error check very well. So I've gotten to the part in my book that explains getchar and putchar and I'm having a problem with getting the example programs to run. + Show Spoiler +#include <stdio.h> #include <stdlib.h>
main() { double nc;
for (nc = 0; getchar() != EOF; ++nc) ; printf("%.0f\n", nc); }
Sorry I haven't been able to figure out how to post the code properly  Anyway if I'm reading that right the loop is checking how many characters I enter until it encounters a null and then should be printing its count. The program runs fine with the compiler not giving me any errors but it won't give me any output and I really don't know why. Im using code blocks to compile if that might be part of the issue. Anyone know what I am missing here? EOF is not a newline. EOF is a special sequence as far as I know. If you run in Windows, I believe in Windows EOF is signaled by CTRL+Z in the command prompt. So to stop your loop, press CTRL+Z, not Enter, which is what I assume you pressed? I have an opengl game that I made using glut. It runs fine for me, but if I move the .exe to another computer, the computer requires that I install glut. Is there a way for me to run the .exe without installing anything? Thanks.
Uhmm... Typically you'll only require the DLL (dynamic link library) when you're using windows. You should learn about the Portable Executable model for windows.
In windows, every executable "loads/injects" itself with a certain set of DLLs into its address space and it's necessary for the program to function properly. Note that almost all of these libraries are dynamically linked in your program except KERNEL32.DLL, which always gets loaded at the same address space. Your program is probably somehow linking with the glut DLL, which is why it's working on your machine and not others. A potential solution is to call the LoadLibraryA() function to load glut's DLL file into the address space of the program and go from there. Another solution is to figure out where your program is looking for the glut.dll when it tries to load it (of course, this is obfuscated from you in code) and include glut's DLL file along with your program and move it to that location.
If you want to be a TRUE baller, you do what's called embedding resources into the memory space of your program. You basically embed the DLL into your code as raw binary data, then spit it back out as a DLL once your program executes. That way, you can have a standalone EXE file that reconstructs the DLL as needed. You can check out this link if you want to take this route (I don't suggest it if you're new to programmig )
Link!
Here's a screenshot of OLLYDBG ( a kernel level debugger ) attached to Unreal Tournament's EXE module. Notice all the DLL's that are loaded like USER32, and the highlighted KERNEL32.
+ Show Spoiler +
Best of luck! Hope this helps.
|
On June 22 2012 12:42 sluggaslamoo wrote:Show nested quote +On June 21 2012 08:32 billy5000 wrote:On June 18 2012 14:15 sluggaslamoo wrote:On June 13 2012 08:23 RoyGBiv_13 wrote:On June 13 2012 08:10 mcc wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote:On June 12 2012 21:22 mcc wrote:On June 12 2012 20:50 stafu wrote: In my slightly biased opinion, learn C first, then C++. If you can learn C and C++ to a decent degree, everything else is easy. C is not the best first language really. I think the old way of Pascal->C->C++->whatever is still the best. You can replace Pascal with similarly clear not OOP language and you can replace C++ with Java/C# as they have better designed OOP aspects. Reason is that before learning OOP you should learn proper structural programming and OOP aspects of Java/C# just get in the way of achieving this goal. C is bad at this as it has a lot of "unnatural" quirks. So after you master basics of structural programming , you move to C to learn the whole pointer and memory management thing. After that OOP. C# may be more natural choice due to the previous step being C, but it does not really matter. I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Depends what you mean by not worth learning. Basically no language is worth learning in the long run just because of itself. Languages change and new ones emerge, the point of that succession was to hypothesize what is the best way to become a well rounded programmer. The point is not to learn the language, but to gain more general skills. Languages can be learned very quickly and in the process of learning are only as importnant as far as they help you to achieve that goal. Pascal is clear enough language, without too many quirks, so it fits the role of good language to teach basics of structural programming. Actually any modern practical language is probably bad for that role as they all need to support too many features that are not useful in learning process, but are crucial in practice. As for your progression, I think the lack of C/C++ is kind of a weakness. But more importantly why would you move from C# to Java (joking  ) and from Java to VB.Net (not joking  ). VB is work of the devil. Agree with this guy ^ Its been said a million times before, but worth repeating that there is no linear progression to these things, and there is no right way to learn programming. I learned off Pascal when I was 13, before I even know what a real program was or that there ever were other languages. It worked, because then when I saw C and Java, I at least knew how to run my own program. (Best skill to learn from C/Pascal is the ability to just run the damn thing, which is an often overlooked skill) I'd say that you should start with Python or Java though, because being able to do something out the gate is the best feeling. If you enjoy writing your own data structures, and coming up with awesome solutions, you'll end up picking up C/C++, whereas if you like the OOP parts of those languages, you'll move towards even higher level languages. Also, VB is the work of the devil. On June 13 2012 22:44 Tobberoth wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote:On June 12 2012 21:22 mcc wrote:On June 12 2012 20:50 stafu wrote: In my slightly biased opinion, learn C first, then C++. If you can learn C and C++ to a decent degree, everything else is easy. C is not the best first language really. I think the old way of Pascal->C->C++->whatever is still the best. You can replace Pascal with similarly clear not OOP language and you can replace C++ with Java/C# as they have better designed OOP aspects. Reason is that before learning OOP you should learn proper structural programming and OOP aspects of Java/C# just get in the way of achieving this goal. C is bad at this as it has a lot of "unnatural" quirks. So after you master basics of structural programming , you move to C to learn the whole pointer and memory management thing. After that OOP. C# may be more natural choice due to the previous step being C, but it does not really matter. I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Would I be better off starting with something like python? Whats your reasoning for that progression? Why not start with C# and then not learn the others? Do you have any need for any of those languages? I'd say that out of those languages, C# is probably the most useful one in a professional context, with Java in close second (but it depends on your area, java is used a lot more in many contexts) while the other two languages are not all that useful. VB.net is used by a lot of corporations but 1. It's extremely easy to learn if you know C# and 2. nowadays, .NET languages are interchanagble, so you could technically write your code in C# and then convert it to VB.net automagically. I agree, but there is an order in which you should learn paradigms which is why Pascal/C should be learned first, followed by Java/C#, followed by Javascript/Ruby/Lisp, followed by Haskell, etc.You should learn the paradigms in this order. Structured -> Object Oriented -> Imperative Functional -> Declarative Functional. Going backwards is far more difficult and you will learn a lot slower and develop bad habits. Learning them in the order mentioned above will ensure that you have the best chance of having stronger fundamentals when learning programming. For example, you need to know functional decomposition to do any language, but you only need to know object decomposition in OOP/FP. Learning Pascal first teaches functional decomposition because that's the primary skill required in structured programming. Functional decomposition can be (and should be) applied to Java, but with Java there is a bigger focus on object decomposition, which can't be applied to Pascal. The catch is that object decomposition is a lot harder when you don't understand functional decomposition and you end up coming up with some really awkward designs. There is nothing more frustrating than seeing objects decomposed without a second thought applied to functional decomposition, because the developer who coded it started with Java. So if you want to progress in the a way that ensures the best chance of being a solid programmer, you should follow the order mentioned above. Not everybody learned it this way, and I'm sure there's some experts out there that started with Haskell. But just from my own experience I think this is the best way. Just out of curiosity, what time frame am I looking at for the average programmer? With a good enough education you can become better than 90% of programmers within a year. Spend a couple months on Pascal doing non-trivial stuff and learning how to properly do structured programming and use functional decomposition. Also learn dynamic memory allocation and pointers although not that important in this day and age, still nice to know how it all works. Then spend 6 months doing Java, and learning how to properly do Object Orientation, learn the 4 concepts down to the core, Abstraction/Encapsulation/Inheritance/Polymorphism. Also it is very important to learn Responsibility Driven Design, its just as important as learning the four main concepts, because it will teach you the mindset on object decomposition and how objects should work together to achieve the desired goal. Then spend a couple months on Ruby learning TDD and a different style of OO (look up Alan Kay and Smalltalk) and using some minor functional algorithms like inject/map/tap/etc, learning how monkey patching/open classes/mixins work, and a couple months on Haskell on functional programming. Then take your pick on what you enjoy most after that. Knowing what it is you need to learn, knowing how to do things correctly, is key. Theory is much more important than practice in the beginning. Although you should be doing both all the time  I've been a programmer since 9 years old, but 90% of what I know about programming was only in the last few years. I'm 22 now. All the prior years of programming before getting a formal education have really just helped with problem solving speed, but most of it was wasted time, because I didn't have internet, and nobody told me how to do things properly.
I too started when I was 9 years old and if you'd started on me with "functional decomposition" I'd have told you to bugger off-- I just wanted to make stick figures fight each other! I think that not putting the cart before the horse made me a better programmer, and possibly a better human. I learned how to think, not what to think.
XD
|
On June 22 2012 18:47 Mstring wrote:Show nested quote +On June 22 2012 12:42 sluggaslamoo wrote:On June 21 2012 08:32 billy5000 wrote:On June 18 2012 14:15 sluggaslamoo wrote:On June 13 2012 08:23 RoyGBiv_13 wrote:On June 13 2012 08:10 mcc wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote:On June 12 2012 21:22 mcc wrote:On June 12 2012 20:50 stafu wrote: In my slightly biased opinion, learn C first, then C++. If you can learn C and C++ to a decent degree, everything else is easy. C is not the best first language really. I think the old way of Pascal->C->C++->whatever is still the best. You can replace Pascal with similarly clear not OOP language and you can replace C++ with Java/C# as they have better designed OOP aspects. Reason is that before learning OOP you should learn proper structural programming and OOP aspects of Java/C# just get in the way of achieving this goal. C is bad at this as it has a lot of "unnatural" quirks. So after you master basics of structural programming , you move to C to learn the whole pointer and memory management thing. After that OOP. C# may be more natural choice due to the previous step being C, but it does not really matter. I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Depends what you mean by not worth learning. Basically no language is worth learning in the long run just because of itself. Languages change and new ones emerge, the point of that succession was to hypothesize what is the best way to become a well rounded programmer. The point is not to learn the language, but to gain more general skills. Languages can be learned very quickly and in the process of learning are only as importnant as far as they help you to achieve that goal. Pascal is clear enough language, without too many quirks, so it fits the role of good language to teach basics of structural programming. Actually any modern practical language is probably bad for that role as they all need to support too many features that are not useful in learning process, but are crucial in practice. As for your progression, I think the lack of C/C++ is kind of a weakness. But more importantly why would you move from C# to Java (joking  ) and from Java to VB.Net (not joking  ). VB is work of the devil. Agree with this guy ^ Its been said a million times before, but worth repeating that there is no linear progression to these things, and there is no right way to learn programming. I learned off Pascal when I was 13, before I even know what a real program was or that there ever were other languages. It worked, because then when I saw C and Java, I at least knew how to run my own program. (Best skill to learn from C/Pascal is the ability to just run the damn thing, which is an often overlooked skill) I'd say that you should start with Python or Java though, because being able to do something out the gate is the best feeling. If you enjoy writing your own data structures, and coming up with awesome solutions, you'll end up picking up C/C++, whereas if you like the OOP parts of those languages, you'll move towards even higher level languages. Also, VB is the work of the devil. On June 13 2012 22:44 Tobberoth wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote:On June 12 2012 21:22 mcc wrote:On June 12 2012 20:50 stafu wrote: In my slightly biased opinion, learn C first, then C++. If you can learn C and C++ to a decent degree, everything else is easy. C is not the best first language really. I think the old way of Pascal->C->C++->whatever is still the best. You can replace Pascal with similarly clear not OOP language and you can replace C++ with Java/C# as they have better designed OOP aspects. Reason is that before learning OOP you should learn proper structural programming and OOP aspects of Java/C# just get in the way of achieving this goal. C is bad at this as it has a lot of "unnatural" quirks. So after you master basics of structural programming , you move to C to learn the whole pointer and memory management thing. After that OOP. C# may be more natural choice due to the previous step being C, but it does not really matter. I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Would I be better off starting with something like python? Whats your reasoning for that progression? Why not start with C# and then not learn the others? Do you have any need for any of those languages? I'd say that out of those languages, C# is probably the most useful one in a professional context, with Java in close second (but it depends on your area, java is used a lot more in many contexts) while the other two languages are not all that useful. VB.net is used by a lot of corporations but 1. It's extremely easy to learn if you know C# and 2. nowadays, .NET languages are interchanagble, so you could technically write your code in C# and then convert it to VB.net automagically. I agree, but there is an order in which you should learn paradigms which is why Pascal/C should be learned first, followed by Java/C#, followed by Javascript/Ruby/Lisp, followed by Haskell, etc.You should learn the paradigms in this order. Structured -> Object Oriented -> Imperative Functional -> Declarative Functional. Going backwards is far more difficult and you will learn a lot slower and develop bad habits. Learning them in the order mentioned above will ensure that you have the best chance of having stronger fundamentals when learning programming. For example, you need to know functional decomposition to do any language, but you only need to know object decomposition in OOP/FP. Learning Pascal first teaches functional decomposition because that's the primary skill required in structured programming. Functional decomposition can be (and should be) applied to Java, but with Java there is a bigger focus on object decomposition, which can't be applied to Pascal. The catch is that object decomposition is a lot harder when you don't understand functional decomposition and you end up coming up with some really awkward designs. There is nothing more frustrating than seeing objects decomposed without a second thought applied to functional decomposition, because the developer who coded it started with Java. So if you want to progress in the a way that ensures the best chance of being a solid programmer, you should follow the order mentioned above. Not everybody learned it this way, and I'm sure there's some experts out there that started with Haskell. But just from my own experience I think this is the best way. Just out of curiosity, what time frame am I looking at for the average programmer? With a good enough education you can become better than 90% of programmers within a year. Spend a couple months on Pascal doing non-trivial stuff and learning how to properly do structured programming and use functional decomposition. Also learn dynamic memory allocation and pointers although not that important in this day and age, still nice to know how it all works. Then spend 6 months doing Java, and learning how to properly do Object Orientation, learn the 4 concepts down to the core, Abstraction/Encapsulation/Inheritance/Polymorphism. Also it is very important to learn Responsibility Driven Design, its just as important as learning the four main concepts, because it will teach you the mindset on object decomposition and how objects should work together to achieve the desired goal. Then spend a couple months on Ruby learning TDD and a different style of OO (look up Alan Kay and Smalltalk) and using some minor functional algorithms like inject/map/tap/etc, learning how monkey patching/open classes/mixins work, and a couple months on Haskell on functional programming. Then take your pick on what you enjoy most after that. Knowing what it is you need to learn, knowing how to do things correctly, is key. Theory is much more important than practice in the beginning. Although you should be doing both all the time  I've been a programmer since 9 years old, but 90% of what I know about programming was only in the last few years. I'm 22 now. All the prior years of programming before getting a formal education have really just helped with problem solving speed, but most of it was wasted time, because I didn't have internet, and nobody told me how to do things properly. I too started when I was 9 years old and if you'd started on me with "functional decomposition" I'd have told you to bugger off-- I just wanted to make stick figures fight each other! I think that not putting the cart before the horse made me a better programmer, and possibly a better human. I learned how to think, not what to think. XD
That's true. But I don't think he has the capacity to waste 10 years before being professionally productive I wonder where I'd be if a future me went back in time and went "omfg what the hell are you doing to your code? ughhhh!"
You'd be surprised though at how many programmers don't even know how to write a function properly. You just see functions with hundreds of lines of spaghetti code, and the functions are called "one(), two(), three()" or something. And they are supposed to be professionals with years of experience.
|
On June 22 2012 18:47 Mstring wrote:Show nested quote +On June 22 2012 12:42 sluggaslamoo wrote:On June 21 2012 08:32 billy5000 wrote:On June 18 2012 14:15 sluggaslamoo wrote:On June 13 2012 08:23 RoyGBiv_13 wrote:On June 13 2012 08:10 mcc wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote:On June 12 2012 21:22 mcc wrote:On June 12 2012 20:50 stafu wrote: In my slightly biased opinion, learn C first, then C++. If you can learn C and C++ to a decent degree, everything else is easy. C is not the best first language really. I think the old way of Pascal->C->C++->whatever is still the best. You can replace Pascal with similarly clear not OOP language and you can replace C++ with Java/C# as they have better designed OOP aspects. Reason is that before learning OOP you should learn proper structural programming and OOP aspects of Java/C# just get in the way of achieving this goal. C is bad at this as it has a lot of "unnatural" quirks. So after you master basics of structural programming , you move to C to learn the whole pointer and memory management thing. After that OOP. C# may be more natural choice due to the previous step being C, but it does not really matter. I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Depends what you mean by not worth learning. Basically no language is worth learning in the long run just because of itself. Languages change and new ones emerge, the point of that succession was to hypothesize what is the best way to become a well rounded programmer. The point is not to learn the language, but to gain more general skills. Languages can be learned very quickly and in the process of learning are only as importnant as far as they help you to achieve that goal. Pascal is clear enough language, without too many quirks, so it fits the role of good language to teach basics of structural programming. Actually any modern practical language is probably bad for that role as they all need to support too many features that are not useful in learning process, but are crucial in practice. As for your progression, I think the lack of C/C++ is kind of a weakness. But more importantly why would you move from C# to Java (joking  ) and from Java to VB.Net (not joking  ). VB is work of the devil. Agree with this guy ^ Its been said a million times before, but worth repeating that there is no linear progression to these things, and there is no right way to learn programming. I learned off Pascal when I was 13, before I even know what a real program was or that there ever were other languages. It worked, because then when I saw C and Java, I at least knew how to run my own program. (Best skill to learn from C/Pascal is the ability to just run the damn thing, which is an often overlooked skill) I'd say that you should start with Python or Java though, because being able to do something out the gate is the best feeling. If you enjoy writing your own data structures, and coming up with awesome solutions, you'll end up picking up C/C++, whereas if you like the OOP parts of those languages, you'll move towards even higher level languages. Also, VB is the work of the devil. On June 13 2012 22:44 Tobberoth wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote:On June 12 2012 21:22 mcc wrote:On June 12 2012 20:50 stafu wrote: In my slightly biased opinion, learn C first, then C++. If you can learn C and C++ to a decent degree, everything else is easy. C is not the best first language really. I think the old way of Pascal->C->C++->whatever is still the best. You can replace Pascal with similarly clear not OOP language and you can replace C++ with Java/C# as they have better designed OOP aspects. Reason is that before learning OOP you should learn proper structural programming and OOP aspects of Java/C# just get in the way of achieving this goal. C is bad at this as it has a lot of "unnatural" quirks. So after you master basics of structural programming , you move to C to learn the whole pointer and memory management thing. After that OOP. C# may be more natural choice due to the previous step being C, but it does not really matter. I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Would I be better off starting with something like python? Whats your reasoning for that progression? Why not start with C# and then not learn the others? Do you have any need for any of those languages? I'd say that out of those languages, C# is probably the most useful one in a professional context, with Java in close second (but it depends on your area, java is used a lot more in many contexts) while the other two languages are not all that useful. VB.net is used by a lot of corporations but 1. It's extremely easy to learn if you know C# and 2. nowadays, .NET languages are interchanagble, so you could technically write your code in C# and then convert it to VB.net automagically. I agree, but there is an order in which you should learn paradigms which is why Pascal/C should be learned first, followed by Java/C#, followed by Javascript/Ruby/Lisp, followed by Haskell, etc.You should learn the paradigms in this order. Structured -> Object Oriented -> Imperative Functional -> Declarative Functional. Going backwards is far more difficult and you will learn a lot slower and develop bad habits. Learning them in the order mentioned above will ensure that you have the best chance of having stronger fundamentals when learning programming. For example, you need to know functional decomposition to do any language, but you only need to know object decomposition in OOP/FP. Learning Pascal first teaches functional decomposition because that's the primary skill required in structured programming. Functional decomposition can be (and should be) applied to Java, but with Java there is a bigger focus on object decomposition, which can't be applied to Pascal. The catch is that object decomposition is a lot harder when you don't understand functional decomposition and you end up coming up with some really awkward designs. There is nothing more frustrating than seeing objects decomposed without a second thought applied to functional decomposition, because the developer who coded it started with Java. So if you want to progress in the a way that ensures the best chance of being a solid programmer, you should follow the order mentioned above. Not everybody learned it this way, and I'm sure there's some experts out there that started with Haskell. But just from my own experience I think this is the best way. Just out of curiosity, what time frame am I looking at for the average programmer? With a good enough education you can become better than 90% of programmers within a year. Spend a couple months on Pascal doing non-trivial stuff and learning how to properly do structured programming and use functional decomposition. Also learn dynamic memory allocation and pointers although not that important in this day and age, still nice to know how it all works. Then spend 6 months doing Java, and learning how to properly do Object Orientation, learn the 4 concepts down to the core, Abstraction/Encapsulation/Inheritance/Polymorphism. Also it is very important to learn Responsibility Driven Design, its just as important as learning the four main concepts, because it will teach you the mindset on object decomposition and how objects should work together to achieve the desired goal. Then spend a couple months on Ruby learning TDD and a different style of OO (look up Alan Kay and Smalltalk) and using some minor functional algorithms like inject/map/tap/etc, learning how monkey patching/open classes/mixins work, and a couple months on Haskell on functional programming. Then take your pick on what you enjoy most after that. Knowing what it is you need to learn, knowing how to do things correctly, is key. Theory is much more important than practice in the beginning. Although you should be doing both all the time  I've been a programmer since 9 years old, but 90% of what I know about programming was only in the last few years. I'm 22 now. All the prior years of programming before getting a formal education have really just helped with problem solving speed, but most of it was wasted time, because I didn't have internet, and nobody told me how to do things properly. I too started when I was 9 years old and if you'd started on me with "functional decomposition" I'd have told you to bugger off-- I just wanted to make stick figures fight each other! I think that not putting the cart before the horse made me a better programmer, and possibly a better human. I learned how to think, not what to think. XD
I started programming when i was 8 by typing in C64 basic listings from some magazine and then playing around with values and such, now i'm 30, know 10-15 different programming languages (of course not including stuff like HTML)... and i still only know 1/10th of what i'd love to know about programming and 1/100th of what there is to learn about it.
As for learning programming, it's best to get an idea of what you want and then just implement it the easiest way you can find. It will be wrong, inefficient, unmaintainable and there will be a billion better ways to do it... but you started solving problems and that is what programming is about. Funny as it sounds, Programming is not about writing code, writing code is easy. Programming is about solving problems, solving problems is hard. You won't ever write perfect code but you will solve problems.
Every year i see the code i wrote a year ago and think "What idiot wrote that code? It's all bad, inefficient, messy and wrong... oh, that was me...".
Some important lessons i learned: 1. All assumptions will turn out wrong. 2. Don't use programming "tricks", write simple code even if it looks like it would be slow/inefficient/longer. 3. Don't be scared of using additional variables, reusing variables is BAD. If you happen to have a variable that does the same in the same scope you don't have enough functions/methods. 4. If you have a variable called tmp/$tmp/@tmp/%tmp, you are doing something wrong. 5. If you don't read books (those with paper) about programming voluntarily in your spare time, you are in the wrong job.
|
On June 22 2012 19:16 Morfildur wrote: 5. If you don't read books (those with paper) about programming voluntarily in your spare time, you are in the wrong job.
Maybe this explains why I'm not "professionally productive" XD XD
|
On June 22 2012 12:42 sluggaslamoo wrote:Show nested quote +On June 21 2012 08:32 billy5000 wrote:On June 18 2012 14:15 sluggaslamoo wrote:On June 13 2012 08:23 RoyGBiv_13 wrote:On June 13 2012 08:10 mcc wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote:On June 12 2012 21:22 mcc wrote:On June 12 2012 20:50 stafu wrote: In my slightly biased opinion, learn C first, then C++. If you can learn C and C++ to a decent degree, everything else is easy. C is not the best first language really. I think the old way of Pascal->C->C++->whatever is still the best. You can replace Pascal with similarly clear not OOP language and you can replace C++ with Java/C# as they have better designed OOP aspects. Reason is that before learning OOP you should learn proper structural programming and OOP aspects of Java/C# just get in the way of achieving this goal. C is bad at this as it has a lot of "unnatural" quirks. So after you master basics of structural programming , you move to C to learn the whole pointer and memory management thing. After that OOP. C# may be more natural choice due to the previous step being C, but it does not really matter. I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Depends what you mean by not worth learning. Basically no language is worth learning in the long run just because of itself. Languages change and new ones emerge, the point of that succession was to hypothesize what is the best way to become a well rounded programmer. The point is not to learn the language, but to gain more general skills. Languages can be learned very quickly and in the process of learning are only as importnant as far as they help you to achieve that goal. Pascal is clear enough language, without too many quirks, so it fits the role of good language to teach basics of structural programming. Actually any modern practical language is probably bad for that role as they all need to support too many features that are not useful in learning process, but are crucial in practice. As for your progression, I think the lack of C/C++ is kind of a weakness. But more importantly why would you move from C# to Java (joking  ) and from Java to VB.Net (not joking  ). VB is work of the devil. Agree with this guy ^ Its been said a million times before, but worth repeating that there is no linear progression to these things, and there is no right way to learn programming. I learned off Pascal when I was 13, before I even know what a real program was or that there ever were other languages. It worked, because then when I saw C and Java, I at least knew how to run my own program. (Best skill to learn from C/Pascal is the ability to just run the damn thing, which is an often overlooked skill) I'd say that you should start with Python or Java though, because being able to do something out the gate is the best feeling. If you enjoy writing your own data structures, and coming up with awesome solutions, you'll end up picking up C/C++, whereas if you like the OOP parts of those languages, you'll move towards even higher level languages. Also, VB is the work of the devil. On June 13 2012 22:44 Tobberoth wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote:On June 12 2012 21:22 mcc wrote:On June 12 2012 20:50 stafu wrote: In my slightly biased opinion, learn C first, then C++. If you can learn C and C++ to a decent degree, everything else is easy. C is not the best first language really. I think the old way of Pascal->C->C++->whatever is still the best. You can replace Pascal with similarly clear not OOP language and you can replace C++ with Java/C# as they have better designed OOP aspects. Reason is that before learning OOP you should learn proper structural programming and OOP aspects of Java/C# just get in the way of achieving this goal. C is bad at this as it has a lot of "unnatural" quirks. So after you master basics of structural programming , you move to C to learn the whole pointer and memory management thing. After that OOP. C# may be more natural choice due to the previous step being C, but it does not really matter. I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Would I be better off starting with something like python? Whats your reasoning for that progression? Why not start with C# and then not learn the others? Do you have any need for any of those languages? I'd say that out of those languages, C# is probably the most useful one in a professional context, with Java in close second (but it depends on your area, java is used a lot more in many contexts) while the other two languages are not all that useful. VB.net is used by a lot of corporations but 1. It's extremely easy to learn if you know C# and 2. nowadays, .NET languages are interchanagble, so you could technically write your code in C# and then convert it to VB.net automagically. I agree, but there is an order in which you should learn paradigms which is why Pascal/C should be learned first, followed by Java/C#, followed by Javascript/Ruby/Lisp, followed by Haskell, etc.You should learn the paradigms in this order. Structured -> Object Oriented -> Imperative Functional -> Declarative Functional. Going backwards is far more difficult and you will learn a lot slower and develop bad habits. Learning them in the order mentioned above will ensure that you have the best chance of having stronger fundamentals when learning programming. For example, you need to know functional decomposition to do any language, but you only need to know object decomposition in OOP/FP. Learning Pascal first teaches functional decomposition because that's the primary skill required in structured programming. Functional decomposition can be (and should be) applied to Java, but with Java there is a bigger focus on object decomposition, which can't be applied to Pascal. The catch is that object decomposition is a lot harder when you don't understand functional decomposition and you end up coming up with some really awkward designs. There is nothing more frustrating than seeing objects decomposed without a second thought applied to functional decomposition, because the developer who coded it started with Java. So if you want to progress in the a way that ensures the best chance of being a solid programmer, you should follow the order mentioned above. Not everybody learned it this way, and I'm sure there's some experts out there that started with Haskell. But just from my own experience I think this is the best way. Just out of curiosity, what time frame am I looking at for the average programmer? With a good enough education you can become better than 90% of programmers within a year. Spend a couple months on Pascal doing non-trivial stuff and learning how to properly do structured programming and use functional decomposition. Also learn dynamic memory allocation and pointers although not that important in this day and age, still nice to know how it all works. Then spend 6 months doing Java, and learning how to properly do Object Orientation, learn the 4 concepts down to the core, Abstraction/Encapsulation/Inheritance/Polymorphism. Also it is very important to learn Responsibility Driven Design, its just as important as learning the four main concepts, because it will teach you the mindset on object decomposition and how objects should work together to achieve the desired goal. Then spend a couple months on Ruby learning TDD and a different style of OO (look up Alan Kay and Smalltalk) and using some minor functional algorithms like inject/map/tap/etc, learning how monkey patching/open classes/mixins work, and a couple months on Haskell on functional programming. Then take your pick on what you enjoy most after that. Knowing what it is you need to learn, knowing how to do things correctly, is key. Theory is much more important than practice in the beginning. Although you should be doing both all the time  I've been a programmer since 9 years old, but 90% of what I know about programming was only in the last few years. I'm 22 now. All the prior years of programming before getting a formal education have really just helped with problem solving speed, but most of it was wasted time, because I didn't have internet, and nobody told me how to do things properly.
Hey just to make things clear, my book says object-oriented programming have only three key principles which are encapsulation, specialization and polymorphism.
I think that you are saying sounds very correct, if not even more specified, but what is true and not? Can I still go after what my book says? The book is from 2010-11-30 so maybe that you are saying is the more updated ground principles.
|
On June 22 2012 19:31 Mstring wrote:Show nested quote +On June 22 2012 19:16 Morfildur wrote: 5. If you don't read books (those with paper) about programming voluntarily in your spare time, you are in the wrong job.
Maybe this explains why I'm not "professionally productive" XD XD
I've seen a few dozen of the "i don't like to read programming books" types in my professional life and they can do an ok job, but they never get past the "mediocre programmer" level because they don't like learning and in the still rapidly evolving world of programming, learning is what makes the difference between good and great.
Sadly the programming library i started in this company is mostly unused which might be the reason why the code quality is usually beyond bad :-/ You only get blank stares when you mention testcases and such...
|
On June 22 2012 19:37 Moxi wrote:Show nested quote +On June 22 2012 12:42 sluggaslamoo wrote:On June 21 2012 08:32 billy5000 wrote:On June 18 2012 14:15 sluggaslamoo wrote:On June 13 2012 08:23 RoyGBiv_13 wrote:On June 13 2012 08:10 mcc wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote:On June 12 2012 21:22 mcc wrote:On June 12 2012 20:50 stafu wrote: In my slightly biased opinion, learn C first, then C++. If you can learn C and C++ to a decent degree, everything else is easy. C is not the best first language really. I think the old way of Pascal->C->C++->whatever is still the best. You can replace Pascal with similarly clear not OOP language and you can replace C++ with Java/C# as they have better designed OOP aspects. Reason is that before learning OOP you should learn proper structural programming and OOP aspects of Java/C# just get in the way of achieving this goal. C is bad at this as it has a lot of "unnatural" quirks. So after you master basics of structural programming , you move to C to learn the whole pointer and memory management thing. After that OOP. C# may be more natural choice due to the previous step being C, but it does not really matter. I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Depends what you mean by not worth learning. Basically no language is worth learning in the long run just because of itself. Languages change and new ones emerge, the point of that succession was to hypothesize what is the best way to become a well rounded programmer. The point is not to learn the language, but to gain more general skills. Languages can be learned very quickly and in the process of learning are only as importnant as far as they help you to achieve that goal. Pascal is clear enough language, without too many quirks, so it fits the role of good language to teach basics of structural programming. Actually any modern practical language is probably bad for that role as they all need to support too many features that are not useful in learning process, but are crucial in practice. As for your progression, I think the lack of C/C++ is kind of a weakness. But more importantly why would you move from C# to Java (joking  ) and from Java to VB.Net (not joking  ). VB is work of the devil. Agree with this guy ^ Its been said a million times before, but worth repeating that there is no linear progression to these things, and there is no right way to learn programming. I learned off Pascal when I was 13, before I even know what a real program was or that there ever were other languages. It worked, because then when I saw C and Java, I at least knew how to run my own program. (Best skill to learn from C/Pascal is the ability to just run the damn thing, which is an often overlooked skill) I'd say that you should start with Python or Java though, because being able to do something out the gate is the best feeling. If you enjoy writing your own data structures, and coming up with awesome solutions, you'll end up picking up C/C++, whereas if you like the OOP parts of those languages, you'll move towards even higher level languages. Also, VB is the work of the devil. On June 13 2012 22:44 Tobberoth wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote:On June 12 2012 21:22 mcc wrote:On June 12 2012 20:50 stafu wrote: In my slightly biased opinion, learn C first, then C++. If you can learn C and C++ to a decent degree, everything else is easy. C is not the best first language really. I think the old way of Pascal->C->C++->whatever is still the best. You can replace Pascal with similarly clear not OOP language and you can replace C++ with Java/C# as they have better designed OOP aspects. Reason is that before learning OOP you should learn proper structural programming and OOP aspects of Java/C# just get in the way of achieving this goal. C is bad at this as it has a lot of "unnatural" quirks. So after you master basics of structural programming , you move to C to learn the whole pointer and memory management thing. After that OOP. C# may be more natural choice due to the previous step being C, but it does not really matter. I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Would I be better off starting with something like python? Whats your reasoning for that progression? Why not start with C# and then not learn the others? Do you have any need for any of those languages? I'd say that out of those languages, C# is probably the most useful one in a professional context, with Java in close second (but it depends on your area, java is used a lot more in many contexts) while the other two languages are not all that useful. VB.net is used by a lot of corporations but 1. It's extremely easy to learn if you know C# and 2. nowadays, .NET languages are interchanagble, so you could technically write your code in C# and then convert it to VB.net automagically. I agree, but there is an order in which you should learn paradigms which is why Pascal/C should be learned first, followed by Java/C#, followed by Javascript/Ruby/Lisp, followed by Haskell, etc.You should learn the paradigms in this order. Structured -> Object Oriented -> Imperative Functional -> Declarative Functional. Going backwards is far more difficult and you will learn a lot slower and develop bad habits. Learning them in the order mentioned above will ensure that you have the best chance of having stronger fundamentals when learning programming. For example, you need to know functional decomposition to do any language, but you only need to know object decomposition in OOP/FP. Learning Pascal first teaches functional decomposition because that's the primary skill required in structured programming. Functional decomposition can be (and should be) applied to Java, but with Java there is a bigger focus on object decomposition, which can't be applied to Pascal. The catch is that object decomposition is a lot harder when you don't understand functional decomposition and you end up coming up with some really awkward designs. There is nothing more frustrating than seeing objects decomposed without a second thought applied to functional decomposition, because the developer who coded it started with Java. So if you want to progress in the a way that ensures the best chance of being a solid programmer, you should follow the order mentioned above. Not everybody learned it this way, and I'm sure there's some experts out there that started with Haskell. But just from my own experience I think this is the best way. Just out of curiosity, what time frame am I looking at for the average programmer? With a good enough education you can become better than 90% of programmers within a year. Spend a couple months on Pascal doing non-trivial stuff and learning how to properly do structured programming and use functional decomposition. Also learn dynamic memory allocation and pointers although not that important in this day and age, still nice to know how it all works. Then spend 6 months doing Java, and learning how to properly do Object Orientation, learn the 4 concepts down to the core, Abstraction/Encapsulation/Inheritance/Polymorphism. Also it is very important to learn Responsibility Driven Design, its just as important as learning the four main concepts, because it will teach you the mindset on object decomposition and how objects should work together to achieve the desired goal. Then spend a couple months on Ruby learning TDD and a different style of OO (look up Alan Kay and Smalltalk) and using some minor functional algorithms like inject/map/tap/etc, learning how monkey patching/open classes/mixins work, and a couple months on Haskell on functional programming. Then take your pick on what you enjoy most after that. Knowing what it is you need to learn, knowing how to do things correctly, is key. Theory is much more important than practice in the beginning. Although you should be doing both all the time  I've been a programmer since 9 years old, but 90% of what I know about programming was only in the last few years. I'm 22 now. All the prior years of programming before getting a formal education have really just helped with problem solving speed, but most of it was wasted time, because I didn't have internet, and nobody told me how to do things properly. Hey just to make things clear, my book says object-oriented programming have only three key principles which are encapsulation, specialization and polymorphism. I think that you are saying sounds very correct, if not even more specified, but what is true and not? Can I still go after what my book says? The book is from 2010-11-30 so maybe that you are saying is the more updated ground principles.
Programming is not really standarized, some books have other interpretations of "object oriented" than others. However, in the details they are usually similar, just the terminology and definitions might be slightly different.
|
On June 22 2012 19:40 Morfildur wrote:Show nested quote +On June 22 2012 19:31 Mstring wrote:On June 22 2012 19:16 Morfildur wrote: 5. If you don't read books (those with paper) about programming voluntarily in your spare time, you are in the wrong job.
Maybe this explains why I'm not "professionally productive" XD XD I've seen a few dozen of the "i don't like to read programming books" types in my professional life and they can do an ok job, but they never get past the "mediocre programmer" level because they don't like learning and in the still rapidly evolving world of programming, learning is what makes the difference between good and great.
I think it is less (i.e. isn't) that I have a lack of interest in learning and more that I have zero interest in developing a "professional life" 
For the problems that I find myself interested in solving, help can't be found in books or university courses.
|
On June 22 2012 19:37 Moxi wrote:Show nested quote +On June 22 2012 12:42 sluggaslamoo wrote:On June 21 2012 08:32 billy5000 wrote:On June 18 2012 14:15 sluggaslamoo wrote:On June 13 2012 08:23 RoyGBiv_13 wrote:On June 13 2012 08:10 mcc wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote:On June 12 2012 21:22 mcc wrote:On June 12 2012 20:50 stafu wrote: In my slightly biased opinion, learn C first, then C++. If you can learn C and C++ to a decent degree, everything else is easy. C is not the best first language really. I think the old way of Pascal->C->C++->whatever is still the best. You can replace Pascal with similarly clear not OOP language and you can replace C++ with Java/C# as they have better designed OOP aspects. Reason is that before learning OOP you should learn proper structural programming and OOP aspects of Java/C# just get in the way of achieving this goal. C is bad at this as it has a lot of "unnatural" quirks. So after you master basics of structural programming , you move to C to learn the whole pointer and memory management thing. After that OOP. C# may be more natural choice due to the previous step being C, but it does not really matter. I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Depends what you mean by not worth learning. Basically no language is worth learning in the long run just because of itself. Languages change and new ones emerge, the point of that succession was to hypothesize what is the best way to become a well rounded programmer. The point is not to learn the language, but to gain more general skills. Languages can be learned very quickly and in the process of learning are only as importnant as far as they help you to achieve that goal. Pascal is clear enough language, without too many quirks, so it fits the role of good language to teach basics of structural programming. Actually any modern practical language is probably bad for that role as they all need to support too many features that are not useful in learning process, but are crucial in practice. As for your progression, I think the lack of C/C++ is kind of a weakness. But more importantly why would you move from C# to Java (joking  ) and from Java to VB.Net (not joking  ). VB is work of the devil. Agree with this guy ^ Its been said a million times before, but worth repeating that there is no linear progression to these things, and there is no right way to learn programming. I learned off Pascal when I was 13, before I even know what a real program was or that there ever were other languages. It worked, because then when I saw C and Java, I at least knew how to run my own program. (Best skill to learn from C/Pascal is the ability to just run the damn thing, which is an often overlooked skill) I'd say that you should start with Python or Java though, because being able to do something out the gate is the best feeling. If you enjoy writing your own data structures, and coming up with awesome solutions, you'll end up picking up C/C++, whereas if you like the OOP parts of those languages, you'll move towards even higher level languages. Also, VB is the work of the devil. On June 13 2012 22:44 Tobberoth wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote:On June 12 2012 21:22 mcc wrote:On June 12 2012 20:50 stafu wrote: In my slightly biased opinion, learn C first, then C++. If you can learn C and C++ to a decent degree, everything else is easy. C is not the best first language really. I think the old way of Pascal->C->C++->whatever is still the best. You can replace Pascal with similarly clear not OOP language and you can replace C++ with Java/C# as they have better designed OOP aspects. Reason is that before learning OOP you should learn proper structural programming and OOP aspects of Java/C# just get in the way of achieving this goal. C is bad at this as it has a lot of "unnatural" quirks. So after you master basics of structural programming , you move to C to learn the whole pointer and memory management thing. After that OOP. C# may be more natural choice due to the previous step being C, but it does not really matter. I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Would I be better off starting with something like python? Whats your reasoning for that progression? Why not start with C# and then not learn the others? Do you have any need for any of those languages? I'd say that out of those languages, C# is probably the most useful one in a professional context, with Java in close second (but it depends on your area, java is used a lot more in many contexts) while the other two languages are not all that useful. VB.net is used by a lot of corporations but 1. It's extremely easy to learn if you know C# and 2. nowadays, .NET languages are interchanagble, so you could technically write your code in C# and then convert it to VB.net automagically. I agree, but there is an order in which you should learn paradigms which is why Pascal/C should be learned first, followed by Java/C#, followed by Javascript/Ruby/Lisp, followed by Haskell, etc.You should learn the paradigms in this order. Structured -> Object Oriented -> Imperative Functional -> Declarative Functional. Going backwards is far more difficult and you will learn a lot slower and develop bad habits. Learning them in the order mentioned above will ensure that you have the best chance of having stronger fundamentals when learning programming. For example, you need to know functional decomposition to do any language, but you only need to know object decomposition in OOP/FP. Learning Pascal first teaches functional decomposition because that's the primary skill required in structured programming. Functional decomposition can be (and should be) applied to Java, but with Java there is a bigger focus on object decomposition, which can't be applied to Pascal. The catch is that object decomposition is a lot harder when you don't understand functional decomposition and you end up coming up with some really awkward designs. There is nothing more frustrating than seeing objects decomposed without a second thought applied to functional decomposition, because the developer who coded it started with Java. So if you want to progress in the a way that ensures the best chance of being a solid programmer, you should follow the order mentioned above. Not everybody learned it this way, and I'm sure there's some experts out there that started with Haskell. But just from my own experience I think this is the best way. Just out of curiosity, what time frame am I looking at for the average programmer? With a good enough education you can become better than 90% of programmers within a year. Spend a couple months on Pascal doing non-trivial stuff and learning how to properly do structured programming and use functional decomposition. Also learn dynamic memory allocation and pointers although not that important in this day and age, still nice to know how it all works. Then spend 6 months doing Java, and learning how to properly do Object Orientation, learn the 4 concepts down to the core, Abstraction/Encapsulation/Inheritance/Polymorphism. Also it is very important to learn Responsibility Driven Design, its just as important as learning the four main concepts, because it will teach you the mindset on object decomposition and how objects should work together to achieve the desired goal. Then spend a couple months on Ruby learning TDD and a different style of OO (look up Alan Kay and Smalltalk) and using some minor functional algorithms like inject/map/tap/etc, learning how monkey patching/open classes/mixins work, and a couple months on Haskell on functional programming. Then take your pick on what you enjoy most after that. Knowing what it is you need to learn, knowing how to do things correctly, is key. Theory is much more important than practice in the beginning. Although you should be doing both all the time  I've been a programmer since 9 years old, but 90% of what I know about programming was only in the last few years. I'm 22 now. All the prior years of programming before getting a formal education have really just helped with problem solving speed, but most of it was wasted time, because I didn't have internet, and nobody told me how to do things properly. Hey just to make things clear, my book says object-oriented programming have only three key principles which are encapsulation, specialization and polymorphism. I think that you are saying sounds very correct, if not even more specified, but what is true and not? Can I still go after what my book says? The book is from 2010-11-30 so maybe that you are saying is the more updated ground principles.
Have a flick through but keep these points in mind.
Specialization is one direction, but you specialize and you generalize. This falls under the concept of Object Oriented Abstraction.
Secondly, you can't have polymorphism without inheritance. Same thing, if it just talks about polymorphism without inheritance, its not covering it properly. Also don't be afraid of inventing your own classes that utilize generics, it will help you understand polymorphism a lot better. Although duck-typing and traits will bend the rules a little bit (don't worry about these for now), you wanna have this mindset to begin with before learning more dynamic languages.
Here's a journal of everything I knew about OOP about 3 years ago. There's a lot I would change now, but it should give you a head start. I had read through about 10 books to get to that stage so.
http://www.netgore.com/forums/post/object-oriented-programming.html
Not meant to be a plug, but I have to give some credit to the site that hosts it . Eventually I will get around to creating my own website that teaches this stuff.
Posted this several times in the thread already, everyone seems to have found it really useful.
|
On June 22 2012 19:16 Morfildur wrote:Show nested quote +On June 22 2012 18:47 Mstring wrote:On June 22 2012 12:42 sluggaslamoo wrote:On June 21 2012 08:32 billy5000 wrote:On June 18 2012 14:15 sluggaslamoo wrote:On June 13 2012 08:23 RoyGBiv_13 wrote:On June 13 2012 08:10 mcc wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote:On June 12 2012 21:22 mcc wrote: [quote] C is not the best first language really. I think the old way of Pascal->C->C++->whatever is still the best. You can replace Pascal with similarly clear not OOP language and you can replace C++ with Java/C# as they have better designed OOP aspects. Reason is that before learning OOP you should learn proper structural programming and OOP aspects of Java/C# just get in the way of achieving this goal. C is bad at this as it has a lot of "unnatural" quirks. So after you master basics of structural programming , you move to C to learn the whole pointer and memory management thing. After that OOP. C# may be more natural choice due to the previous step being C, but it does not really matter. I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Depends what you mean by not worth learning. Basically no language is worth learning in the long run just because of itself. Languages change and new ones emerge, the point of that succession was to hypothesize what is the best way to become a well rounded programmer. The point is not to learn the language, but to gain more general skills. Languages can be learned very quickly and in the process of learning are only as importnant as far as they help you to achieve that goal. Pascal is clear enough language, without too many quirks, so it fits the role of good language to teach basics of structural programming. Actually any modern practical language is probably bad for that role as they all need to support too many features that are not useful in learning process, but are crucial in practice. As for your progression, I think the lack of C/C++ is kind of a weakness. But more importantly why would you move from C# to Java (joking  ) and from Java to VB.Net (not joking  ). VB is work of the devil. Agree with this guy ^ Its been said a million times before, but worth repeating that there is no linear progression to these things, and there is no right way to learn programming. I learned off Pascal when I was 13, before I even know what a real program was or that there ever were other languages. It worked, because then when I saw C and Java, I at least knew how to run my own program. (Best skill to learn from C/Pascal is the ability to just run the damn thing, which is an often overlooked skill) I'd say that you should start with Python or Java though, because being able to do something out the gate is the best feeling. If you enjoy writing your own data structures, and coming up with awesome solutions, you'll end up picking up C/C++, whereas if you like the OOP parts of those languages, you'll move towards even higher level languages. Also, VB is the work of the devil. On June 13 2012 22:44 Tobberoth wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote:On June 12 2012 21:22 mcc wrote:On June 12 2012 20:50 stafu wrote: In my slightly biased opinion, learn C first, then C++. If you can learn C and C++ to a decent degree, everything else is easy. C is not the best first language really. I think the old way of Pascal->C->C++->whatever is still the best. You can replace Pascal with similarly clear not OOP language and you can replace C++ with Java/C# as they have better designed OOP aspects. Reason is that before learning OOP you should learn proper structural programming and OOP aspects of Java/C# just get in the way of achieving this goal. C is bad at this as it has a lot of "unnatural" quirks. So after you master basics of structural programming , you move to C to learn the whole pointer and memory management thing. After that OOP. C# may be more natural choice due to the previous step being C, but it does not really matter. I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Would I be better off starting with something like python? Whats your reasoning for that progression? Why not start with C# and then not learn the others? Do you have any need for any of those languages? I'd say that out of those languages, C# is probably the most useful one in a professional context, with Java in close second (but it depends on your area, java is used a lot more in many contexts) while the other two languages are not all that useful. VB.net is used by a lot of corporations but 1. It's extremely easy to learn if you know C# and 2. nowadays, .NET languages are interchanagble, so you could technically write your code in C# and then convert it to VB.net automagically. I agree, but there is an order in which you should learn paradigms which is why Pascal/C should be learned first, followed by Java/C#, followed by Javascript/Ruby/Lisp, followed by Haskell, etc.You should learn the paradigms in this order. Structured -> Object Oriented -> Imperative Functional -> Declarative Functional. Going backwards is far more difficult and you will learn a lot slower and develop bad habits. Learning them in the order mentioned above will ensure that you have the best chance of having stronger fundamentals when learning programming. For example, you need to know functional decomposition to do any language, but you only need to know object decomposition in OOP/FP. Learning Pascal first teaches functional decomposition because that's the primary skill required in structured programming. Functional decomposition can be (and should be) applied to Java, but with Java there is a bigger focus on object decomposition, which can't be applied to Pascal. The catch is that object decomposition is a lot harder when you don't understand functional decomposition and you end up coming up with some really awkward designs. There is nothing more frustrating than seeing objects decomposed without a second thought applied to functional decomposition, because the developer who coded it started with Java. So if you want to progress in the a way that ensures the best chance of being a solid programmer, you should follow the order mentioned above. Not everybody learned it this way, and I'm sure there's some experts out there that started with Haskell. But just from my own experience I think this is the best way. Just out of curiosity, what time frame am I looking at for the average programmer? With a good enough education you can become better than 90% of programmers within a year. Spend a couple months on Pascal doing non-trivial stuff and learning how to properly do structured programming and use functional decomposition. Also learn dynamic memory allocation and pointers although not that important in this day and age, still nice to know how it all works. Then spend 6 months doing Java, and learning how to properly do Object Orientation, learn the 4 concepts down to the core, Abstraction/Encapsulation/Inheritance/Polymorphism. Also it is very important to learn Responsibility Driven Design, its just as important as learning the four main concepts, because it will teach you the mindset on object decomposition and how objects should work together to achieve the desired goal. Then spend a couple months on Ruby learning TDD and a different style of OO (look up Alan Kay and Smalltalk) and using some minor functional algorithms like inject/map/tap/etc, learning how monkey patching/open classes/mixins work, and a couple months on Haskell on functional programming. Then take your pick on what you enjoy most after that. Knowing what it is you need to learn, knowing how to do things correctly, is key. Theory is much more important than practice in the beginning. Although you should be doing both all the time  I've been a programmer since 9 years old, but 90% of what I know about programming was only in the last few years. I'm 22 now. All the prior years of programming before getting a formal education have really just helped with problem solving speed, but most of it was wasted time, because I didn't have internet, and nobody told me how to do things properly. I too started when I was 9 years old and if you'd started on me with "functional decomposition" I'd have told you to bugger off-- I just wanted to make stick figures fight each other! I think that not putting the cart before the horse made me a better programmer, and possibly a better human. I learned how to think, not what to think. XD I started programming when i was 8 by typing in C64 basic listings from some magazine and then playing around with values and such, now i'm 30, know 10-15 different programming languages (of course not including stuff like HTML)... and i still only know 1/10th of what i'd love to know about programming and 1/100th of what there is to learn about it. As for learning programming, it's best to get an idea of what you want and then just implement it the easiest way you can find. It will be wrong, inefficient, unmaintainable and there will be a billion better ways to do it... but you started solving problems and that is what programming is about. Funny as it sounds, Programming is not about writing code, writing code is easy. Programming is about solving problems, solving problems is hard. You won't ever write perfect code but you will solve problems. Every year i see the code i wrote a year ago and think "What idiot wrote that code? It's all bad, inefficient, messy and wrong... oh, that was me...". Some important lessons i learned: 1. All assumptions will turn out wrong. 2. Don't use programming "tricks", write simple code even if it looks like it would be slow/inefficient/longer. 3. Don't be scared of using additional variables, reusing variables is BAD. If you happen to have a variable that does the same in the same scope you don't have enough functions/methods. 4. If you have a variable called tmp/$tmp/@tmp/%tmp, you are doing something wrong. 5. If you don't read books (those with paper) about programming voluntarily in your spare time, you are in the wrong job.
Depends what programming tricks. I use map/tap/inject all the time.
Instead of
words = ["one", "two", "three"] result = new Array for each w in words result << w + ' sheep' end
I can just do
result = ["one", "two", "three"].map {|w| w + ' sheep'}
You might think that the first one is more readable. However imagine that after doing this many many times in a file, the second one becomes more readable overall.
+ Show Spoiler + words = ["one", "two", "three"] result = new Array for each w in words result << w + ' sheep' end
words = ["one", "two", "three"] result = new Array for each w in words result << w + ' sheep' end
words = ["one", "two", "three"] result = new Array for each w in words result << w + ' sheep' end
words = ["one", "two", "three"] result = new Array for each w in words result << w + ' sheep' end
Is much less readable than just
+ Show Spoiler + result = ["one", "two", "three"].map {|w| w + ' sheep'}
result = ["one", "two", "three"].map {|w| w + ' sheep'}
result = ["one", "two", "three"].map {|w| w + ' sheep'}
result = ["one", "two", "three"].map {|w| w + ' sheep'}
Also, anyone that is familiar with the language, can just look at that and know what it does immediately. And its faster to read 1 line than 5 lines.
|
On June 22 2012 22:45 sluggaslamoo wrote:Show nested quote +On June 22 2012 19:37 Moxi wrote:On June 22 2012 12:42 sluggaslamoo wrote:On June 21 2012 08:32 billy5000 wrote:On June 18 2012 14:15 sluggaslamoo wrote:On June 13 2012 08:23 RoyGBiv_13 wrote:On June 13 2012 08:10 mcc wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote:On June 12 2012 21:22 mcc wrote: [quote] C is not the best first language really. I think the old way of Pascal->C->C++->whatever is still the best. You can replace Pascal with similarly clear not OOP language and you can replace C++ with Java/C# as they have better designed OOP aspects. Reason is that before learning OOP you should learn proper structural programming and OOP aspects of Java/C# just get in the way of achieving this goal. C is bad at this as it has a lot of "unnatural" quirks. So after you master basics of structural programming , you move to C to learn the whole pointer and memory management thing. After that OOP. C# may be more natural choice due to the previous step being C, but it does not really matter. I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Depends what you mean by not worth learning. Basically no language is worth learning in the long run just because of itself. Languages change and new ones emerge, the point of that succession was to hypothesize what is the best way to become a well rounded programmer. The point is not to learn the language, but to gain more general skills. Languages can be learned very quickly and in the process of learning are only as importnant as far as they help you to achieve that goal. Pascal is clear enough language, without too many quirks, so it fits the role of good language to teach basics of structural programming. Actually any modern practical language is probably bad for that role as they all need to support too many features that are not useful in learning process, but are crucial in practice. As for your progression, I think the lack of C/C++ is kind of a weakness. But more importantly why would you move from C# to Java (joking  ) and from Java to VB.Net (not joking  ). VB is work of the devil. Agree with this guy ^ Its been said a million times before, but worth repeating that there is no linear progression to these things, and there is no right way to learn programming. I learned off Pascal when I was 13, before I even know what a real program was or that there ever were other languages. It worked, because then when I saw C and Java, I at least knew how to run my own program. (Best skill to learn from C/Pascal is the ability to just run the damn thing, which is an often overlooked skill) I'd say that you should start with Python or Java though, because being able to do something out the gate is the best feeling. If you enjoy writing your own data structures, and coming up with awesome solutions, you'll end up picking up C/C++, whereas if you like the OOP parts of those languages, you'll move towards even higher level languages. Also, VB is the work of the devil. On June 13 2012 22:44 Tobberoth wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote:On June 12 2012 21:22 mcc wrote:On June 12 2012 20:50 stafu wrote: In my slightly biased opinion, learn C first, then C++. If you can learn C and C++ to a decent degree, everything else is easy. C is not the best first language really. I think the old way of Pascal->C->C++->whatever is still the best. You can replace Pascal with similarly clear not OOP language and you can replace C++ with Java/C# as they have better designed OOP aspects. Reason is that before learning OOP you should learn proper structural programming and OOP aspects of Java/C# just get in the way of achieving this goal. C is bad at this as it has a lot of "unnatural" quirks. So after you master basics of structural programming , you move to C to learn the whole pointer and memory management thing. After that OOP. C# may be more natural choice due to the previous step being C, but it does not really matter. I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Would I be better off starting with something like python? Whats your reasoning for that progression? Why not start with C# and then not learn the others? Do you have any need for any of those languages? I'd say that out of those languages, C# is probably the most useful one in a professional context, with Java in close second (but it depends on your area, java is used a lot more in many contexts) while the other two languages are not all that useful. VB.net is used by a lot of corporations but 1. It's extremely easy to learn if you know C# and 2. nowadays, .NET languages are interchanagble, so you could technically write your code in C# and then convert it to VB.net automagically. I agree, but there is an order in which you should learn paradigms which is why Pascal/C should be learned first, followed by Java/C#, followed by Javascript/Ruby/Lisp, followed by Haskell, etc.You should learn the paradigms in this order. Structured -> Object Oriented -> Imperative Functional -> Declarative Functional. Going backwards is far more difficult and you will learn a lot slower and develop bad habits. Learning them in the order mentioned above will ensure that you have the best chance of having stronger fundamentals when learning programming. For example, you need to know functional decomposition to do any language, but you only need to know object decomposition in OOP/FP. Learning Pascal first teaches functional decomposition because that's the primary skill required in structured programming. Functional decomposition can be (and should be) applied to Java, but with Java there is a bigger focus on object decomposition, which can't be applied to Pascal. The catch is that object decomposition is a lot harder when you don't understand functional decomposition and you end up coming up with some really awkward designs. There is nothing more frustrating than seeing objects decomposed without a second thought applied to functional decomposition, because the developer who coded it started with Java. So if you want to progress in the a way that ensures the best chance of being a solid programmer, you should follow the order mentioned above. Not everybody learned it this way, and I'm sure there's some experts out there that started with Haskell. But just from my own experience I think this is the best way. Just out of curiosity, what time frame am I looking at for the average programmer? With a good enough education you can become better than 90% of programmers within a year. Spend a couple months on Pascal doing non-trivial stuff and learning how to properly do structured programming and use functional decomposition. Also learn dynamic memory allocation and pointers although not that important in this day and age, still nice to know how it all works. Then spend 6 months doing Java, and learning how to properly do Object Orientation, learn the 4 concepts down to the core, Abstraction/Encapsulation/Inheritance/Polymorphism. Also it is very important to learn Responsibility Driven Design, its just as important as learning the four main concepts, because it will teach you the mindset on object decomposition and how objects should work together to achieve the desired goal. Then spend a couple months on Ruby learning TDD and a different style of OO (look up Alan Kay and Smalltalk) and using some minor functional algorithms like inject/map/tap/etc, learning how monkey patching/open classes/mixins work, and a couple months on Haskell on functional programming. Then take your pick on what you enjoy most after that. Knowing what it is you need to learn, knowing how to do things correctly, is key. Theory is much more important than practice in the beginning. Although you should be doing both all the time  I've been a programmer since 9 years old, but 90% of what I know about programming was only in the last few years. I'm 22 now. All the prior years of programming before getting a formal education have really just helped with problem solving speed, but most of it was wasted time, because I didn't have internet, and nobody told me how to do things properly. Hey just to make things clear, my book says object-oriented programming have only three key principles which are encapsulation, specialization and polymorphism. I think that you are saying sounds very correct, if not even more specified, but what is true and not? Can I still go after what my book says? The book is from 2010-11-30 so maybe that you are saying is the more updated ground principles. Have a flick through but keep these points in mind. Specialization is one direction, but you specialize and you generalize. This falls under the concept of Object Oriented Abstraction. Secondly, you can't have polymorphism without inheritance. Same thing, if it just talks about polymorphism without inheritance, its not covering it properly. Also don't be afraid of inventing your own classes that utilize generics, it will help you understand polymorphism a lot better. Although duck-typing and traits will bend the rules a little bit (don't worry about these for now), you wanna have this mindset to begin with before learning more dynamic languages. Here's a journal of everything I knew about OOP about 3 years ago. There's a lot I would change now, but it should give you a head start. I had read through about 10 books to get to that stage so. http://www.netgore.com/forums/post/object-oriented-programming.htmlNot meant to be a plug, but I have to give some credit to the site that hosts it  . Eventually I will get around to creating my own website that teaches this stuff. Posted this several times in the thread already, everyone seems to have found it really useful.
Big thank you (and others who explaned about the concepts as well).
|
+ Show Spoiler +On June 22 2012 12:25 Ultraliskhero wrote: @Azerbaijan
It looks like your loop's stop condition is comparing with a EOF, not a null. If you're using a windows machine, typing in (control)Z may be able to stop your program and thus print out the output. (I tried it and it worked for me) EOF is not a newline. EOF is a special sequence as far as I know. If you run in Windows, I believe in Windows EOF is signaled by CTRL+Z in the command prompt. So to stop your loop, press CTRL+Z, not Enter, which is what I assume you pressed?
Thanks for the help. I think the issue is that the book I'm using is from the 70s lol. It has a whole section about the precision of data types on different machines such as PDP-11, Honeywell 6000, IBM 370, ect, ect. So it wont be telling me anything about Windows. I feel like the book will still be helpful to me just a bit more challenging.
Can somone explain to me how to post formatted code?
|
Lol!! I just started to read this thread.
I have actually recently become very interested in programming - I got a part-time job as a data analyst (I'm studying Science - majoring in statistics) while still at university, and through the course of the job I have ended up using VBA to write several macros that save us a decent amount of time at work. We also use a statistics package called SPSS and soon I will be downloading the Python plug-in to play around with that and write some useful stuff. Python will be my first programming language that it seems serious programmers use, and I'm quite looking forward to it.
My first experience with programming was in the summer after my first year at uni, when I was at summer school taking an extra subject in Engineering and about half the subject was programming in MATLAB which I actually loved and thought was the best part of the course. What surprised me was how many other people really didn't like it, but I found I had a natural affinity for sitting at the keyboard tapping away and coming up with solutions of how to solve the problem. The biggest project we had to do was write a program that would play a game of tic-tac-toe n times with itself which was quite fun.
So now fast-forward two and a half years and I'm quite enjoying programming now. Everything I know about VBA I've learned on the job and I'm proud of myself for having come this far. Now I'm to the point where I'm learning some of the quirks of the language and why things are more efficient and some of the shortcuts that can be done, I've been asking questions online when I'm stuck (and now find myself at the point where I can now help others, awesome!! though the other day i wrote some code that solved a problem in 66 lines but a long-time poster achieved the same result in just 6 LOL) which has naturally lead to me reading about other programming languages. I'm now most likely going to do a Masters of Computer Science whereas before I was thinking about doing a Masters of Statistics.
Obviously a couple of people think VB/VBA is the work of the devil :p, so please do be gentle. No but seriously VBA has been VERY useful in our working environment and I have done some good work with it - BUT I am now looking for where to go. I think doing a masters of computer science will be great, I'll be reading this thread to get some other ideas about things to do. What I would like to know is maybe one or two books that would be great for me to read - just by reading and getting the feel for how I work - I feel like C would be the programming language I would most take a liking to as I'm not afraid of learning lots if it pays dividends in the long run.
But yeah also this is my first post in this thread just to say hi and introduce myself.
|
On June 22 2012 23:03 sluggaslamoo wrote:Show nested quote +On June 22 2012 19:16 Morfildur wrote:On June 22 2012 18:47 Mstring wrote:On June 22 2012 12:42 sluggaslamoo wrote:On June 21 2012 08:32 billy5000 wrote:On June 18 2012 14:15 sluggaslamoo wrote:On June 13 2012 08:23 RoyGBiv_13 wrote:On June 13 2012 08:10 mcc wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote: [quote]
I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Depends what you mean by not worth learning. Basically no language is worth learning in the long run just because of itself. Languages change and new ones emerge, the point of that succession was to hypothesize what is the best way to become a well rounded programmer. The point is not to learn the language, but to gain more general skills. Languages can be learned very quickly and in the process of learning are only as importnant as far as they help you to achieve that goal. Pascal is clear enough language, without too many quirks, so it fits the role of good language to teach basics of structural programming. Actually any modern practical language is probably bad for that role as they all need to support too many features that are not useful in learning process, but are crucial in practice. As for your progression, I think the lack of C/C++ is kind of a weakness. But more importantly why would you move from C# to Java (joking  ) and from Java to VB.Net (not joking  ). VB is work of the devil. Agree with this guy ^ Its been said a million times before, but worth repeating that there is no linear progression to these things, and there is no right way to learn programming. I learned off Pascal when I was 13, before I even know what a real program was or that there ever were other languages. It worked, because then when I saw C and Java, I at least knew how to run my own program. (Best skill to learn from C/Pascal is the ability to just run the damn thing, which is an often overlooked skill) I'd say that you should start with Python or Java though, because being able to do something out the gate is the best feeling. If you enjoy writing your own data structures, and coming up with awesome solutions, you'll end up picking up C/C++, whereas if you like the OOP parts of those languages, you'll move towards even higher level languages. Also, VB is the work of the devil. On June 13 2012 22:44 Tobberoth wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote:On June 12 2012 21:22 mcc wrote: [quote] C is not the best first language really. I think the old way of Pascal->C->C++->whatever is still the best. You can replace Pascal with similarly clear not OOP language and you can replace C++ with Java/C# as they have better designed OOP aspects. Reason is that before learning OOP you should learn proper structural programming and OOP aspects of Java/C# just get in the way of achieving this goal. C is bad at this as it has a lot of "unnatural" quirks. So after you master basics of structural programming , you move to C to learn the whole pointer and memory management thing. After that OOP. C# may be more natural choice due to the previous step being C, but it does not really matter. I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Would I be better off starting with something like python? Whats your reasoning for that progression? Why not start with C# and then not learn the others? Do you have any need for any of those languages? I'd say that out of those languages, C# is probably the most useful one in a professional context, with Java in close second (but it depends on your area, java is used a lot more in many contexts) while the other two languages are not all that useful. VB.net is used by a lot of corporations but 1. It's extremely easy to learn if you know C# and 2. nowadays, .NET languages are interchanagble, so you could technically write your code in C# and then convert it to VB.net automagically. I agree, but there is an order in which you should learn paradigms which is why Pascal/C should be learned first, followed by Java/C#, followed by Javascript/Ruby/Lisp, followed by Haskell, etc.You should learn the paradigms in this order. Structured -> Object Oriented -> Imperative Functional -> Declarative Functional. Going backwards is far more difficult and you will learn a lot slower and develop bad habits. Learning them in the order mentioned above will ensure that you have the best chance of having stronger fundamentals when learning programming. For example, you need to know functional decomposition to do any language, but you only need to know object decomposition in OOP/FP. Learning Pascal first teaches functional decomposition because that's the primary skill required in structured programming. Functional decomposition can be (and should be) applied to Java, but with Java there is a bigger focus on object decomposition, which can't be applied to Pascal. The catch is that object decomposition is a lot harder when you don't understand functional decomposition and you end up coming up with some really awkward designs. There is nothing more frustrating than seeing objects decomposed without a second thought applied to functional decomposition, because the developer who coded it started with Java. So if you want to progress in the a way that ensures the best chance of being a solid programmer, you should follow the order mentioned above. Not everybody learned it this way, and I'm sure there's some experts out there that started with Haskell. But just from my own experience I think this is the best way. Just out of curiosity, what time frame am I looking at for the average programmer? With a good enough education you can become better than 90% of programmers within a year. Spend a couple months on Pascal doing non-trivial stuff and learning how to properly do structured programming and use functional decomposition. Also learn dynamic memory allocation and pointers although not that important in this day and age, still nice to know how it all works. Then spend 6 months doing Java, and learning how to properly do Object Orientation, learn the 4 concepts down to the core, Abstraction/Encapsulation/Inheritance/Polymorphism. Also it is very important to learn Responsibility Driven Design, its just as important as learning the four main concepts, because it will teach you the mindset on object decomposition and how objects should work together to achieve the desired goal. Then spend a couple months on Ruby learning TDD and a different style of OO (look up Alan Kay and Smalltalk) and using some minor functional algorithms like inject/map/tap/etc, learning how monkey patching/open classes/mixins work, and a couple months on Haskell on functional programming. Then take your pick on what you enjoy most after that. Knowing what it is you need to learn, knowing how to do things correctly, is key. Theory is much more important than practice in the beginning. Although you should be doing both all the time  I've been a programmer since 9 years old, but 90% of what I know about programming was only in the last few years. I'm 22 now. All the prior years of programming before getting a formal education have really just helped with problem solving speed, but most of it was wasted time, because I didn't have internet, and nobody told me how to do things properly. I too started when I was 9 years old and if you'd started on me with "functional decomposition" I'd have told you to bugger off-- I just wanted to make stick figures fight each other! I think that not putting the cart before the horse made me a better programmer, and possibly a better human. I learned how to think, not what to think. XD I started programming when i was 8 by typing in C64 basic listings from some magazine and then playing around with values and such, now i'm 30, know 10-15 different programming languages (of course not including stuff like HTML)... and i still only know 1/10th of what i'd love to know about programming and 1/100th of what there is to learn about it. As for learning programming, it's best to get an idea of what you want and then just implement it the easiest way you can find. It will be wrong, inefficient, unmaintainable and there will be a billion better ways to do it... but you started solving problems and that is what programming is about. Funny as it sounds, Programming is not about writing code, writing code is easy. Programming is about solving problems, solving problems is hard. You won't ever write perfect code but you will solve problems. Every year i see the code i wrote a year ago and think "What idiot wrote that code? It's all bad, inefficient, messy and wrong... oh, that was me...". Some important lessons i learned: 1. All assumptions will turn out wrong. 2. Don't use programming "tricks", write simple code even if it looks like it would be slow/inefficient/longer. 3. Don't be scared of using additional variables, reusing variables is BAD. If you happen to have a variable that does the same in the same scope you don't have enough functions/methods. 4. If you have a variable called tmp/$tmp/@tmp/%tmp, you are doing something wrong. 5. If you don't read books (those with paper) about programming voluntarily in your spare time, you are in the wrong job. Depends what programming tricks. I use map/tap/inject all the time. Instead of words = ["one", "two", "three"] result = new Array for each w in words result << w + ' sheep' end I can just do result = ["one", "two", "three"].map {|w| w + ' sheep'} You might think that the first one is more readable. However imagine that after doing this many many times in a file, the second one becomes more readable overall. + Show Spoiler + words = ["one", "two", "three"] result = new Array for each w in words result << w + ' sheep' end
words = ["one", "two", "three"] result = new Array for each w in words result << w + ' sheep' end
words = ["one", "two", "three"] result = new Array for each w in words result << w + ' sheep' end
words = ["one", "two", "three"] result = new Array for each w in words result << w + ' sheep' end
Is much less readable than just + Show Spoiler + result = ["one", "two", "three"].map {|w| w + ' sheep'}
result = ["one", "two", "three"].map {|w| w + ' sheep'}
result = ["one", "two", "three"].map {|w| w + ' sheep'}
result = ["one", "two", "three"].map {|w| w + ' sheep'}
Also, anyone that is familiar with the language, can just look at that and know what it does immediately. And its faster to read 1 line than 5 lines. I wouldn't really call using map or reduce or whatever other things like that "tricks", and I don't think thats what he was really referring to. Those are things that reduce cognitive load, not add to it (assuming you know what they do, but most people should probably know that by now or they haven't been keeping up). The "tricks" that he is referring to are things that allow you to drop your line count, variable count, etc. at the expense of readability and cognitive load.
For instance, if we look at javascript, lets say you want to execute a function only if a particular variable is true. The "normal" way to do this is: if(myVar) { myFunc(); }
But we can do this in one line!myVar && myFunc();
Is it worth it? Pretty much never.
|
On June 23 2012 12:49 tec27 wrote:Show nested quote +On June 22 2012 23:03 sluggaslamoo wrote:On June 22 2012 19:16 Morfildur wrote:On June 22 2012 18:47 Mstring wrote:On June 22 2012 12:42 sluggaslamoo wrote:On June 21 2012 08:32 billy5000 wrote:On June 18 2012 14:15 sluggaslamoo wrote:On June 13 2012 08:23 RoyGBiv_13 wrote:On June 13 2012 08:10 mcc wrote:On June 13 2012 07:57 Defury wrote: [quote]
Would Pascal -> C# -> Java -> VB.net work?
Isn't pascal severely out dated and not worth learning? Depends what you mean by not worth learning. Basically no language is worth learning in the long run just because of itself. Languages change and new ones emerge, the point of that succession was to hypothesize what is the best way to become a well rounded programmer. The point is not to learn the language, but to gain more general skills. Languages can be learned very quickly and in the process of learning are only as importnant as far as they help you to achieve that goal. Pascal is clear enough language, without too many quirks, so it fits the role of good language to teach basics of structural programming. Actually any modern practical language is probably bad for that role as they all need to support too many features that are not useful in learning process, but are crucial in practice. As for your progression, I think the lack of C/C++ is kind of a weakness. But more importantly why would you move from C# to Java (joking  ) and from Java to VB.Net (not joking  ). VB is work of the devil. Agree with this guy ^ Its been said a million times before, but worth repeating that there is no linear progression to these things, and there is no right way to learn programming. I learned off Pascal when I was 13, before I even know what a real program was or that there ever were other languages. It worked, because then when I saw C and Java, I at least knew how to run my own program. (Best skill to learn from C/Pascal is the ability to just run the damn thing, which is an often overlooked skill) I'd say that you should start with Python or Java though, because being able to do something out the gate is the best feeling. If you enjoy writing your own data structures, and coming up with awesome solutions, you'll end up picking up C/C++, whereas if you like the OOP parts of those languages, you'll move towards even higher level languages. Also, VB is the work of the devil. On June 13 2012 22:44 Tobberoth wrote:On June 13 2012 07:57 Defury wrote:On June 13 2012 06:01 KaiserJohan wrote: [quote]
I agree completely, well said. I started with functional language Moscow ML and then C and then Java at university, and that is really good. Would Pascal -> C# -> Java -> VB.net work? Isn't pascal severely out dated and not worth learning? Would I be better off starting with something like python? Whats your reasoning for that progression? Why not start with C# and then not learn the others? Do you have any need for any of those languages? I'd say that out of those languages, C# is probably the most useful one in a professional context, with Java in close second (but it depends on your area, java is used a lot more in many contexts) while the other two languages are not all that useful. VB.net is used by a lot of corporations but 1. It's extremely easy to learn if you know C# and 2. nowadays, .NET languages are interchanagble, so you could technically write your code in C# and then convert it to VB.net automagically. I agree, but there is an order in which you should learn paradigms which is why Pascal/C should be learned first, followed by Java/C#, followed by Javascript/Ruby/Lisp, followed by Haskell, etc.You should learn the paradigms in this order. Structured -> Object Oriented -> Imperative Functional -> Declarative Functional. Going backwards is far more difficult and you will learn a lot slower and develop bad habits. Learning them in the order mentioned above will ensure that you have the best chance of having stronger fundamentals when learning programming. For example, you need to know functional decomposition to do any language, but you only need to know object decomposition in OOP/FP. Learning Pascal first teaches functional decomposition because that's the primary skill required in structured programming. Functional decomposition can be (and should be) applied to Java, but with Java there is a bigger focus on object decomposition, which can't be applied to Pascal. The catch is that object decomposition is a lot harder when you don't understand functional decomposition and you end up coming up with some really awkward designs. There is nothing more frustrating than seeing objects decomposed without a second thought applied to functional decomposition, because the developer who coded it started with Java. So if you want to progress in the a way that ensures the best chance of being a solid programmer, you should follow the order mentioned above. Not everybody learned it this way, and I'm sure there's some experts out there that started with Haskell. But just from my own experience I think this is the best way. Just out of curiosity, what time frame am I looking at for the average programmer? With a good enough education you can become better than 90% of programmers within a year. Spend a couple months on Pascal doing non-trivial stuff and learning how to properly do structured programming and use functional decomposition. Also learn dynamic memory allocation and pointers although not that important in this day and age, still nice to know how it all works. Then spend 6 months doing Java, and learning how to properly do Object Orientation, learn the 4 concepts down to the core, Abstraction/Encapsulation/Inheritance/Polymorphism. Also it is very important to learn Responsibility Driven Design, its just as important as learning the four main concepts, because it will teach you the mindset on object decomposition and how objects should work together to achieve the desired goal. Then spend a couple months on Ruby learning TDD and a different style of OO (look up Alan Kay and Smalltalk) and using some minor functional algorithms like inject/map/tap/etc, learning how monkey patching/open classes/mixins work, and a couple months on Haskell on functional programming. Then take your pick on what you enjoy most after that. Knowing what it is you need to learn, knowing how to do things correctly, is key. Theory is much more important than practice in the beginning. Although you should be doing both all the time  I've been a programmer since 9 years old, but 90% of what I know about programming was only in the last few years. I'm 22 now. All the prior years of programming before getting a formal education have really just helped with problem solving speed, but most of it was wasted time, because I didn't have internet, and nobody told me how to do things properly. I too started when I was 9 years old and if you'd started on me with "functional decomposition" I'd have told you to bugger off-- I just wanted to make stick figures fight each other! I think that not putting the cart before the horse made me a better programmer, and possibly a better human. I learned how to think, not what to think. XD I started programming when i was 8 by typing in C64 basic listings from some magazine and then playing around with values and such, now i'm 30, know 10-15 different programming languages (of course not including stuff like HTML)... and i still only know 1/10th of what i'd love to know about programming and 1/100th of what there is to learn about it. As for learning programming, it's best to get an idea of what you want and then just implement it the easiest way you can find. It will be wrong, inefficient, unmaintainable and there will be a billion better ways to do it... but you started solving problems and that is what programming is about. Funny as it sounds, Programming is not about writing code, writing code is easy. Programming is about solving problems, solving problems is hard. You won't ever write perfect code but you will solve problems. Every year i see the code i wrote a year ago and think "What idiot wrote that code? It's all bad, inefficient, messy and wrong... oh, that was me...". Some important lessons i learned: 1. All assumptions will turn out wrong. 2. Don't use programming "tricks", write simple code even if it looks like it would be slow/inefficient/longer. 3. Don't be scared of using additional variables, reusing variables is BAD. If you happen to have a variable that does the same in the same scope you don't have enough functions/methods. 4. If you have a variable called tmp/$tmp/@tmp/%tmp, you are doing something wrong. 5. If you don't read books (those with paper) about programming voluntarily in your spare time, you are in the wrong job. Depends what programming tricks. I use map/tap/inject all the time. Instead of words = ["one", "two", "three"] result = new Array for each w in words result << w + ' sheep' end I can just do result = ["one", "two", "three"].map {|w| w + ' sheep'} You might think that the first one is more readable. However imagine that after doing this many many times in a file, the second one becomes more readable overall. + Show Spoiler + words = ["one", "two", "three"] result = new Array for each w in words result << w + ' sheep' end
words = ["one", "two", "three"] result = new Array for each w in words result << w + ' sheep' end
words = ["one", "two", "three"] result = new Array for each w in words result << w + ' sheep' end
words = ["one", "two", "three"] result = new Array for each w in words result << w + ' sheep' end
Is much less readable than just + Show Spoiler + result = ["one", "two", "three"].map {|w| w + ' sheep'}
result = ["one", "two", "three"].map {|w| w + ' sheep'}
result = ["one", "two", "three"].map {|w| w + ' sheep'}
result = ["one", "two", "three"].map {|w| w + ' sheep'}
Also, anyone that is familiar with the language, can just look at that and know what it does immediately. And its faster to read 1 line than 5 lines. I wouldn't really call using map or reduce or whatever other things like that "tricks", and I don't think thats what he was really referring to. Those are things that reduce cognitive load, not add to it (assuming you know what they do, but most people should probably know that by now or they haven't been keeping up). The "tricks" that he is referring to are things that allow you to drop your line count, variable count, etc. at the expense of readability and cognitive load. For instance, if we look at javascript, lets say you want to execute a function only if a particular variable is true. The "normal" way to do this is: if(myVar) { myFunc(); } But we can do this in one line! myVar && myFunc(); Is it worth it? Pretty much never.
Ah I see, thanks for clearing that up.
What about coalescing or null coalescing?
If often see people coalescing with a boolean return value, for "readability", which to me makes no sense.
So instead of going,
func finished? return game_score == 0 end
They will do
func finished? return gamescore == 0 ? true : false end
Ugh. lol.
Also i often use null coalescence instead of using control flow statements.
Instead of
if a == null b = 0 else b = a end
I do
b = a || 0
|
I tend to agree with your usages and do the same things. Using ternary operators to return a boolean expression identical to the result of what you're passing in is retarded (and I see it a fair amount at work and hate my life ).
My general rule for utilizing the null coalescence would be whether or not the first part forms a real statement on its own.
b = a || 0 checks out, because it is a statement that does something with or without the second part.
a || func() doesn't check out, because you wouldn't write a line of just:
a
|
Beginning with C makes you have to understand what you're working with rather precisely. I just hate coworkers who only know java/python/whatever, and then try to explain to me that "threads work wrong in C" when we have to use some in our current application, because they are used to using notions that have been encapsulated/simplified for the programmer by someone who actually understood what he was working with.
So yeah, if you're learning some basic programming just for fun, start with what suits you best and lets you have fun quickest. If you really want to get into it because programming is a passion and maybe even something to make a living out of, don't take the easy path...
@Azerbaijan : good luck on learning C, once you're done with the boring part of learning how it works manipulating strings and stuff, it gets really fun. Try to avoid using print/scanf in the beginning though, you've got read(2) and write(2), make you own functions  You can try to make your own printf function using varags : http://en.wikipedia.org/wiki/Stdarg.h
|
|
|
|