News for hackers. Stuff that matters.
Re:C++ in Coders at Work by alrex021 on Friday October 16, 2009 @12:55PM (#885709)
Its really fascinating to me. We had Lisp and then the road for many lead to C/C++, Java, and related and then we needed a way to express data in more human-readable form so some genius came up with XML. XML was to cumbersome (close tags, how attributes are expressed, etc.) and then JSON came into the picture. So all that to just come back to where we were in the first place.

Now I clearly understand what some of the veterans in "Coders at Work" really meant by "Very little progress, if any, has been made in the Programming space".

Re:C++ in Coders at Work by haberman on Friday October 16, 2009 @01:17PM (#885759)
JSON is not a programming language.
Re:C++ in Coders at Work by alrex021 on Friday October 16, 2009 @02:15PM (#885880)
You are absolutely right. My point exactly.

Now you need "two hammers" to get a single job done. Your current programming language of choice and a data expression language.

For example: In C, C++, Java, or related, you "first" have to build you structure to represent a Person with first_name and last_name and then you have to write it to JSON:

Java:

  class Person { String firstName; String lastName; }
JSON with JavaScript evaluation:

  var names = [{"firstName": "John", "lastName": "Smith"}, {"firstName": "Bob", "lastName": "Jones"}]

  eval("(" + names + ")");
Lisp handles both naturally. You don't need intermediary human-readable data expression language. It comes natural to the language itself.

Lisp ver:

  (defvar names '((:firstName "John" :lastName "Smith") (:firstName "Bob" :lastName "Jones")))

  (eval names)
Re:C++ in Coders at Work by haberman on Friday October 16, 2009 @04:03PM (#886069)
> or example: In C, C++, Java, or related, you "first" have to build you structure to represent a Person with first_name and last_name

Not if you're using Protocol Buffers, which is essentially a version of JSON that has "batteries included."

> Lisp ver:

Lisp is not the only programming language around. How am I going to consume that data from another language? Embed an entire Lisp interpreter?

Re:C++ in Coders at Work by scott_s on Friday October 16, 2009 @02:59PM (#885970)
Not all problems require communicating your data structure outside of the program. And I don't think it's accurate to say "Now you need." For problems where you do need to communicate data outside of the program, that's been true since the days of Fortran.
Re:C++ in Coders at Work by jimbokun on Friday October 16, 2009 @01:38PM (#885801)
Which just goes to show we still have not made all the way back to where Lisp was a few decades ago.
Re:C++ in Coders at Work by haberman on Friday October 16, 2009 @07:11PM (#886353)
Consider that JSON has features Lisp does not. Like a tiny implementation, very wide language interoperability, being purely a data language (sandboxed by design), and not being Turing-complete (time to interpret is automatically bounded).
Re:C++ in Coders at Work by jacquesm on Friday October 16, 2009 @08:44PM (#886442)
> (time to interpret is automatically bounded).

Well, at least for that particular set of cases I think you've just solved the halting problem ;)