1
0

Teaching everyone to code is delusional


 invite response                
2015 Jan 1, 5:45am   19,704 views  71 comments

by Heraclitusstudent   ➕follow (8)   💰tip   ignore  

http://singularityhub.com/2014/12/28/future-of-work-part-ii-why-teaching-everyone-to-code-is-delusional/

Since 2005, Ive been grappling with the issue of what to teach young people. Ive written curricula for junior high students in the US, for a UNICEF program reaching students in a dozen countries, and now, for East African young people as they become financially literate and business savvy. Through the years, Ive watched program directors demand young people focus on foolish content because it lined up with something trending in the public discourseunits on climate change; modules about using social media to share stories; lessons on agricultural policy; and so forth. What have I learned? The attention of a...

« First        Comments 33 - 71 of 71        Search these comments

33   Dan8267   2015 Jan 1, 1:48pm  

Peter P says

There is no type inference in C/C++/C#/Java and it is tedious to repeat type declaration everywhere. Scala is much better at this.

Sure, there is room for syntactical improvement, but typing has never been the bottleneck of programming. Debugging is. So it's a bad tradeoff to accept hours of debugging a problem that would not even occur if the code is clearer even if that means being a bit more verbose.

Peter P says

However, sometimes it is hard to avoid covariance/contravariance oddities in the generics.

Whenever there is a problem with variance, it is because the developer is doing something wrong. Usually it's an old mistake that has become habit.

Peter P says

Is there a stable IDE yet?

I don't know. I've been doing .NET mostly the past few years. However, it's most likely that you'd get the best experience from Eclipse, which is an awesome IDE. I don't know if anyone has written a commercial grade and free Eclipse plugin for Scala, but hey, you could be the first. Eclipse can compile anything if you give it a compiler that follows the Eclipse plugin model. Eclipse is highly extensible.

Personally, I've always felt that the weak point in software development has always been the software between the ears. Good developers are exponentially better than mediocre ones because good developers are clear thinkers who can build good mental models of the solution they are trying to build before writing a single line of code.

34   Peter P   2015 Jan 1, 2:02pm  

Dan8267 says

So it's a bad tradeoff to accept hours of debugging a problem that would not even occur if the code is clearer even if that means being a bit more verbose.

It is fine with simple classes but type inference is absolutely necessary when you allow the type to be a function of a double and an integer returning a String. :-)

Type inference allows safety and readability to coexist. Also, a rich type system can detect many potential issues statically.

Dan8267 says

Whenever there is a problem with variance, it is because the developer is doing something wrong. Usually it's an old mistake that has become habit.

Usually it happens in API design when usage is hard to anticipate.

.Net has better support of generics than Java.

Dan8267 says

However, it's most likely that you'd get the best experience from Eclipse, which is an awesome IDE.

I hate Eclipse. I much prefer IntelliJ. It does have a Scala plugin which I have not tried recently.

Modern languages like Scala can really use a good IDE for things like refactoring and inspection.

Dan8267 says

Personally, I've always felt that the weak point in software development has always been the software between the ears.

Of course, but Java and C# allow mediocre programmers to be employable and semi-productive. :-)

They would have negative productivity with C/C++.

35   mell   2015 Jan 1, 2:22pm  

Peter P says

Is there a stable IDE yet?

IntelliJ is supposed to be the best, but Eclipse has actually quite matured by now. Luna with the Scala IDE is bearable, which is definitely a big step. Scala is not easy for IDEs to adapt, the compiler still takes quite a while although incremental compiling cuts down on it, and sbt still sucks. I prefer old-school Maven 3 for project and dependency management, or grade/Ivy.

36   Peter P   2015 Jan 1, 2:27pm  

mell says

Scala is not easy for IDEs to adapt, the compiler still takes quite a while although incremental compiling cuts down on it, and sbt still sucks.

Yeah, I bet it is a monster to implement tools for. Ironically, Scala is much less compelling without a good IDE.

37   Dan8267   2015 Jan 1, 3:11pm  

Peter P says

It is fine with simple classes but type inference is absolutely necessary when you allow the type to be a function of a double and an integer returning a String. :-)

Type inference allows safety and readability to coexist. Also, a rich type system can detect many potential issues statically.

Type inference is just syntactical sugar. It doesn't change the rules of how things are called and what gets passed to methods.

In my opinion, type inference just makes code less readable. For example,

var age = CalculateAge(subject);

may be shorter than the following

DogAge age = CalculateAge <Dog> (subject);
HumanAge age = CalculateAge <Human> (subject);
int age = CalculateAge(subject);
decimal age = CalculateAge(subject);

where
enum DogAge = {puppy, youngAdult, oldAdult};
enum HumanAge = {baby, toddler, child, adolescent, youngAdult, middleAge, senior};

but how is the first line, var age=CalculateAge(subject), more readable other than being shorter. If you don't know what CalculateAge is returning or which overload of CalculateAge is being called, then it's less readable and you are more likely to make a mistake in interpreting the code.

Worse yet are languages that allow the type to be changed like JavaScript. Then you don't know if integer or floating point arithmetic or even string concatenation is being used. Can you tell what the line below prints?

var years = GetYearsSinceEpoch1900(DateTime.Now);
output.Print(years + 1900);

It could just as easily print "1151900" as it could print "2015". Now change the var to int or String and now it's obvious.

I prefer the ideologue of clarity over brevity expressed in the phrase "always be explicit". Scala, from what I've read and watched, is inconsistent in this principle.

38   Dan8267   2015 Jan 1, 3:31pm  

Peter P says

Usually it happens in API design when usage is hard to anticipate.

Ah, but API design is pretty much all of programming. When you are calling your own API or your coworkers are or a third party is, software design is essentially API design.

There is a school of thought that says the first time you solve the problem it is just to understand the problem and you should throw away your solution. The second time you solve the problem, you'll have the right solution.

Peter P says

.Net has better support of generics than Java.

How so? I've found them to be about on par.

Peter P says

Of course, but Java and C# allow mediocre programmers to be employable and semi-productive

There are mediocre programmers everywhere. It has been my observation that most tend to stay away from Java and C# and prefer languages like Visual Basic, Perl, JavaScript.

Peter P says

They would have negative productivity with C/C++.

Unless you are doing embedded programming or have to interact with a legacy system, there is no point in doing C or C++. To some degree they were necessary to call unmanaged, OS-native libraries through JNI or "unsafe code" in .NET, but today that's largely unnecessary.

Kernighan and Ritchie C was terrible even in basic syntax. It took ANSI over a decade to finally get ANSI C into a decent language, whose main value was being a high-level version of assembly language, hence it's usefulness when interacting directly with hardware. But unless your doing that, there's no point in C anymore.

There's even less point in C++ as it's a mediocre object-oriented language and it's obsolete. Both Java and .NET are/have much better language and both are managed platforms, which is much more useful.

Finally, there is no reason to take pride in knowing C or C++ instead of their modern counterparts. It doesn't make you a better programmer to write lower-level code. Sure, you have to understand how sorting, graphics, databases, filesystems, etc. work, but there's no point in reinventing the wheel. Writing function pointers in C doesn't make you a guru. And this is coming from someone who not only mastered C and C++ 30+ years ago, but also had no problem writing in 80x86 assembly language.

.NET and Java aren't kiddy toys. They are the predominant platforms of the Internet, and there are damn good reasons why. I have yet to see anything other than low-level hardware code that can be implemented easily or elegantly in any other language that couldn't be implemented easily or elegantly in .NET or Java. (One caveat: String to enum conversion is better in Java.)

Of course, I'm always willing to look at an example.

39   lostand confused   2015 Jan 1, 3:42pm  

Why would anyone want to code in this day of offshoring and H1Bs. Sure you need some to clean up the work after them-but its heyday is gone.

40   Rin   2015 Jan 1, 4:02pm  

Dan8267 says

And this is coming from someone who not only mastered C and C++ 30+ years ago

I'm afraid to ask, but how old are you?

As a toddler, I was not interested in academia ... just in playing with toys. Then, I'd started reading about history, archeology, etc. My true interest in the sciences, started after the 5th grade.

41   Dan8267   2015 Jan 2, 1:00am  

I'm in my 30s. I wrote my first program at the age of 7 about five minutes into touching a computer for the first time.

42   mell   2015 Jan 2, 1:30am  

Dan8267 says

Peter P says

.Net has better support of generics than Java.

How so? I've found them to be about on par.

Their implementation is entirely different, C# does not erase the runtime generic types and allows for full runtime type introspection while Java is using type erasure for compatibility reasons and thus type-casts at runtime. Syntax-wise I find the Java wildcard style for expressing upper and lower bounds more elegant.

Dan8267 says

.NET and Java aren't kiddy toys. They are the predominant platforms of the Internet, and there are damn good reasons why. I have yet to see anything other than low-level hardware code that can be implemented easily or elegantly in any other language that couldn't be implemented easily or elegantly in .NET or Java. (One caveat: String to enum conversion is better in Java.)

WRT stability this is certainly true, but you can achieve similar or better stability with less code for example using scala, where you can mix Java syntax and more advanced functional concepts to significantly shorten the code and, more importantly, make it entirely immutable/stateless, which reduces bugs/side-effects. The drawback is that if you get too fancy your readability may suffer with scala and if you have attrition and suddenly a significant bug shows up, then you will have a hard time finding developers than can pick up, maintain and improve legacy code.

43   Rin   2015 Jan 2, 1:58am  

Dan8267 says

I'm in my 30s. I wrote my first program at the age of 7 about five minutes into touching a computer for the first time.

I see, I guess I was more a history buff, as a kid, reading about the Revolutionary War, General MacArthur, Ancient Egypt, etc, before anyone else I knew was into those subjects.

It was watching Star Wars, on video, when my interest in science was piqued. Then, I'd started reading about chemistry, physics, etc. I should have started with computers, since those were already invented. The lightsaber would have to wait for another century or two.

44   Y   2015 Jan 2, 2:04am  

Agreed. Enums are more efficient at making code readable...ie:

enum SBH = {shiteater, shitwiper, eaterofshit, posterofshitpix, enthralledwithshit, lovesshityeteternallyconstipated};

Dan8267 says

where

enum DogAge = {puppy, youngAdult, oldAdult};

enum HumanAge = {baby, toddler, child, adolescent, youngAdult, middleAge, senior};

45   Peter P   2015 Jan 2, 2:19am  

Dan8267 says

There's even less point in C++ as it's a mediocre object-oriented language and it's obsolete. Both Java and .NET are/have much better language and both are managed platforms, which is much more useful.

I am not a fan of C++, but it is a rather extensible language. It has TWO meta-programming facilities: macros and templates.

C++ relies heavily on the libraries for functionality. STL and Boost kept it relevant through time.

Dan8267 says

Type inference is just syntactical sugar. It doesn't change the rules of how things are called and what gets passed to methods.

True, but a rich type system is much more elaborate. It provides for complex type calculations at compile time. For example, it can enforce Unit of Measurement constraints.

Most type-inference systems allow you to declare the type explicitly. So the clarity is there if you choose. However, since the type of a variable is statically known, you can just leave it out. It would also be trivial for the IDE to annotate full type information.

46   SJ   2015 Jan 2, 2:20am  

Scala is promising and popular for big data. Have any of you used the Netbeans IDE? It's pretty easy to use compared to Eclipse. As for coding, it's useful to know for building ones own software not as a career.

47   Peter P   2015 Jan 2, 2:22am  

Dan8267 says

.NET and Java aren't kiddy toys. They are the predominant platforms of the Internet, and there are damn good reasons why. I have yet to see anything other than low-level hardware code that can be implemented easily or elegantly in any other language that couldn't be implemented easily or elegantly in .NET or Java. (One caveat: String to enum conversion is better in Java.)

Agreed. Java is just marginally slower. One can easily throw money at machines and save on development/debugging costs.

C++ is too slow for many things. High-frequency trading is one example. You really should be doing FPGA or ASIC with a customized network stack.

48   Peter P   2015 Jan 2, 2:27am  

SJ says

Scala is promising and popular for big data. Have any of you used the Netbeans IDE? It's pretty easy to use compared to Eclipse. As for coding, it's useful to know for building ones own software not as a career.

I would stick with IntelliJ.

Have you checked out Kotlin?

http://en.wikipedia.org/wiki/Kotlin_%28programming_language%29

It is not nearly as big as Scala.

49   Dan8267   2015 Jan 2, 2:45am  

mell says

Their implementation is entirely different, C# does not erase the runtime generic types and allows for full runtime type introspection while Java is using type erasure for compatibility reasons and thus type-casts at runtime.

Exactly my point. One of damn few differences between C# and Java reflection is type erasure, and that’s utterly insignificant. To call the implementations “totally different” because of type erasure is ridiculous.

I’ve been doing Java programming since 1995 including intensive reflection and there has been only one time when I actually needed the type information included and then it was trivially easy to add that type information by including an instance of java.lang.class. Moreover, this solution was obvious. So I cannot consider the exclusion of type information in the Java class format to be a big deal or a significant difference in the reflection API. You have a simple opt-in mechanism for including type information.

mell says

scala

My view on Scala is that it is simply trying to be the next major revision of Java. Personally, I’d prefer if the good parts of Scala were simply rolled into Java 9 or 10. Yeah it would break backwards compatibility, but far less so than having a different platform altogether. That would be far more disruptive than simply stating that Java 10 and up apps have to run on JRE 10 and up. I see no point in having to switch an entire platform rather than rolling a few new features into an established platform even if it means a compatibility break.

50   Tenpoundbass   2015 Jan 2, 2:49am  

Knock knock!

Who's there?

...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Java

51   Dan8267   2015 Jan 2, 2:51am  

1995 called and wants its joke back. It's been 15 years since Java performance has sucked. Maybe you should be examining your code rather than what the compiler produces.

52   Peter P   2015 Jan 2, 2:53am  

Any reasonable language should not have the concept of null. At least it must have null-safety at compile time.

In programming, every small thing is trivial, but the code will look ugly.

53   Peter P   2015 Jan 2, 3:02am  

Dan8267 says

My view on Scala is that it is simply trying to be the next major revision of Java.

Doubtful. The philosophy is quite different on many fronts. It even attempts to tackle multiple inheritance! And path-dependent types? :-)

Kotlin probably tries to be a better Java. It is much less ambitious.

54   Peter P   2015 Jan 2, 3:05am  

Dan8267 says

I’ve been doing Java programming since 1995 including intensive reflection

I hope you did not have to rely too much on reflection in 1995. Performance used to suck. It is very good now, of course.

Groovy/Grails uses JVM reflection extensively.

55   Tenpoundbass   2015 Jan 2, 3:34am  

Dan8267 says

1995 called and wants its joke back. It's been 15 years since Java performance has sucked. Maybe you should be examining your code rather than what the compiler produces.

I'm just going by that Conectra VPN software a lot of clueless IT shops make you use. Where your Java updates from time to time and breaks it then you get spend hours with their tech support trying to convince them that their Server software is out of date.

Then after I finally get it working. Yes I still get the Java Fuck you few moments of do nothingness before it starts working. Java sucks BALL!
It always has and always will.

56   Dan8267   2015 Jan 2, 3:56am  

Peter P says

Any reasonable language should not have the concept of null. At least it must have null-safety at compile time.

I've been saying that for years. Microsoft almost did something awesome when they introduced the ? token and the ?? operation. Unfortunately, they had the wrong motivation and didn't take the idea far enough.

Java was a pure object-oriented language to begin with, that is, everything is an object or a primitive, and the primitives (integers, floating points, and such) all had corresponding classes. For ease of use Java later introduced auto-boxing and auto-unboxing so that programmers did not have to explicitly convert between primitives and objects.

Face with the same problem, and the use of structs for data-structures put on the stack (don't even get me started on the stupidity of that whole subject), Microsoft introduced the ? token for making non-nullable things, i.e. primitives and structs, nullable. So you could do something like this...

int? age = null;

if (age.HasValue && age.Value > 10) ...

if (age ?? 0 > 0) ...

What Microsoft should have done is broken backwards compatibility and made everything non-nullable by default requiring the end user to explicitly opt-in for nullable values with the ? token. That would have been a great improvement and worth breaking backwards compatibility for.

57   Dan8267   2015 Jan 2, 4:01am  

Peter P says

Doubtful. The philosophy is quite different on many fronts. It even attempts to tackle multiple inheritance! And path-dependent types? :-)

How so? All Scala adds to multiple inheritance is an ordering of the preferred method calls for conflicting methods. I hardly call that a different philosophy.

In any case, I think we're about to get into a nomenclature argument, so let's not.

58   Dan8267   2015 Jan 2, 4:17am  

Peter P says

I hope you did not have to rely too much on reflection in 1995.

Java didn't have reflection back in 1995. Reflection was introduced in a language called Pizza which was an extension of Java in the same way that C++ is an extension of C. Later both .NET and Java incorporated reflection.

Reflection was incorporated in Java 5 back in 2004.

As for performance, if you ever had bad performance using reflection, it was because of how you were using it. You're not suppose to sit in a loop calling getClass() and getMethod(). You're suppose to reflect once and then use the reflection objects inside your loop or event handler.

59   Peter P   2015 Jan 2, 4:36am  

Dan8267 says

Java didn't have reflection back in 1995.

Reflection was in Java 1.1. It was simply refined and improved through the versions.

http://www.javaworld.com/article/2077015/java-se/take-an-in-depth-look-at-the-java-reflection-api.html

60   Peter P   2015 Jan 2, 4:38am  

Dan8267 says

What Microsoft should have done is broken backwards compatibility and made everything non-nullable by default requiring the end user to explicitly opt-in for nullable values with the ? token. That would have been a great improvement and worth breaking backwards compatibility for.

In F# you have to turn on a flag to allow nulls.

Auto-boxing in Java can be dangerous because of nulls.

Breaking backward compatibility is good for the art but bad for business.

61   Peter P   2015 Jan 2, 4:47am  

Dan8267 says

How so? All Scala adds to multiple inheritance is an ordering of the preferred method calls for conflicting methods. I hardly call that a different philosophy.

In any case, I think we're about to get into a nomenclature argument, so let's not.

Java only allows multiple interfaces with no data or methods. Scala allows at least limited multiple inheritance with methods.

But yes, let's not argue over nomenclature. :-)

62   Tenpoundbass   2015 Jan 2, 5:32am  

I don't get the semantics over type safe, and readability.
Either you understand that language syntax and can follow the code or you can't. The worst thing people do is comment and especially over comment, if you can't read the code either you did or inherited. Then you're not worth a shit at what you're doing, or the folks that you inherited the code form aren't worth a crap.

Now of course, my niche is in enterprise development. If I were doing stuff like creating an original game engine, graphics or sound format, or low level hardware development. Then my thoughts on that would all be different. 90% of the enterprise development done is an unnecessary dog and pony show, to keep up the illusion that any real Computer programming is actually going on.

Especially the commenting. If I have to comment a method called, get_customer_monthly_invoices, then somebody is really really worried about their goddamned job security.

63   Dan8267   2015 Jan 2, 6:01am  

Peter P says

Dan8267 says

Java didn't have reflection back in 1995.

Reflection was in Java 1.1. It was simply refined and improved through the versions.

My mistake. I must have been thinking of generics. Serves me right going on memory at my age.

Yeah, reflection was added in 1.1 in 1997.

64   Peter P   2015 Jan 2, 6:03am  

Dan8267 says

My mistake. I must have been thinking of generics. Serves me right going on memory at my age.

No worries. :-)

65   Dan8267   2015 Jan 2, 6:06am  

Peter P says

Breaking backward compatibility is good for the art but bad for business.

Transitioning from Java to Scala would be even more of a challenge for business than transitioning to a version of Java that requires some code changes and a new class format. That's why I'd rather take the best of Scala and put it in Java.

Besides, Java already competes with .NET. Adding another competitor will just fragment the market further making it harder for developers to cooperate. We don't need many platforms, just a few or even one really good one.

66   Peter P   2015 Jan 2, 6:18am  

Dan8267 says

Transitioning from Java to Scala would be even more of a challenge for business than transitioning to a version of Java that requires some code changes and a new class format. That's why I'd rather take the best of Scala and put it in Java.

True. However, Java and Scala can coexist peacefully on the JVM platform.

Judging from how long it took Java to incorporate lambda expressions I am not going to hold my breadth.

Dan8267 says

Besides, Java already competes with .NET. Adding another competitor will just fragment the market further making it harder for developers to cooperate. We don't need many platforms, just a few or even one really good one.

Even .NET has many languages (VB, C#, F#, etc). One more JVM language will not hurt. Both .NET and Java must compete with Ruby, Python, and JavaScript (especially node.js).

JavaScript is an interesting language. It tends to attract the best and the worst programmers.

67   Dan8267   2015 Jan 2, 6:28am  

Peter P says

Judging from how long it took Java to incorporate lambda expressions I am not going to hold my breadth.

It's a shame Oracle bought out Sun Microsystems. I was worried Java would slowly die because of that.

Peter P says

JavaScript is an interesting language. It tends to attract the best and the worst programmers.

JavaScript is unavoidable today. But you can develop correctly in it. You just have to ignore most of the language and stick with good design and implementation patterns.

By the way, JavaScript has nothing to do with Java. It's name comes from a marketing ploy. It was originally called LiveScript.

I wouldn't say .NET and Java compete with JavaScript. The later is used for client-side code in browsers. The former are used in server-side code and applications.

68   Dan8267   2015 Jan 2, 6:29am  

Peter P says

Even .NET has many languages (VB, C#, F#, etc).

And pointlessly so. I'd get rid of all but C#. But I don't want to get into a religious discussion...

69   Peter P   2015 Jan 2, 6:32am  

Dan8267 says

JavaScript is unavoidable today. But you can develop correctly in it. You just have to ignore most of the language and stick with good design and implementation patterns.

Yep. It is a highly flexible language with a few oddities.

Dan8267 says

I wouldn't say .NET and Java compete with JavaScript. The later is used for client-side code in browsers. The former are used in server-side code and applications.

Node.js is all the rage right now. It is a server-side technology.

I hope Dart will replace JavaScript soon.

70   Peter P   2015 Jan 2, 6:35am  

Dan8267 says

And pointlessly so. I'd get rid of all but C#. But I don't want to get into a religious discussion...

Nothing religious... but you may want to take a look at F#. Its closest cousin is probably OCaml. It has one of the best type systems as a mainstream-ish language.

71   Rin   2015 Jan 7, 6:18am  

http://www.centralvalleybusinesstimes.com/stories/001/?ID=27496

Excerpt

Businesses are investing more dollars in mobile and big data initiatives, and they need skilled technology and creative professionals to support these efforts

I love this word, "creative".

So a bunch of idiot MBA-ologist managers are suppose to figure out whose a "creative" hire?

Seriously, do ppl really believe this tripe?!

« First        Comments 33 - 71 of 71        Search these comments

Please register to comment:

api   best comments   contact   latest images   memes   one year ago   random   suggestions