|
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 October 02 2013 12:15 Liquid`ixmike88 wrote: hi Hi mike, how's it going? You should play Brood War
|
|
|
+ Show Spoiler +On October 02 2013 09:52 sluggaslamoo wrote:On October 01 2013 15:21 Tobberoth wrote:Show nested quote +On October 01 2013 15:03 Abominous wrote:On October 01 2013 07:46 Kambing wrote:On October 01 2013 07:15 Abominous wrote:Back in the days, programming had scientific background, now kids fresh out of high school are typing lines of code knowing what it does but not why and how. Face it, programming has become trivial. Those two sentences contradict each other. If kids are writing code that they don't understand, then programming is far from trivial. What can be said is that, we're still learning how to effectively teach it when the ground underneath us changes rapidly. They understand the code, not the work behind it. And in todays world, 90% of programmers do not need to understand what's going on behind and why. Just like programmers in the old days didn't have to know exactly how a CPU is wired electronically. It's just another level of abstraction. It gives more power to programmers at lesser cost, but the actual problem-solving is the same. One the one hand, you can be pissed that someone can, for example, make a flash game more advanced that NES games with less than half the knowledge of the people making the actual NES games... on the other hand, you can appreciate that the programmers of those days could not make modern games with the tools at hand. Yeah, simple shit is easier to make today, but the difference between a bad and good programmer isn't shown in simple things. The level you have to perform at to be considered a really good programmer today has simply been raised, it's not enough to be able to do some sweet optimization on a sorting algorithm, you have to be able to juggle big code bases and far more calculations per second. Then why start with Java. Why not use Haskell? 1. Its a "higher level of abstraction" to Java. 2. You can write things with less code. 3. You can problem solve better with Haskell 4. You don't have to worry about memory management as much as Java Here's a quicksort implementation in Java Java + Show Spoiler + package de.vogella.algorithms.sort.quicksort;
public class Quicksort { private int[] numbers; private int number;
public void sort(int[] values) { if (values ==null || values.length==0){ return; } this.numbers = values; number = values.length; quicksort(0, number - 1); }
private void quicksort(int low, int high) { int i = low, j = high; int pivot = numbers[low + (high-low)/2];
while (i <= j) { while (numbers[i] < pivot) { i++; } while (numbers[j] > pivot) { j--; }
if (i <= j) { exchange(i, j); i++; j--; } }
if (low < j) quicksort(low, j); if (i < high) quicksort(i, high); }
private void exchange(int i, int j) { int temp = numbers[i]; numbers[i] = numbers[j]; numbers[j] = temp; } }
Here's the same function converted to Haskell qsort (p:xs) = qsort [x | x<-xs, x<p] ++ [p] ++ qsort [x | x<-xs, x>=p] Ok fine ill be nice quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater) where lesser = filter (< p) xs greater = filter (>= p) xs If you are going to mention that people shouldn't start on advanced concepts like functional programming as a beginner I am going to say well beginners shouldn't be starting with OO either for the exact same reason. If you are going to say the Haskell implementation is more complicated because as a beginner its too cryptic, well then lets look at something trivial like Hello world. Java class HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); // Display the string. } }
C main() { printf("Hello World"); }
Haskell putStrLn "Hello, World!" Note that Java is the most complicated of the lot. Note that it would take an equivalent amount of time to explain what "class" and "static void" mean, than it would to explain any terminology in Haskell. I'm not saying that we should use Haskell to teach beginners, I am showing the illogical reasoning behind teaching Java as a first language and exposing the silliness of the argument with the example of Haskell. I'm not saying people should learn how a CPU is wired, because you don't need to know that to program, however you need to know Structured Programming to write good OOP code. You don't use assembly or binary in programming, but you always use Structured Programming no matter what, and without learning Structured Programming you are missing out on an essential fundamental platform with which you should base all your programming on. I don't think that functional programming is any more advanced than imperative programming, and far far far simpler a concept than OO. It is just less common in business. I think it is great for a first language though. It lies much closer to the math that you would be learning at the same time and you getting comfortable with recursive functions will help you a lot when trying to wrap your head around many algorithms. I think it is important that people learn to both code at least one imperative language and one functional early on. They both expand your mind in different ways and help you think about problems and solutions differently. Being familiar with recursion and higher order functions can help you a lot even if you will never work with a purely functional language.
I'm not sure that Haskell is the best idea, if you do start with Haskell I think you should keep some of its features as well as lazy evaluation a secret to the students in the introductory course. Standard ML might be a better pick.
I think it is important, at least in a programming education of three years or longer, not to focus on specific languages but rather on concepts. Learn OO, rather than Java, learn functional programming rather than Haskell, learn database design rather than Oracle. Once you know a couple of languages and know all the important concepts, picking up a new language isn't that hard. You also can't be sure that the same languages that were popular when the course was planned, will be big and asked for in industry when students graduate, or 5-10 years after they graduate.
|
|
|
On October 02 2013 10:05 Kambing wrote:Show nested quote +On October 02 2013 09:52 sluggaslamoo wrote:On October 01 2013 15:21 Tobberoth wrote:On October 01 2013 15:03 Abominous wrote:On October 01 2013 07:46 Kambing wrote:On October 01 2013 07:15 Abominous wrote:Back in the days, programming had scientific background, now kids fresh out of high school are typing lines of code knowing what it does but not why and how. Face it, programming has become trivial. Those two sentences contradict each other. If kids are writing code that they don't understand, then programming is far from trivial. What can be said is that, we're still learning how to effectively teach it when the ground underneath us changes rapidly. They understand the code, not the work behind it. And in todays world, 90% of programmers do not need to understand what's going on behind and why. Just like programmers in the old days didn't have to know exactly how a CPU is wired electronically. It's just another level of abstraction. It gives more power to programmers at lesser cost, but the actual problem-solving is the same. One the one hand, you can be pissed that someone can, for example, make a flash game more advanced that NES games with less than half the knowledge of the people making the actual NES games... on the other hand, you can appreciate that the programmers of those days could not make modern games with the tools at hand. Yeah, simple shit is easier to make today, but the difference between a bad and good programmer isn't shown in simple things. The level you have to perform at to be considered a really good programmer today has simply been raised, it's not enough to be able to do some sweet optimization on a sorting algorithm, you have to be able to juggle big code bases and far more calculations per second. Then why start with Java. Why not use Haskell? 1. Its a "higher level of abstraction" to Java. 2. You can write things with less code. 3. You can problem solve better with Haskell 4. You don't have to worry about memory management as much as Java ... Some people would argue that Haskell meets those goals better than Java. For example, I would be in that camp. The problem is that Haskell is not as accepted in industry as Java (and other alternatives) which is a detriment for most people. This. Learning using haskell would make perfect sense if it was actually widely used in the industry. However, there are several more issues why Haskell would be worse than Java as a learning language.
1. Functional programming is far more different from classic procedural programming than OOP. If you learn Java first, you can learn C quite easily. If you learn haskell first, you'll probably be confused when you go to either C or Java. 2. Haskell might be shorter codewise than Java, but it's certainly not less complex. It's a complete copout to use the PutStr example since understanding of IO actions in Haskell takes longer learning than classes, static and hell, add in a huge part of the standard library as well. OOP is, countrary to popular belief it seems, actually not a difficult concept to grasp for beginners. Employees has a name and can say hello. I have two employees, one is named James, one is named Earl. When they say hello, they do it the same way but show different names. Cool, now you understand classes, objects, fields and methods.
What the goal of an introduction to programming is to have students who don't know how to program and get them to the point where they can experiment and learn on their own. Java is far better than C and haskell in this situation, because once you learn the basics of OOP, you can make full-on programs, with GUI, IO, networking etc. I'd say Python is a great contender as well, though Java is still stronger in the industry.
|
|
|
Get out dis is fo programmas
|
On October 02 2013 17:08 Tobberoth wrote:Show nested quote +On October 02 2013 10:05 Kambing wrote:On October 02 2013 09:52 sluggaslamoo wrote:On October 01 2013 15:21 Tobberoth wrote:On October 01 2013 15:03 Abominous wrote:On October 01 2013 07:46 Kambing wrote:On October 01 2013 07:15 Abominous wrote:Back in the days, programming had scientific background, now kids fresh out of high school are typing lines of code knowing what it does but not why and how. Face it, programming has become trivial. Those two sentences contradict each other. If kids are writing code that they don't understand, then programming is far from trivial. What can be said is that, we're still learning how to effectively teach it when the ground underneath us changes rapidly. They understand the code, not the work behind it. And in todays world, 90% of programmers do not need to understand what's going on behind and why. Just like programmers in the old days didn't have to know exactly how a CPU is wired electronically. It's just another level of abstraction. It gives more power to programmers at lesser cost, but the actual problem-solving is the same. One the one hand, you can be pissed that someone can, for example, make a flash game more advanced that NES games with less than half the knowledge of the people making the actual NES games... on the other hand, you can appreciate that the programmers of those days could not make modern games with the tools at hand. Yeah, simple shit is easier to make today, but the difference between a bad and good programmer isn't shown in simple things. The level you have to perform at to be considered a really good programmer today has simply been raised, it's not enough to be able to do some sweet optimization on a sorting algorithm, you have to be able to juggle big code bases and far more calculations per second. Then why start with Java. Why not use Haskell? 1. Its a "higher level of abstraction" to Java. 2. You can write things with less code. 3. You can problem solve better with Haskell 4. You don't have to worry about memory management as much as Java ... Some people would argue that Haskell meets those goals better than Java. For example, I would be in that camp. The problem is that Haskell is not as accepted in industry as Java (and other alternatives) which is a detriment for most people. This. Learning using haskell would make perfect sense if it was actually widely used in the industry. However, there are several more issues why Haskell would be worse than Java as a learning language. 1. Functional programming is far more different from classic procedural programming than OOP. If you learn Java first, you can learn C quite easily. If you learn haskell first, you'll probably be confused when you go to either C or Java. 2. Haskell might be shorter codewise than Java, but it's certainly not less complex. It's a complete copout to use the PutStr example since understanding of IO actions in Haskell takes longer learning than classes, static and hell, add in a huge part of the standard library as well. OOP is, countrary to popular belief it seems, actually not a difficult concept to grasp for beginners. Employees has a name and can say hello. I have two employees, one is named James, one is named Earl. When they say hello, they do it the same way but show different names. Cool, now you understand classes, objects, fields and methods. What the goal of an introduction to programming is to have students who don't know how to program and get them to the point where they can experiment and learn on their own. Java is far better than C and haskell in this situation, because once you learn the basics of OOP, you can make full-on programs, with GUI, IO, networking etc. I'd say Python is a great contender as well, though Java is still stronger in the industry.
I'm biased because I hate java but I think people learn a lot more faster if they start with C and then move to OOP (java,c++,c#). Java has some BIG errors implemented that are easy to overlook as beginners (similar to segfaul if you use pointers in C, except you're not required to in C) and really mess up your program, object copy and referencing being a big one. Especially if you're doing recursive functions, doing an object copy or undo the changes everytime you backtrack is a huge pain. Also, java has no support for overloading operators, I think thats a great feature of C++ and OOP.
|
On October 02 2013 17:52 CecilSunkure wrote: Get out dis is fo programmas
For a while I always read programming as progaming.
|
On October 02 2013 20:21 Blisse wrote:For a while I always read programming as progaming. I read both of those as programming lol...
Oh and thanks guys for that nice long discussion on C vs Java. It was a very interesting read, and it was nice to see your different points of view.
|
On October 02 2013 18:51 misirlou wrote:Show nested quote +On October 02 2013 17:08 Tobberoth wrote:On October 02 2013 10:05 Kambing wrote:On October 02 2013 09:52 sluggaslamoo wrote:On October 01 2013 15:21 Tobberoth wrote:On October 01 2013 15:03 Abominous wrote:On October 01 2013 07:46 Kambing wrote:On October 01 2013 07:15 Abominous wrote:Back in the days, programming had scientific background, now kids fresh out of high school are typing lines of code knowing what it does but not why and how. Face it, programming has become trivial. Those two sentences contradict each other. If kids are writing code that they don't understand, then programming is far from trivial. What can be said is that, we're still learning how to effectively teach it when the ground underneath us changes rapidly. They understand the code, not the work behind it. And in todays world, 90% of programmers do not need to understand what's going on behind and why. Just like programmers in the old days didn't have to know exactly how a CPU is wired electronically. It's just another level of abstraction. It gives more power to programmers at lesser cost, but the actual problem-solving is the same. One the one hand, you can be pissed that someone can, for example, make a flash game more advanced that NES games with less than half the knowledge of the people making the actual NES games... on the other hand, you can appreciate that the programmers of those days could not make modern games with the tools at hand. Yeah, simple shit is easier to make today, but the difference between a bad and good programmer isn't shown in simple things. The level you have to perform at to be considered a really good programmer today has simply been raised, it's not enough to be able to do some sweet optimization on a sorting algorithm, you have to be able to juggle big code bases and far more calculations per second. Then why start with Java. Why not use Haskell? 1. Its a "higher level of abstraction" to Java. 2. You can write things with less code. 3. You can problem solve better with Haskell 4. You don't have to worry about memory management as much as Java ... Some people would argue that Haskell meets those goals better than Java. For example, I would be in that camp. The problem is that Haskell is not as accepted in industry as Java (and other alternatives) which is a detriment for most people. This. Learning using haskell would make perfect sense if it was actually widely used in the industry. However, there are several more issues why Haskell would be worse than Java as a learning language. 1. Functional programming is far more different from classic procedural programming than OOP. If you learn Java first, you can learn C quite easily. If you learn haskell first, you'll probably be confused when you go to either C or Java. 2. Haskell might be shorter codewise than Java, but it's certainly not less complex. It's a complete copout to use the PutStr example since understanding of IO actions in Haskell takes longer learning than classes, static and hell, add in a huge part of the standard library as well. OOP is, countrary to popular belief it seems, actually not a difficult concept to grasp for beginners. Employees has a name and can say hello. I have two employees, one is named James, one is named Earl. When they say hello, they do it the same way but show different names. Cool, now you understand classes, objects, fields and methods. What the goal of an introduction to programming is to have students who don't know how to program and get them to the point where they can experiment and learn on their own. Java is far better than C and haskell in this situation, because once you learn the basics of OOP, you can make full-on programs, with GUI, IO, networking etc. I'd say Python is a great contender as well, though Java is still stronger in the industry. I'm biased because I hate java but I think people learn a lot more faster if they start with C and then move to OOP (java,c++,c#). Java has some BIG errors implemented that are easy to overlook as beginners (similar to segfaul if you use pointers in C, except you're not required to in C) and really mess up your program, object copy and referencing being a big one. Especially if you're doing recursive functions, doing an object copy or undo the changes everytime you backtrack is a huge pain. Also, java has no support for overloading operators, I think thats a great feature of C++ and OOP.
It's high time we ended up Java vs C discussion. If you want to develop software where performance & memory are crucial, use C. Otherwise, just use Java or HLL*. HLL inherently reduces accidental complexity such as bugs, coding, etc. In fact, it may even increase readability. Assembly vs C anyone? If you add OOP to the table, then complexity gets even more reduced by having Garbage Collection because you don't have to keep track of pointers.
It probably depends more on the compiler itself than HLL but you also get better type checking unlike C's case.
So by reducing the impact of accidental errors, you should end up with an easier to learn & use language.
*HLL = higher level language
Also to the topic:
Brooks' "No Silver Bullet"
High-level languages. Surely the most powerful stroke for software productivity, reliability, and simplicity has been the progressive use of high-level languages for programming. Most observers credit that development with at least a factor of five in productivity, and with concomitant gains in reliability, simplicity, and comprehensibility.
What does a high-level language accomplish? It frees a program from much of its accidental complexity. An abstract program consists of conceptual constructs: operations, data types, sequences, and communication. The concrete machine program is concerned with bits, registers, conditions, branches, channels, disks, and such. To the extent that the high-level language embodies the constructs one wants in the abstract program and avoids all lower ones, it eliminates a whole level of complexity that was never inherent in the program at all.
The most a high-level language can do is to furnish all the constructs that the programmer imagines in the abstract program. To be sure, the level of our thinking about data structures, data types, and operations is steadily rising, but at an ever decreasing rate. And language development approaches closer and closer to the sophistication of users.
Moreover, at some point the elaboration of a high-level language creates a tool-mastery burden that increases, not reduces, the intellectual task of the user who rarely uses the esoteric constructs.
Source: http://www.cs.nott.ac.uk/~cah/G51ISS/Documents/NoSilverBullet.html
|
On October 02 2013 21:36 3FFA wrote:Show nested quote +On October 02 2013 20:21 Blisse wrote:On October 02 2013 17:52 CecilSunkure wrote: Get out dis is fo programmas For a while I always read programming as progaming. I read both of those as programming lol... Oh and thanks guys for that nice long discussion on C vs Java. It was a very interesting read, and it was nice to see your different points of view. When I first came to TL, I read progaming exclusively as programming. So, I thought Flash was a programmer, and I assumed from context, that people called him that because he played games on TV, i.e. television programs. Back then, the thing was, you weren't a progamer unless you were on TV, so it made perfect sense
|
Has anyone tried using Visual Prolog? Any thoughts - advantages, disadvantages? I got interested in it for being a logic language.
|
On October 02 2013 17:08 Tobberoth wrote:Show nested quote +On October 02 2013 10:05 Kambing wrote:On October 02 2013 09:52 sluggaslamoo wrote:On October 01 2013 15:21 Tobberoth wrote:On October 01 2013 15:03 Abominous wrote:On October 01 2013 07:46 Kambing wrote:On October 01 2013 07:15 Abominous wrote:Back in the days, programming had scientific background, now kids fresh out of high school are typing lines of code knowing what it does but not why and how. Face it, programming has become trivial. Those two sentences contradict each other. If kids are writing code that they don't understand, then programming is far from trivial. What can be said is that, we're still learning how to effectively teach it when the ground underneath us changes rapidly. They understand the code, not the work behind it. And in todays world, 90% of programmers do not need to understand what's going on behind and why. Just like programmers in the old days didn't have to know exactly how a CPU is wired electronically. It's just another level of abstraction. It gives more power to programmers at lesser cost, but the actual problem-solving is the same. One the one hand, you can be pissed that someone can, for example, make a flash game more advanced that NES games with less than half the knowledge of the people making the actual NES games... on the other hand, you can appreciate that the programmers of those days could not make modern games with the tools at hand. Yeah, simple shit is easier to make today, but the difference between a bad and good programmer isn't shown in simple things. The level you have to perform at to be considered a really good programmer today has simply been raised, it's not enough to be able to do some sweet optimization on a sorting algorithm, you have to be able to juggle big code bases and far more calculations per second. Then why start with Java. Why not use Haskell? 1. Its a "higher level of abstraction" to Java. 2. You can write things with less code. 3. You can problem solve better with Haskell 4. You don't have to worry about memory management as much as Java ... Some people would argue that Haskell meets those goals better than Java. For example, I would be in that camp. The problem is that Haskell is not as accepted in industry as Java (and other alternatives) which is a detriment for most people. This. Learning using haskell would make perfect sense if it was actually widely used in the industry. However, there are several more issues why Haskell would be worse than Java as a learning language. 1. Functional programming is far more different from classic procedural programming than OOP. If you learn Java first, you can learn C quite easily. If you learn haskell first, you'll probably be confused when you go to either C or Java. 2. Haskell might be shorter codewise than Java, but it's certainly not less complex. It's a complete copout to use the PutStr example since understanding of IO actions in Haskell takes longer learning than classes, static and hell, add in a huge part of the standard library as well. OOP is, countrary to popular belief it seems, actually not a difficult concept to grasp for beginners. Employees has a name and can say hello. I have two employees, one is named James, one is named Earl. When they say hello, they do it the same way but show different names. Cool, now you understand classes, objects, fields and methods. What the goal of an introduction to programming is to have students who don't know how to program and get them to the point where they can experiment and learn on their own. Java is far better than C and haskell in this situation, because once you learn the basics of OOP, you can make full-on programs, with GUI, IO, networking etc. I'd say Python is a great contender as well, though Java is still stronger in the industry.
Its popular belief because it is a difficult concept to grasp.
http://www.netgore.com/sites/default/files/ObjectOrientedProgramming.pdf
Structured programming took me about 6 months to master. Once you learn the concepts of functional decomposition, expression and abstraction you are 90% of the way there. OOP about 3 years to get to the point where I actually wrote clean code (of course when I started I thought I was writing clean code, then I look back on it years later and realise it was terrible). That journal was written after 6 months of learning OOP, if I were to write it again it would be completely different.
|
On October 02 2013 17:52 CecilSunkure wrote: Get out dis is fo programmas
thats me
|
On October 03 2013 08:50 sluggaslamoo wrote:Show nested quote +On October 02 2013 17:08 Tobberoth wrote:On October 02 2013 10:05 Kambing wrote:On October 02 2013 09:52 sluggaslamoo wrote:On October 01 2013 15:21 Tobberoth wrote:On October 01 2013 15:03 Abominous wrote:On October 01 2013 07:46 Kambing wrote:On October 01 2013 07:15 Abominous wrote:Back in the days, programming had scientific background, now kids fresh out of high school are typing lines of code knowing what it does but not why and how. Face it, programming has become trivial. Those two sentences contradict each other. If kids are writing code that they don't understand, then programming is far from trivial. What can be said is that, we're still learning how to effectively teach it when the ground underneath us changes rapidly. They understand the code, not the work behind it. And in todays world, 90% of programmers do not need to understand what's going on behind and why. Just like programmers in the old days didn't have to know exactly how a CPU is wired electronically. It's just another level of abstraction. It gives more power to programmers at lesser cost, but the actual problem-solving is the same. One the one hand, you can be pissed that someone can, for example, make a flash game more advanced that NES games with less than half the knowledge of the people making the actual NES games... on the other hand, you can appreciate that the programmers of those days could not make modern games with the tools at hand. Yeah, simple shit is easier to make today, but the difference between a bad and good programmer isn't shown in simple things. The level you have to perform at to be considered a really good programmer today has simply been raised, it's not enough to be able to do some sweet optimization on a sorting algorithm, you have to be able to juggle big code bases and far more calculations per second. Then why start with Java. Why not use Haskell? 1. Its a "higher level of abstraction" to Java. 2. You can write things with less code. 3. You can problem solve better with Haskell 4. You don't have to worry about memory management as much as Java ... Some people would argue that Haskell meets those goals better than Java. For example, I would be in that camp. The problem is that Haskell is not as accepted in industry as Java (and other alternatives) which is a detriment for most people. This. Learning using haskell would make perfect sense if it was actually widely used in the industry. However, there are several more issues why Haskell would be worse than Java as a learning language. 1. Functional programming is far more different from classic procedural programming than OOP. If you learn Java first, you can learn C quite easily. If you learn haskell first, you'll probably be confused when you go to either C or Java. 2. Haskell might be shorter codewise than Java, but it's certainly not less complex. It's a complete copout to use the PutStr example since understanding of IO actions in Haskell takes longer learning than classes, static and hell, add in a huge part of the standard library as well. OOP is, countrary to popular belief it seems, actually not a difficult concept to grasp for beginners. Employees has a name and can say hello. I have two employees, one is named James, one is named Earl. When they say hello, they do it the same way but show different names. Cool, now you understand classes, objects, fields and methods. What the goal of an introduction to programming is to have students who don't know how to program and get them to the point where they can experiment and learn on their own. Java is far better than C and haskell in this situation, because once you learn the basics of OOP, you can make full-on programs, with GUI, IO, networking etc. I'd say Python is a great contender as well, though Java is still stronger in the industry. Its popular belief because it is a difficult concept to grasp. http://www.netgore.com/sites/default/files/ObjectOrientedProgramming.pdfStructured programming took me about 6 months to master. Once you learn the concepts of functional decomposition, expression and abstraction you are 90% of the way there. OOP about 3 years to get to the point where I actually wrote clean code (of course when I started I thought I was writing clean code, then I look back on it years later and realise it was terrible). That journal was written after 6 months of learning OOP, if I were to write it again it would be completely different. ah memories. when I look back on my high school days and every var was called i1,i2,i3,str1,str2,str3,x1,x2,y1,y2 and I managed to not get turned around, so it was good standard.  Yeah I have to agree with you, I use OOP for 5 years (1 high school + 4 college) and everytime I turn in a project I find something new that I was not doing/doing wrong in OOP, feeling I am still a long way from mastering it. But I also agree it's very easy to understand the principle.
The truth is every language has it's purpose and if your purpose is readability you go for a higher language and if you want performance you go for a lower.
|
On October 03 2013 09:21 misirlou wrote:Show nested quote +On October 03 2013 08:50 sluggaslamoo wrote:On October 02 2013 17:08 Tobberoth wrote:On October 02 2013 10:05 Kambing wrote:On October 02 2013 09:52 sluggaslamoo wrote:On October 01 2013 15:21 Tobberoth wrote:On October 01 2013 15:03 Abominous wrote:On October 01 2013 07:46 Kambing wrote:On October 01 2013 07:15 Abominous wrote:Back in the days, programming had scientific background, now kids fresh out of high school are typing lines of code knowing what it does but not why and how. Face it, programming has become trivial. Those two sentences contradict each other. If kids are writing code that they don't understand, then programming is far from trivial. What can be said is that, we're still learning how to effectively teach it when the ground underneath us changes rapidly. They understand the code, not the work behind it. And in todays world, 90% of programmers do not need to understand what's going on behind and why. Just like programmers in the old days didn't have to know exactly how a CPU is wired electronically. It's just another level of abstraction. It gives more power to programmers at lesser cost, but the actual problem-solving is the same. One the one hand, you can be pissed that someone can, for example, make a flash game more advanced that NES games with less than half the knowledge of the people making the actual NES games... on the other hand, you can appreciate that the programmers of those days could not make modern games with the tools at hand. Yeah, simple shit is easier to make today, but the difference between a bad and good programmer isn't shown in simple things. The level you have to perform at to be considered a really good programmer today has simply been raised, it's not enough to be able to do some sweet optimization on a sorting algorithm, you have to be able to juggle big code bases and far more calculations per second. Then why start with Java. Why not use Haskell? 1. Its a "higher level of abstraction" to Java. 2. You can write things with less code. 3. You can problem solve better with Haskell 4. You don't have to worry about memory management as much as Java ... Some people would argue that Haskell meets those goals better than Java. For example, I would be in that camp. The problem is that Haskell is not as accepted in industry as Java (and other alternatives) which is a detriment for most people. This. Learning using haskell would make perfect sense if it was actually widely used in the industry. However, there are several more issues why Haskell would be worse than Java as a learning language. 1. Functional programming is far more different from classic procedural programming than OOP. If you learn Java first, you can learn C quite easily. If you learn haskell first, you'll probably be confused when you go to either C or Java. 2. Haskell might be shorter codewise than Java, but it's certainly not less complex. It's a complete copout to use the PutStr example since understanding of IO actions in Haskell takes longer learning than classes, static and hell, add in a huge part of the standard library as well. OOP is, countrary to popular belief it seems, actually not a difficult concept to grasp for beginners. Employees has a name and can say hello. I have two employees, one is named James, one is named Earl. When they say hello, they do it the same way but show different names. Cool, now you understand classes, objects, fields and methods. What the goal of an introduction to programming is to have students who don't know how to program and get them to the point where they can experiment and learn on their own. Java is far better than C and haskell in this situation, because once you learn the basics of OOP, you can make full-on programs, with GUI, IO, networking etc. I'd say Python is a great contender as well, though Java is still stronger in the industry. Its popular belief because it is a difficult concept to grasp. http://www.netgore.com/sites/default/files/ObjectOrientedProgramming.pdfStructured programming took me about 6 months to master. Once you learn the concepts of functional decomposition, expression and abstraction you are 90% of the way there. OOP about 3 years to get to the point where I actually wrote clean code (of course when I started I thought I was writing clean code, then I look back on it years later and realise it was terrible). That journal was written after 6 months of learning OOP, if I were to write it again it would be completely different. ah memories. when I look back on my high school days and every var was called i1,i2,i3,str1,str2,str3,x1,x2,y1,y2 and I managed to not get turned around, so it was good standard.  Yeah I have to agree with you, I use OOP for 5 years (1 high school + 4 college) and everytime I turn in a project I find something new that I was not doing/doing wrong in OOP, feeling I am still a long way from mastering it. But I also agree it's very easy to understand the principle. The truth is every language has it's purpose and if your purpose is readability you go for a higher language and if you want performance you go for a lower.
Could you demonstrate an example of a common OOP mistake you made in HS and how you would write it differently now, just for my HS eyes?
|
On October 03 2013 04:09 Roe wrote: Has anyone tried using Visual Prolog? Any thoughts - advantages, disadvantages? I got interested in it for being a logic language.
Prolog is great for particular domains that are amendable to constraint solving, e.g., scheduling systems. For building general-purpose programs, though, not so much. Visual Prolog tries to address that point in the context of Windows, but afaik it doesn't succeed terribly well at that.
|
On October 03 2013 10:54 3FFA wrote:Show nested quote +On October 03 2013 09:21 misirlou wrote:On October 03 2013 08:50 sluggaslamoo wrote:On October 02 2013 17:08 Tobberoth wrote:On October 02 2013 10:05 Kambing wrote:On October 02 2013 09:52 sluggaslamoo wrote:On October 01 2013 15:21 Tobberoth wrote:On October 01 2013 15:03 Abominous wrote:On October 01 2013 07:46 Kambing wrote:On October 01 2013 07:15 Abominous wrote:Back in the days, programming had scientific background, now kids fresh out of high school are typing lines of code knowing what it does but not why and how. Face it, programming has become trivial. Those two sentences contradict each other. If kids are writing code that they don't understand, then programming is far from trivial. What can be said is that, we're still learning how to effectively teach it when the ground underneath us changes rapidly. They understand the code, not the work behind it. And in todays world, 90% of programmers do not need to understand what's going on behind and why. Just like programmers in the old days didn't have to know exactly how a CPU is wired electronically. It's just another level of abstraction. It gives more power to programmers at lesser cost, but the actual problem-solving is the same. One the one hand, you can be pissed that someone can, for example, make a flash game more advanced that NES games with less than half the knowledge of the people making the actual NES games... on the other hand, you can appreciate that the programmers of those days could not make modern games with the tools at hand. Yeah, simple shit is easier to make today, but the difference between a bad and good programmer isn't shown in simple things. The level you have to perform at to be considered a really good programmer today has simply been raised, it's not enough to be able to do some sweet optimization on a sorting algorithm, you have to be able to juggle big code bases and far more calculations per second. Then why start with Java. Why not use Haskell? 1. Its a "higher level of abstraction" to Java. 2. You can write things with less code. 3. You can problem solve better with Haskell 4. You don't have to worry about memory management as much as Java ... Some people would argue that Haskell meets those goals better than Java. For example, I would be in that camp. The problem is that Haskell is not as accepted in industry as Java (and other alternatives) which is a detriment for most people. This. Learning using haskell would make perfect sense if it was actually widely used in the industry. However, there are several more issues why Haskell would be worse than Java as a learning language. 1. Functional programming is far more different from classic procedural programming than OOP. If you learn Java first, you can learn C quite easily. If you learn haskell first, you'll probably be confused when you go to either C or Java. 2. Haskell might be shorter codewise than Java, but it's certainly not less complex. It's a complete copout to use the PutStr example since understanding of IO actions in Haskell takes longer learning than classes, static and hell, add in a huge part of the standard library as well. OOP is, countrary to popular belief it seems, actually not a difficult concept to grasp for beginners. Employees has a name and can say hello. I have two employees, one is named James, one is named Earl. When they say hello, they do it the same way but show different names. Cool, now you understand classes, objects, fields and methods. What the goal of an introduction to programming is to have students who don't know how to program and get them to the point where they can experiment and learn on their own. Java is far better than C and haskell in this situation, because once you learn the basics of OOP, you can make full-on programs, with GUI, IO, networking etc. I'd say Python is a great contender as well, though Java is still stronger in the industry. Its popular belief because it is a difficult concept to grasp. http://www.netgore.com/sites/default/files/ObjectOrientedProgramming.pdfStructured programming took me about 6 months to master. Once you learn the concepts of functional decomposition, expression and abstraction you are 90% of the way there. OOP about 3 years to get to the point where I actually wrote clean code (of course when I started I thought I was writing clean code, then I look back on it years later and realise it was terrible). That journal was written after 6 months of learning OOP, if I were to write it again it would be completely different. ah memories. when I look back on my high school days and every var was called i1,i2,i3,str1,str2,str3,x1,x2,y1,y2 and I managed to not get turned around, so it was good standard.  Yeah I have to agree with you, I use OOP for 5 years (1 high school + 4 college) and everytime I turn in a project I find something new that I was not doing/doing wrong in OOP, feeling I am still a long way from mastering it. But I also agree it's very easy to understand the principle. The truth is every language has it's purpose and if your purpose is readability you go for a higher language and if you want performance you go for a lower. Could you demonstrate an example of a common OOP mistake you made in HS and how you would write it differently now, just for my HS eyes? 
Not sure if you're asking both of us but just in case you wanted my input... 
For me when I initially started delving into OOP books and Responsibility Driven Design, it was over-engineering the design of objects and object decomposition and thinking way too hard. I would spend hours figuring out the best layout of my new project. Now I don't even bother to design the overall layout of my program and somehow end up with a much simpler and easier to maintain program.
That's not to say that the core principles of OOP (Abstraction, Encapsulation, Polymorphism, Inheritance) and RDD aren't important, its that these principles work much better when you use them on the fly.
Its not that learning these concepts help you design better, its that you often fall into common patterns which these concepts help you to fix much more quickly. For example if you have a lot of like objects, you will immediately think of using a base class that these objects can inherit from to reduce the size of your code base. Without learning about inheritance, you will not only waste time reinventing the wheel, but you will also have an inferior solution.
Its like the old saying 'When you are given a hammer, everything turns into a nail'. When you learn new concepts in OOP, you always feel like you HAVE to use them. The advantages of certain features of OO should only be used when you really need them, they are much more specific than you think.
For example don't use inheritance to plan for the future, use inheritance ONLY if you can see the benefits of it RIGHT NOW, if its not immediately making your code base smaller, don't use it, you can always do it later. Refactoring > Designing.
Sometimes I see people design big vertical inheritance hierarchies and end up with really fragile programs, when they could have just used one robust concrete base class with half the code, a quarter of the time, and half the headaches to maintain.
If you think too far ahead you end up writing way too much boiler plate and getting locked into a framework which you realise later doesn't fit well with what you wanted. So the idea should be that you should spend a lot of time learning the principles and how to design, but when it comes to coding, be in the present.
http://en.wikipedia.org/wiki/You_aren't_gonna_need_it
|
|
|
|
|
|