SuperMike
January 19th, 2009, 12:29 AM
For those of you who think you'd like to make the next great programming language, and who actually might do that and influence my life later on, I'd like to have a word of persuasion here with you, my friend.
Semicolons
Please make it so that I can wrap a line of code over several lines, and mail code and know that a mail system may wrap my mails in odd ways, but as long as those semicolons are there, my code will remain intact. For those languages that don't use semicolons -- mail often munches their stuff.
The Dot
Let's just keep it simple, shall we? Got a static method? How about a dot as the separator. Got a non-static method. A dot. Got an object property. The dot. You can use & as a concatenator symbol, but please don't make me have to keep typing -> and :: and ::: and / all the time when dealing with object methods and properties.
Duck Typed
I like duck typed languages. Less hassle that way. They seem to run just fine. And if not, then I'll build something in C to work my way out of that problem. See my note on C further down.
No Compilation
I like scripting languages. I can make a change, try it out, make a change, try it out -- much faster than fighting with compilers and linkers.
If Control Structure and the Curly Brace
Look, if it's between the word "if" and a curly brace symbol, don't make me have to wrap my conditions yet again with parentheses. PHP does this and it drives me crazy.
Curly Braces
This works well. Keep this in your if/then, do/while, for, etc.
C Should Be A Good Influence
C has some great control structures like if/then, for, etc. Many languages already borrow from this. We get it, alright? Please start at least with those. And I love how I can do $i++ and it increments, as well as $i+=1.
Require Space Before and After Concat Symbol
PHP drives me nuts. You read a bunch of code and someone does a string like:
$a="Welcome ".$Person.",".$WelcomeMsg;
That stuff drives me nuts. So, if you're going to replace the concat symbol with &, make it require a space before and after it or it won't compile.
Give Us Active Record
Whenever you get rocking and rolling with PHP freelancing, you eventually realize that an ORM makes a lot of sense on doing onsey-twosy record updates where you don't want to have to type out all the SQL. And often the simplest ORMs just re-implement what's called an Active Record. So why not make Active Record part of the main language? Sure, it's not suitable for everything, but it can be a timesaver for a lot of parts of an application.
Give Us the With Statement
Nothing is more annoying than grabbing an object with dozens of properties, and wanting to set all those properties. It would be great to use something like the following and save keystrokes:
with $oObject {
.name = $sFirstName & ' ' & $sLastName;
.address = $sAddress;
}
Keep The Parameter Order Consistent
PHP keeps inverting this stuff. The substr() wants the haystack first. The str_replace() wants the haystack last. And so on. Keep the haystack and needle in a consistent place.
By Default, It Should Be An Apache Module
Don't make us have to run your language in CGI mode or with a special web server. It should start as an Apache module.
Building Modules in C Should Be A Snap
I should be able to extend the language easily by taking a skeleton module written in C, flesh it out with normal C language stuff, compile it brainlessly easy with GCC, and then include it in my script with a simple one-liner that makes that library into an object namespace with a bunch of functions and properties available to it. And to make our lives easier, please create other skeleton modules that interface with PostgreSQL, MySQL, and SQLite so that we can see how that's done.
In fact, you could make it even cooler that I could just include the myfile.c file and the script could compile it on the fly as neccessary -- giving my C stuff a kind of scripting language feel to it.
Compiling Your Language Should Not Be A Nightmare
I have no idea why it's such a pain to compile PHP from scratch. (If you're doing it without an RPM or DEB file.)
Don't Assume ByRef
Don't assume that I want to pass something as byval or byref. Force me to use some syntax to make something byref, such as &myvar.
Get It Right The First Time So It's Not Deprecation City
Take early Java and compare it to the Java we see today, and it's like a completely different thing. You can't even use old Java books anymore like you can almost do with early PHP books.
Use ASP-Style Tags
Okay, since <? seems to have been stolen unfairly by the XML crowd, let's stick with ASP-style tags like:
<% DoSomething(); %>
and
<%= $sMyVar %>
Keep The Global Namespace Thin
Sure, I don't like having to grab a String object or namespace in order to do string tasks. Nor do I like to grab a Math object or namespace in order to do math tasks. So, for the most common things we use, give us these things in the global namespace so that I can simply do abs() and substr(). But know your limits and create a namespace arrangement that I have to load a namespace to go beyond a certain range of stuff. Sometimes that's very hard to figure out, so do your best. Ideally it would be great that I only need a namespace to do XML work, database stuff, PDF generation, GD lib interaction, JSON interaction, etc.
Unicode Should Not Be An After-Thought
Wide characters do take up a lot of memory, so obviously we don't want them as the default. But if I want to switch a class so that everything it does is in wide character format to accommodate Unicode, please let me do this easily. And then give us various wide-to-regular and regular-to-wide character translations. (Although I realize that regular-to-wide and wide-to-regular can only go so far because one has a much larger character set than the other.) And let us add some parameter in a function or object property to indicate that we're passing a string in wide character format or outputting a string in wide character format.
Dates And Times Should Work Better
Just make it that all the time/date stuff doesn't use an epoch and therefore has no risk of screwing up. Make it use UTC as the default timezone. And then give a FAQ to developers with a Javascript code snippet inside so that they can see how to extract the browser's timezone delta and pass that into your programming language so that times can be changed as necessary for each user's context.
Make It A Templating Language Too
Because of PHP's alternative syntax and short tags, it is already an outstanding templating language. I'd like to see your language have this feature too.
Make Extremely Helpful Error Pages
I should be able to add a statement at the top of my script files so that I can get very pretty error messages coming back along with colored code highlighting. I should also have an editor on that page so that I can leave some summary notes on why such an error would occur -- to help me on the next time I see that error. And then give me a hyperlink I can click where I can see what other people have typed about this kind of error as well.
Security Should Be Paramount
This is a never-ending game, but by default the language should do a lot of security fixes for me. I want to effortlessly block 80% of most XSS, URL hacking (going to parts of the site out of sequence or without authentication), and SQL injection. From there on out, the language should have an advice center on how to take this even further.
Simplistic Filters Should Be Available
We do a lot of work on our own to ensure our First Name field is a first name, our Last Name field is a last name, to ProperCase these values, and so on. And this applies to Zipcodes, Postal Codes, URLs, Address Line 1, Address Line 2, etc. Your language should provide a lot of these right out of the box.
Record Pagination Should Be A Snap
Google-style record pagination should be a snap to implement with your language and the database API, communicating with PostgreSQL, MySQL, or SQLite.
Okay, that's enough. Anyone else got any wishes for such a language? Beats worrying about the economy!
Semicolons
Please make it so that I can wrap a line of code over several lines, and mail code and know that a mail system may wrap my mails in odd ways, but as long as those semicolons are there, my code will remain intact. For those languages that don't use semicolons -- mail often munches their stuff.
The Dot
Let's just keep it simple, shall we? Got a static method? How about a dot as the separator. Got a non-static method. A dot. Got an object property. The dot. You can use & as a concatenator symbol, but please don't make me have to keep typing -> and :: and ::: and / all the time when dealing with object methods and properties.
Duck Typed
I like duck typed languages. Less hassle that way. They seem to run just fine. And if not, then I'll build something in C to work my way out of that problem. See my note on C further down.
No Compilation
I like scripting languages. I can make a change, try it out, make a change, try it out -- much faster than fighting with compilers and linkers.
If Control Structure and the Curly Brace
Look, if it's between the word "if" and a curly brace symbol, don't make me have to wrap my conditions yet again with parentheses. PHP does this and it drives me crazy.
Curly Braces
This works well. Keep this in your if/then, do/while, for, etc.
C Should Be A Good Influence
C has some great control structures like if/then, for, etc. Many languages already borrow from this. We get it, alright? Please start at least with those. And I love how I can do $i++ and it increments, as well as $i+=1.
Require Space Before and After Concat Symbol
PHP drives me nuts. You read a bunch of code and someone does a string like:
$a="Welcome ".$Person.",".$WelcomeMsg;
That stuff drives me nuts. So, if you're going to replace the concat symbol with &, make it require a space before and after it or it won't compile.
Give Us Active Record
Whenever you get rocking and rolling with PHP freelancing, you eventually realize that an ORM makes a lot of sense on doing onsey-twosy record updates where you don't want to have to type out all the SQL. And often the simplest ORMs just re-implement what's called an Active Record. So why not make Active Record part of the main language? Sure, it's not suitable for everything, but it can be a timesaver for a lot of parts of an application.
Give Us the With Statement
Nothing is more annoying than grabbing an object with dozens of properties, and wanting to set all those properties. It would be great to use something like the following and save keystrokes:
with $oObject {
.name = $sFirstName & ' ' & $sLastName;
.address = $sAddress;
}
Keep The Parameter Order Consistent
PHP keeps inverting this stuff. The substr() wants the haystack first. The str_replace() wants the haystack last. And so on. Keep the haystack and needle in a consistent place.
By Default, It Should Be An Apache Module
Don't make us have to run your language in CGI mode or with a special web server. It should start as an Apache module.
Building Modules in C Should Be A Snap
I should be able to extend the language easily by taking a skeleton module written in C, flesh it out with normal C language stuff, compile it brainlessly easy with GCC, and then include it in my script with a simple one-liner that makes that library into an object namespace with a bunch of functions and properties available to it. And to make our lives easier, please create other skeleton modules that interface with PostgreSQL, MySQL, and SQLite so that we can see how that's done.
In fact, you could make it even cooler that I could just include the myfile.c file and the script could compile it on the fly as neccessary -- giving my C stuff a kind of scripting language feel to it.
Compiling Your Language Should Not Be A Nightmare
I have no idea why it's such a pain to compile PHP from scratch. (If you're doing it without an RPM or DEB file.)
Don't Assume ByRef
Don't assume that I want to pass something as byval or byref. Force me to use some syntax to make something byref, such as &myvar.
Get It Right The First Time So It's Not Deprecation City
Take early Java and compare it to the Java we see today, and it's like a completely different thing. You can't even use old Java books anymore like you can almost do with early PHP books.
Use ASP-Style Tags
Okay, since <? seems to have been stolen unfairly by the XML crowd, let's stick with ASP-style tags like:
<% DoSomething(); %>
and
<%= $sMyVar %>
Keep The Global Namespace Thin
Sure, I don't like having to grab a String object or namespace in order to do string tasks. Nor do I like to grab a Math object or namespace in order to do math tasks. So, for the most common things we use, give us these things in the global namespace so that I can simply do abs() and substr(). But know your limits and create a namespace arrangement that I have to load a namespace to go beyond a certain range of stuff. Sometimes that's very hard to figure out, so do your best. Ideally it would be great that I only need a namespace to do XML work, database stuff, PDF generation, GD lib interaction, JSON interaction, etc.
Unicode Should Not Be An After-Thought
Wide characters do take up a lot of memory, so obviously we don't want them as the default. But if I want to switch a class so that everything it does is in wide character format to accommodate Unicode, please let me do this easily. And then give us various wide-to-regular and regular-to-wide character translations. (Although I realize that regular-to-wide and wide-to-regular can only go so far because one has a much larger character set than the other.) And let us add some parameter in a function or object property to indicate that we're passing a string in wide character format or outputting a string in wide character format.
Dates And Times Should Work Better
Just make it that all the time/date stuff doesn't use an epoch and therefore has no risk of screwing up. Make it use UTC as the default timezone. And then give a FAQ to developers with a Javascript code snippet inside so that they can see how to extract the browser's timezone delta and pass that into your programming language so that times can be changed as necessary for each user's context.
Make It A Templating Language Too
Because of PHP's alternative syntax and short tags, it is already an outstanding templating language. I'd like to see your language have this feature too.
Make Extremely Helpful Error Pages
I should be able to add a statement at the top of my script files so that I can get very pretty error messages coming back along with colored code highlighting. I should also have an editor on that page so that I can leave some summary notes on why such an error would occur -- to help me on the next time I see that error. And then give me a hyperlink I can click where I can see what other people have typed about this kind of error as well.
Security Should Be Paramount
This is a never-ending game, but by default the language should do a lot of security fixes for me. I want to effortlessly block 80% of most XSS, URL hacking (going to parts of the site out of sequence or without authentication), and SQL injection. From there on out, the language should have an advice center on how to take this even further.
Simplistic Filters Should Be Available
We do a lot of work on our own to ensure our First Name field is a first name, our Last Name field is a last name, to ProperCase these values, and so on. And this applies to Zipcodes, Postal Codes, URLs, Address Line 1, Address Line 2, etc. Your language should provide a lot of these right out of the box.
Record Pagination Should Be A Snap
Google-style record pagination should be a snap to implement with your language and the database API, communicating with PostgreSQL, MySQL, or SQLite.
Okay, that's enough. Anyone else got any wishes for such a language? Beats worrying about the economy!