Re: Stupid Language Designer Tricks

2012-06-14 Thread Peter da Silva
On 2012-06-13, at 10:41, David Cantrell wrote: On Wed, Jun 13, 2012 at 06:55:31AM -0500, Peter da Silva wrote: On 2012-06-11, at 13:08, Aaron J. Grier wrote: On Sat, May 19, 2012 at 03:49:15PM -0500, Peter da Silva wrote: On 2012-05-19, at 11:43, Michael G Schwern wrote: Or still using it,

Re: Stupid Language Designer Tricks

2012-06-13 Thread Peter da Silva
On 2012-06-11, at 13:08, Aaron J. Grier wrote: On Sat, May 19, 2012 at 03:49:15PM -0500, Peter da Silva wrote: On 2012-05-19, at 11:43, Michael G Schwern wrote: Or still using it, basically unchanged, as our primary system programming language in 2012. Yeh, it really sucks that in 50 years

Re: Stupid Language Designer Tricks

2012-06-13 Thread David Cantrell
On Wed, Jun 13, 2012 at 06:55:31AM -0500, Peter da Silva wrote: On 2012-06-11, at 13:08, Aaron J. Grier wrote: On Sat, May 19, 2012 at 03:49:15PM -0500, Peter da Silva wrote: On 2012-05-19, at 11:43, Michael G Schwern wrote: Or still using it, basically unchanged, as our primary system

Re: Stupid Language Designer Tricks

2012-06-11 Thread Aaron J. Grier
On Sat, May 19, 2012 at 03:49:15PM -0500, Peter da Silva wrote: On 2012-05-19, at 11:43, Michael G Schwern wrote: Or still using it, basically unchanged, as our primary system programming language in 2012. Yeh, it really sucks that in 50 years nobody has ever been able to develop a

Re: Stupid Language Designer Tricks

2012-05-23 Thread Robert Rothenberg
On 14/05/12 17:28 Luke Kanies wrote: On May 14, 2012, at 9:06 AM, Robert Rothenberg wrote: [Snip!] But Puppet is special in that it's intended to be a *descriptive* language. So you describe how your servers are to be configured. Sounds nice, except... it has side effects. Which makes the

Re: Stupid Language Designer Tricks

2012-05-22 Thread Tony Finch
Michael G Schwern schw...@pobox.com wrote: The third is distraction. For some reason every language which started out to replace C gets distracted by dreams of being an application language. I'm thinking Java (was originally supposed to run on set top boxes), Objective-C and C++ It is

Re: Stupid Language Designer Tricks

2012-05-21 Thread Tony Finch
Peter da Silva pe...@taronga.com wrote: I'll give you the fall-through in case. There are some other things that were fixed in later versions: Single namespace for structure and union members No function argument type checking There are some things that haven't been fixed: const Operators

Re: Stupid Language Designer Tricks

2012-05-21 Thread Michael G Schwern
On 2012.5.20 4:40 AM, Peter da Silva wrote: Smalltalk was also not low level enough to be used as an alternative to C. It wouldn't even fit in the PDP-11 they started with. Never claimed it was. The list was done evaluating C as a language we use and are heavily influenced by in 2012.

Re: Stupid Language Designer Tricks

2012-05-21 Thread David Parsons
On May 21, 2012, at 2:22 PM, Michael G Schwern wrote: This is a personal observation, folks to code C like details of bits and registers and hardware details and such. Novices like to prattle on about C being just another assembly language, but they don't know what they're talking about.

Re: Stupid Language Designer Tricks

2012-05-21 Thread Peter da Silva
On 2012-05-21, at 16:22, Michael G Schwern wrote: The first is the enemy of the best is good enough and C was good enough... for a time. It solved a problem (portable machine programming) better and faster than its contemporaries and even much later languages. Not just good enough, I used

Re: Stupid Language Designer Tricks

2012-05-20 Thread Peter da Silva
On 2012-05-19, at 16:54, Michael G Schwern wrote: Smalltalk was in production in 72 making it a contemporary with C. Smalltalk 80 was the first released version, roughly coinciding with the KR book. And Simula had all the trappings of a modern OO language (and a lot most still don't have) in

Re: Stupid Language Designer Tricks

2012-05-20 Thread demerphq
On 18 May 2012 22:07, Michael G Schwern schw...@pobox.com wrote: switch fall through. (still a classic mistake). I guess you mean defaulting to falling through? Yeah that probably should have defaulted to the other way, even though C's approach matches what actually happens. On the other hand i

Re: Stupid Language Designer Tricks

2012-05-19 Thread Aristotle Pagaltzis
* Michael G Schwern schw...@pobox.com [2012-05-19 18:50]: Or still using it, basically unchanged, as our primary system programming language in 2012. Indeed: why oh why… One has to wonder.

Re: Stupid Language Designer Tricks

2012-05-19 Thread Greg McCarroll
On 19 May 2012, at 21:38, Aristotle Pagaltzis wrote: * Michael G Schwern schw...@pobox.com [2012-05-19 18:50]: Or still using it, basically unchanged, as our primary system programming language in 2012. Indeed: why oh why… One has to wonder. Just to play the devil sitting on the devil's

Re: Stupid Language Designer Tricks

2012-05-19 Thread Peter da Silva
On 2012-05-18, at 15:07, Michael G Schwern wrote: Bagging on C is like bagging on Shakespeare. They were severely limited in hardware, didn't have a whole lot of prior art to go on and not a whole lot of people to talk to about it. Smalltalk, ML, Pascal, Prolog, Lisp and SQL all came out about

Re: Stupid Language Designer Tricks

2012-05-19 Thread Peter da Silva
On 2012-05-19, at 11:43, Michael G Schwern wrote: Or still using it, basically unchanged, as our primary system programming language in 2012. Yeh, it really sucks that in 50 years nobody has ever been able to develop a genuinely better alternative.

Re: Stupid Language Designer Tricks

2012-05-19 Thread Michael G Schwern
On 2012.5.19 1:46 PM, Peter da Silva wrote: Smalltalk came out ten years later. Smalltalk was in production in 72 making it a contemporary with C. Smalltalk 80 was the first released version, roughly coinciding with the KR book. And Simula had all the trappings of a modern OO language (and a

Re: Stupid Language Designer Tricks

2012-05-19 Thread Michael G Schwern
On 2012.5.15 1:41 PM, Jarkko Hietaniemi wrote: Otherwise I haven't come across this problem in other major languages... except maybe C. And original C has so many design flaws that the list would become useless. You will have to back that up somehow, laddie. And get offa my lawn. I've

Re: Stupid Language Designer Tricks

2012-05-19 Thread Aristotle Pagaltzis
* Greg McCarroll g...@mccarroll.org.uk [2012-05-19 23:00]: Lisp machines[1] didn't exactly take off. C++/STL didn't have anyone build upon it for other languages significantly (i'm sure i'm about to be proven wrong here) , just for sheer mischief i'll mention Topaz[2]. Bagging on C as a

Re: Stupid Language Designer Tricks

2012-05-18 Thread Michael G Schwern
On 2012.5.15 1:41 PM, Jarkko Hietaniemi wrote: Otherwise I haven't come across this problem in other major languages... except maybe C. And original C has so many design flaws that the list would become useless. You will have to back that up somehow, laddie. And get offa my lawn. (I can

Re: Stupid Language Designer Tricks

2012-05-18 Thread Jarkko Hietaniemi
And since you asked, off the top of my head... [ a long list snipped] Now, tell us how you *really* feel about C? In case you didn't guess it yet, I was playing advocatus diaboli in reverse here. (In modernese: trolling.) In other words, your list and argument was good, though many items

Re: Stupid Language Designer Tricks

2012-05-18 Thread Michael G Schwern
On 2012.5.14 9:38 AM, demerphq wrote: On 14 May 2012 14:34, David Cantrell da...@cantrell.org.uk wrote: I wouldn't mind if it was disabled by default and if I had to explicitly enable it per file, with something like 'no strict cpp'. Couldnt this just be a filter/preprocessor thingee?

Re: Stupid Language Designer Tricks

2012-05-16 Thread Peter Corlett
On Tue, May 15, 2012 at 01:41:09PM -0700, Jarkko Hietaniemi wrote: [...] Otherwise I haven't come across this problem in other major languages... except maybe C. And original C has so many design flaws that the list would become useless. You will have to back that up somehow, laddie. And get

Re: Stupid Language Designer Tricks

2012-05-16 Thread Peter da Silva
On 2012-05-15, at 15:39, Michael G Schwern wrote: I've heard that same story but about the hard tab in make. Smells like an urban legend... or proof that programmers care too much about backwards compatibility. Well, he really did say there were N sites using it, and N was small. But it was

Re: Stupid Language Designer Tricks

2012-05-16 Thread Robert G. Werner
On 05/16/2012 03:22 AM, Peter Corlett wrote: On Tue, May 15, 2012 at 01:41:09PM -0700, Jarkko Hietaniemi wrote: [...] Otherwise I haven't come across this problem in other major languages... except maybe C. And original C has so many design flaws that the list would become useless. You will

Re: Stupid Language Designer Tricks

2012-05-16 Thread Peter Corlett
On Wed, May 16, 2012 at 10:22:55AM -0700, Robert G. Werner wrote: On 05/16/2012 03:22 AM, Peter Corlett wrote: [...] I'd like to see somebody try and write an operating system kernel in Perl :) I'm sure it could be written, ... once There is the Perlix userspace:

Re: Stupid Language Designer Tricks

2012-05-15 Thread Peter da Silva
On 2012-05-14, at 10:58, H.Merijn Brand wrote: Reminds me of an April-fools article introducing COME FROM to the language to ease debugging. In the end of that article they also described COME FROM ON Hilarious http://en.wikipedia.org/wiki/COMEFROM

Re: Stupid Language Designer Tricks

2012-05-15 Thread Peter da Silva
On 2012-05-14, at 07:51, David Cantrell wrote: For extra excitement, perl has this nifty feature where you can index from the end of an array using negative numbers: @array = ('ant', 'bat', 'camel', 'dolphin'); print $array[-1]; # dolphin print $array[-2]; # camel That really _is_ a nifty

Re: Stupid Language Designer Tricks

2012-05-15 Thread David Cantrell
On Tue, May 15, 2012 at 05:15:56AM -0500, Peter da Silva wrote: On 2012-05-14, at 07:51, David Cantrell wrote: For extra excitement, perl has this nifty feature where you can index from the end of an array using negative numbers: @array = ('ant', 'bat', 'camel', 'dolphin'); print

Re: Stupid Language Designer Tricks

2012-05-15 Thread Darrell Fuhriman
Well, while we're ranting about stupid language design desisions... I would like to dish out a special platter of hate for Puppet. Well, not a programming language per se. But Puppet is special in that it's intended to be a *descriptive* language. So you describe how your servers are to be

Re: Stupid Language Designer Tricks

2012-05-15 Thread Tony Finch
Darrell Fuhriman darr...@garnix.org wrote: I'm personally of the opinion that they should abandon the custom DSL in favor of a pure ruby implementation, but I seem to be on the losing end of that argument. This is one of the weirder design decisions of Puppet, given how fashionable embedded

Re: Stupid Language Designer Tricks

2012-05-15 Thread demerphq
On 15 May 2012 12:22, Peter da Silva pe...@taronga.com wrote: On 2012-05-14, at 10:58, H.Merijn Brand wrote: Reminds me of an April-fools article introducing COME FROM to the language to ease debugging. In the end of that article they also described COME FROM ON Hilarious

Re: Stupid Language Designer Tricks

2012-05-15 Thread Michael G Schwern
On 2012.5.14 2:44 AM, Numien wrote: But, that is another good point: * We'll add file access and persistent storage later Still don't count that as a design mistake in Javascript, but a design feature. It was designed as a secure language and that means very, very restricted I/O and storage.

Re: Stupid Language Designer Tricks

2012-05-15 Thread Michael G Schwern
On 2012.5.14 5:08 AM, Aristotle Pagaltzis wrote: * Peter Corlett ab...@cabal.org.uk [2012-05-14 12:20]: On Mon, May 14, 2012 at 11:06:59AM +0200, demerphq wrote: I kinda wish perl had an interface like my $iter= iterator(%hash); while (my ($key,$value)= $iter-each) { } Which I think would

Re: Stupid Language Designer Tricks

2012-05-15 Thread Michael G Schwern
On 2012.5.14 2:06 AM, demerphq wrote: On 14 May 2012 02:17, Michael G Schwern schw...@pobox.com wrote: So much hate for tying the iterator to the data and not the op. Indeed. I see this bite people regularly at $work (non Perl programmers converting seem to get bitten by each() at least once

Re: Stupid Language Designer Tricks

2012-05-15 Thread Michael G Schwern
On 2012.5.14 2:47 AM, H.Merijn Brand wrote: * undef/NULL handling * Oracle converts to NULL on varchar2 fields * MySQL considers the date -00-00 both NULL and NOT NULL at the same time I would boil that down to trinary logic. A good idea that NOBODY gets it right. If you do

Re: Stupid Language Designer Tricks

2012-05-14 Thread Philip Newton
On Mon, May 14, 2012 at 1:58 AM, Michael G Schwern schw...@pobox.com wrote: The only other instance I can think of is... damn I can't remember the name. It's the one that makes URLs like /foo/bar/123,3598,235.html.  You write in Java and everything, even the templates, is stored in Oracle.

Re: Stupid Language Designer Tricks

2012-05-14 Thread Josh Juran
On May 14, 2012, at 12:00 AM, Aristotle Pagaltzis wrote: * Peter da Silva pe...@taronga.com [2012-05-14 02:45]: * Imagining that there's some relationship between computer languages and human languages. * See COBOL * See Perl * Imagining that there's no relationship between computer

Re: Stupid Language Designer Tricks

2012-05-14 Thread Aristotle Pagaltzis
* Peter da Silva pe...@taronga.com [2012-05-14 02:45]: * Imagining that there's some relationship between computer languages and human languages. * See COBOL * See Perl * Imagining that there's no relationship between computer languages and linguistic cognition. * Mathematical

Re: Stupid Language Designer Tricks

2012-05-14 Thread Philip Newton
On Mon, May 14, 2012 at 9:00 AM, Aristotle Pagaltzis pagalt...@gmx.de wrote: * Mathematical notation is ideal for programming! See also: the thousands of new programmers confused by x = 5; not meaning x is equal to 5, despite what they had learned in maths class. (I'm reminded of a BASIC

Re: Stupid Language Designer Tricks

2012-05-14 Thread Michael G Schwern
On 2012.5.13 11:06 PM, Philip Newton wrote: On Mon, May 14, 2012 at 1:58 AM, Michael G Schwern schw...@pobox.com wrote: The only other instance I can think of is... damn I can't remember the name. It's the one that makes URLs like /foo/bar/123,3598,235.html. You write in Java and everything,

Re: Stupid Language Designer Tricks

2012-05-14 Thread Michael G Schwern
On 2012.5.13 11:18 PM, Numien wrote: On 13/05/12 07:58 PM, Michael G Schwern wrote: I can forgive Javascript of that because it has no file operations by (good) design and thus no way to load other files. Sure it does. See XMLHttpRequest the new HTML5 web storage, app cache, and socket

Re: Stupid Language Designer Tricks

2012-05-14 Thread Peter da Silva
On 2012-05-14, at 02:00, Aristotle Pagaltzis wrote: * Peter da Silva pe...@taronga.com [2012-05-14 02:45]: * Imagining that there's some relationship between computer languages and human languages. * See COBOL * See Perl * Imagining that there's no relationship between computer languages

Re: Stupid Language Designer Tricks

2012-05-14 Thread Tony Finch
Peter da Silva pe...@taronga.com wrote: * Imagining that there's some relationship between computer languages and human languages. * See COBOL * See Perl See AppleScript. Here's an epic rant on the subject: http://daringfireball.net/2005/09/english-likeness_monster Tony. --

Re: Stupid Language Designer Tricks

2012-05-14 Thread Peter Corlett
On Sun, May 13, 2012 at 07:35:39PM -0500, Peter da Silva wrote: [...] Like *x for indirection. Even Dennis agrees that was a mistake. He said that by the time he noticed it there were three sites using C so they thought it was probably too late to fix it. I heard the there were three sites

Re: Stupid Language Designer Tricks

2012-05-14 Thread Tony Finch
Andy Armstrong a...@hexten.net wrote: On 13 May 2012, at 18:48, Michael G Schwern wrote: * Lists count from 0 * Everybody does it * Everybody's wrong * See also let's just paste what C does I find it very hard to live with Lua's 1-based arrays. I don't think it's just familiarity -

Re: Stupid Language Designer Tricks

2012-05-14 Thread Peter da Silva
On 2012-05-14, at 05:03, Peter Corlett wrote: On Sun, May 13, 2012 at 07:35:39PM -0500, Peter da Silva wrote: [...] Like *x for indirection. Even Dennis agrees that was a mistake. He said that by the time he noticed it there were three sites using C so they thought it was probably too late to

Re: Stupid Language Designer Tricks

2012-05-14 Thread Abigail
On Mon, May 14, 2012 at 10:54:39AM +0100, Tony Finch wrote: Andy Armstrong a...@hexten.net wrote: On 13 May 2012, at 18:48, Michael G Schwern wrote: * Lists count from 0 * Everybody does it * Everybody's wrong * See also let's just paste what C does I find it very hard to

Re: Stupid Language Designer Tricks

2012-05-14 Thread demerphq
On 14 May 2012 02:17, Michael G Schwern schw...@pobox.com wrote: So much hate for tying the iterator to the data and not the op. Indeed. I see this bite people regularly at $work (non Perl programmers converting seem to get bitten by each() at least once in their career). In the case of hashes

Re: Stupid Language Designer Tricks

2012-05-14 Thread Numien
OOn 14/05/12 04:03 AM, Michael G Schwern wrote: AFAIK none of that is part of the Javascript language (ie. the ECMAscript). They're all special objects with their own standards and require special implementations. I don't believe you can write them in Javascript. And it's all fairly recent

Re: Stupid Language Designer Tricks

2012-05-14 Thread Peter Corlett
On Mon, May 14, 2012 at 11:06:59AM +0200, demerphq wrote: [...] I kinda wish perl had an interface like my $iter= iterator(%hash); while (my ($key,$value)= $iter-each) { } Which I think would be sane. You could even pass the iterator without passing the hash itself. (Preventing

Re: Stupid Language Designer Tricks

2012-05-14 Thread Aaron Crane
Peter Corlett ab...@cabal.org.uk wrote: I'd like to throw in the fun breakage caused by the combination of adding two unnecessary bits of syntactic sugar to Perl. Somebody decided that auto-deref would be nice, so you can do each $hashref and pop $arrayref. And then somebody else clearly

Re: Stupid Language Designer Tricks

2012-05-14 Thread Aaron Crane
Michael G Schwern schw...@pobox.com wrote: On 2012.5.13 11:36 AM, Peter Corlett wrote: I'd like to throw in the fun breakage caused by the combination of adding two unnecessary bits of syntactic sugar to Perl. Somebody decided that auto-deref would be nice, so you can do each $hashref and pop

Re: Stupid Language Designer Tricks

2012-05-14 Thread Tony Finch
Walt Mankowski waltman-hates-softw...@mawode.com wrote: * Everything is a string. * Tcl I like the term stringly typed. Tony. -- f.anthony.n.finch d...@dotat.at http://dotat.at/ Shannon: Northwest 5 to 7, perhaps gale 8 later. Rough or very rough. Showers. Good, occasionally moderate.

Re: Stupid Language Designer Tricks

2012-05-14 Thread Abigail
On Sun, May 13, 2012 at 10:48:13AM -0700, Michael G Schwern wrote: * Auto declare undeclared variables * PHP, Ruby * Typo protection out the window * Perl (unless you enable 'use strict vars', and don't fully qualify your vars; no such protection possible on subs if you use

Re: Stupid Language Designer Tricks

2012-05-14 Thread H.Merijn Brand
On Sun, 13 May 2012 10:48:13 -0700, Michael G Schwern schw...@pobox.com wrote: * A typed language with no way to define new types * SQL * Follow the standard only optionally All SQL dialects allow spaces as the SQL standard sais SELECT bar, count (*) FROM frublt GROUP BY bar;

Re: Stupid Language Designer Tricks

2012-05-14 Thread Philip Newton
On Mon, May 14, 2012 at 11:47 AM, H.Merijn Brand h.m.br...@xs4all.nl wrote:  * Oracle converts to NULL on varchar2 fields Oh goodness yes. Whoever thought that was a good idea? And built such an SQL incompatibility into a major database engine? Cheers, Philip -- Philip Newton

Re: Stupid Language Designer Tricks

2012-05-14 Thread H.Merijn Brand
On Sun, 13 May 2012 10:48:13 -0700, Michael G Schwern schw...@pobox.com wrote: * Significant whitespace * Python * Oh god why Kurila * YAML does it right * So does Ruby One more (besides what I wrote about MySQL) C-preprocessor. The only compiler I know of that does it wrong

Re: Stupid Language Designer Tricks

2012-05-14 Thread Tony Finch
Michael G Schwern schw...@pobox.com wrote: * No namespaces * Lua, Javascript Lua does have namespaces, by changing which table is used for globals. There are amusing incompatibilities in this area between 5.1 and 5.2 ... Tony. -- f.anthony.n.finch d...@dotat.at http://dotat.at/ Fisher,

Re: Stupid Language Designer Tricks

2012-05-14 Thread Aristotle Pagaltzis
* Peter Corlett ab...@cabal.org.uk [2012-05-14 12:20]: On Mon, May 14, 2012 at 11:06:59AM +0200, demerphq wrote: I kinda wish perl had an interface like my $iter= iterator(%hash); while (my ($key,$value)= $iter-each) { } Which I think would be sane. You could even pass the iterator

Re: Stupid Language Designer Tricks

2012-05-14 Thread David Cantrell
On Mon, May 14, 2012 at 08:06:28AM +0200, Philip Newton wrote: On Mon, May 14, 2012 at 1:58 AM, Michael G Schwern schw...@pobox.com wrote: The only other instance I can think of is... damn I can't remember the name. It's the one that makes URLs like /foo/bar/123,3598,235.html.  You write in

Re: Stupid Language Designer Tricks

2012-05-14 Thread Roger Burton West
On Mon, May 14, 2012 at 01:28:45PM +0100, David Cantrell wrote: Storyserver was supposed to be a content management system, but when I used it it couldn't handle binary file uploads - so you couldn't use it to upload images. Their solution to this was to send us some C source which was untested,

Re: Stupid Language Designer Tricks

2012-05-14 Thread Philip Newton
On Mon, May 14, 2012 at 2:28 PM, David Cantrell da...@cantrell.org.uk wrote: On Mon, May 14, 2012 at 08:06:28AM +0200, Philip Newton wrote: Vignette StoryServer? I had a bit of a go with that... back when the language was Tcl, not Java. Fun times. Especially counting the backslashes. Do we need

Re: Stupid Language Designer Tricks

2012-05-14 Thread David Cantrell
On Mon, May 14, 2012 at 03:01:05PM +0200, Philip Newton wrote: because we don't have a compiler in the UK. That makes me wonder whether UK refers to the Ukraine in this context What an extremely odd thing for a company to say. What our client said was odder. They said we want you to use

Re: Stupid Language Designer Tricks

2012-05-14 Thread David Cantrell
On Sun, May 13, 2012 at 04:58:49PM -0700, Michael G Schwern wrote: On 2012.5.13 3:41 PM, David Cantrell wrote: Perl used to have this. It was called #include. It's a damned shame that -P got killed off. Removing it was hateful. Let's run one language through another language's

Re: Stupid Language Designer Tricks

2012-05-14 Thread demerphq
On 14 May 2012 14:34, David Cantrell da...@cantrell.org.uk wrote: On Sun, May 13, 2012 at 04:58:49PM -0700, Michael G Schwern wrote: On 2012.5.13 3:41 PM, David Cantrell wrote: Perl used to have this.  It was called #include.  It's a damned shame that -P got killed off.  Removing it was

Re: Stupid Language Designer Tricks

2012-05-14 Thread Peter da Silva
On 2012-05-14, at 06:07, Aaron Crane wrote: Since these two enhancements aren't entirely compatible, the current situation is unfortunate: a +-prototyped argument must be an unblessed array or hash ref — not a blessed reference, and not an autovivifying undef (so `push $x, list` doesn't work on

Re: Stupid Language Designer Tricks

2012-05-14 Thread Peter Corlett
On Mon, May 14, 2012 at 11:20:37AM -0400, Sean Conner wrote: [...] Are you kidding? It can get much worse than that. I came across a language [1] that allows for patterm matched random GOSUBs (and that's the general case---it can do GOSUBs like other langauges, but it can also do random

Re: Stupid Language Designer Tricks

2012-05-14 Thread David Cantrell
On Mon, May 14, 2012 at 11:13:05AM +0200, Abigail wrote: * Let's make where to count from a switch -- globally * Perl (till it got removed from the language) Nope. From the manpage: As of release 5 of Perl, assignment to $[ is treated as a compiler directive, and cannot influence the

Re: Stupid Language Designer Tricks

2012-05-14 Thread Philip Newton
On Mon, May 14, 2012 at 2:51 PM, David Cantrell da...@cantrell.org.uk wrote: For extra excitement, perl has this nifty feature where you can index from the end of an array using negative numbers:  @array = ('ant', 'bat', 'camel', 'dolphin');  print $array[-1]; # dolphin  print $array[-2]; #

Re: Stupid Language Designer Tricks

2012-05-14 Thread Abigail
On Mon, May 14, 2012 at 01:51:11PM +0100, David Cantrell wrote: On Mon, May 14, 2012 at 11:13:05AM +0200, Abigail wrote: * Let's make where to count from a switch -- globally * Perl (till it got removed from the language) Nope. From the manpage: As of release 5 of Perl, assignment

Re: Stupid Language Designer Tricks

2012-05-14 Thread Robert Rothenberg
Well, while we're ranting about stupid language design desisions... I would like to dish out a special platter of hate for Puppet. Well, not a programming language per se. But Puppet is special in that it's intended to be a *descriptive* language. So you describe how your servers are to be

Re: Stupid Language Designer Tricks

2012-05-13 Thread Numien
On 13/05/12 01:48 PM, Michael G Schwern wrote: The rpmbuild post reminded me of my list of stupid language designer tricks. This is a file I add to every time I read about some stupid mistake (or brilliant feature) in a language and think if I ever write a language I am remembering not to do

Re: Stupid Language Designer Tricks

2012-05-13 Thread Andy Armstrong
On 13 May 2012, at 18:48, Michael G Schwern wrote: * Lists count from 0 * Everybody does it * Everybody's wrong * See also let's just paste what C does I find it very hard to live with Lua's 1-based arrays. I don't think it's just familiarity - lots of index calculations work out

Re: Stupid Language Designer Tricks

2012-05-13 Thread David Cantrell
On Sun, May 13, 2012 at 02:13:28PM -0400, Numien wrote: On 13/05/12 01:48 PM, Michael G Schwern wrote: The rpmbuild post reminded me of my list of stupid language designer tricks. This is a file I add to every time I read about some stupid mistake (or brilliant feature) in a language and

Re: Stupid Language Designer Tricks

2012-05-13 Thread Peter Corlett
On Sun, May 13, 2012 at 10:48:13AM -0700, Michael G Schwern wrote: [...] * Lists count from 0 * Everybody does it * Everybody's wrong * See also let's just paste what C does 0's good because it avoids fencepost errors. Perhaps you would prefer the Stan Kelly-Bootle compromise of 0.5?

Re: Stupid Language Designer Tricks

2012-05-13 Thread Michael G Schwern
On 2012.5.13 3:41 PM, David Cantrell wrote: On Sun, May 13, 2012 at 02:13:28PM -0400, Numien wrote: On 13/05/12 01:48 PM, Michael G Schwern wrote: The rpmbuild post reminded me of my list of stupid language designer tricks. This is a file I add to every time I read about some stupid mistake

Re: Stupid Language Designer Tricks

2012-05-13 Thread Aristotle Pagaltzis
* Andy Armstrong a...@hexten.net [2012-05-13 20:05]: I find it very hard to live with Lua's 1-based arrays. I don't think it's just familiarity - lots of index calculations work out significantly more verbose and ugly with 1-based arrays. Ever since I’ve dealt with them in XPath I would add

Re: Stupid Language Designer Tricks

2012-05-13 Thread Michael G Schwern
On 2012.5.13 11:36 AM, Peter Corlett wrote: I'd like to throw in the fun breakage caused by the combination of adding two unnecessary bits of syntactic sugar to Perl. Somebody decided that auto-deref would be nice, so you can do each $hashref and pop $arrayref. And then somebody else clearly

Re: Stupid Language Designer Tricks

2012-05-13 Thread Peter da Silva
On 2012-05-13, at 19:09, Aristotle Pagaltzis wrote: * Andy Armstrong a...@hexten.net [2012-05-13 20:05]: I find it very hard to live with Lua's 1-based arrays. I don't think it's just familiarity - lots of index calculations work out significantly more verbose and ugly with 1-based arrays.

Re: Stupid Language Designer Tricks

2012-05-13 Thread Peter da Silva
On 2012-05-13, at 12:59, Andy Armstrong wrote: On 13 May 2012, at 18:48, Michael G Schwern wrote: * Lists count from 0 * Everybody does it * Everybody's wrong * See also let's just paste what C does I find it very hard to live with Lua's 1-based arrays. I don't think it's just familiarity -

Re: Stupid Language Designer Tricks

2012-05-13 Thread Walt Mankowski
On Sun, May 13, 2012 at 10:48:13AM -0700, Michael G Schwern wrote: * We'll add threads later. * Perl * We'll add classes later. * C * Perl * Everything is a string. * Tcl

Re: Stupid Language Designer Tricks

2012-05-13 Thread Peter da Silva
On 2012-05-13, at 20:55, Walt Mankowski wrote: * We'll add classes later. * C Classes were still a kind of experimental idea in 1970, and it wasn't at all clear they'd ever be able to be implemented efficiently in something like C.

Re: Stupid Language Designer Tricks

2012-05-13 Thread Walt Mankowski
On Sun, May 13, 2012 at 09:07:56PM -0500, Peter da Silva wrote: On 2012-05-13, at 20:55, Walt Mankowski wrote: * We'll add classes later. * C Classes were still a kind of experimental idea in 1970, and it wasn't at all clear they'd ever be able to be implemented efficiently in something

Re: Stupid Language Designer Tricks

2012-05-13 Thread Josh Juran
On May 13, 2012, at 7:13 PM, Walt Mankowski wrote: On Sun, May 13, 2012 at 09:07:56PM -0500, Peter da Silva wrote: On 2012-05-13, at 20:55, Walt Mankowski wrote: * We'll add classes later. * C Classes were still a kind of experimental idea in 1970, and it wasn't at all clear they'd ever be

Re: Stupid Language Designer Tricks

2012-05-13 Thread Peter da Silva
On 2012-05-13, at 21:13, Walt Mankowski wrote: On Sun, May 13, 2012 at 09:07:56PM -0500, Peter da Silva wrote: On 2012-05-13, at 20:55, Walt Mankowski wrote: * We'll add classes later. * C Classes were still a kind of experimental idea in 1970, and it wasn't at all clear they'd ever be able