Rule of thumb for capitalizing the letters in a programming language [closed] - programming-languages

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I was wondering if anyone knew why some programming languages that I see most frequently spelled in all caps (like an acronym), are also commonly written in lower case. FORTRAN, LISP, and COBOL come to mind but I'm sure there are many more.
Perhaps there isn't any reason for this, but I'm curious to know if any of these changes are due to standards or decisions by their respective communities. Or are people just getting too lazy to hit the caps lock key? (I know I am)

The Lisp community has switched to Lisp from LISP with the invention of lower caps keyboards shortly after mankind killed the last dinosaur.

FORTRAN, LISP, and COBOL ARE acronyms:
FORTRAN: Formula Translation/Translator
LISP: LISt Processing
COBOL: COmmon Business-Oriented Language
BASIC: Beginner's All-purpose Symbolic Instruction Code
Amongst others.

Some of it has to do with the version of the language (i.e. FORTRAN 77 vs. Fortran 90). From the Fortran Wikipedia entry (emphasis mine):
The names of earlier versions of the language through FORTRAN 77 were conventionally spelled in all-caps (FORTRAN 77 was the version in which the use of lowercase letters in keywords was strictly nonstandard). The capitalization has been dropped in referring to newer versions beginning with Fortran 90. The official language standards now refer to the language as "Fortran." Because the capitalisation (or lack thereof) of the word FORTRAN was never 100% consistent in actual usage, and because many hold impassioned beliefs on the issue, this article, rather than attempt to be normative, adopts the convention of using the all-caps FORTRAN in referring to versions of FORTRAN through FORTRAN 77 and the title-caps Fortran in referring to versions of Fortran from Fortran 90 onward. This convention is reflected in the capitalization of FORTRAN in the ANSI X3.9-1966 (FORTRAN 66) and ANSI X3.9-1978 (FORTRAN 77) standards and the title caps Fortran in the ANSI X3.198-1992 (Fortran 90) standard.
When I see FORTRAN, I think fixed-spacing, punch cards, non-dynamic memory, and a bad taste in my mouth. Fortran means things like user-defined types, modules, array intrinsic functions, and isn't so bad.

To add another to the list, MATLAB is supposed to be spelled with all caps. Since it is short for "matrix laboratory", some people tend to write it as MatLab. Others just write it as Matlab or matlab, but these are all technically incorrect.

Apparently, lot of people doesn't know why, and capitalize all short programming language names they find. A sad example is Lua, too often written LUA for no reason.
Note that some languages names have internal capitalization, due to the way they were build, and well, just because the company making them wanted them this way. For example JavaScript and PostScript, or ActionScript (do I see a pattern there?). Or you have a strange mix, like ECMAScript (yes, I see a pattern!).

Because they are acronyms for stuff but at the end of the day it doesn't matter. They're just names.
E.g.
LISP = "LISt Processing"
Whereas Java for example is just named Java - it doesn't stand for anything. It used to be called Oak because they guy who named it had an oak tree outside his office.
Wikipedia a language and you'll find your answers.

The rule is that there is no rule. It's not like there is an Academy or other governing body that rules of what people get to call their programming language and how they have to spell it. Everyone makes up their own rules for their own language.
Typically, if your writing about this stuff, you either follow a house style guide or lookup the official name for it.
The reason you see so many different uses is that most people don't care or are just ignorant. I still wonder who ever told anyone to refer to a Macintosh computer as "MAC", yet that spelling is pervasive. Some people just love their shift keys, I guess.

If it is in all caps it is (supposed to be) an acronym.

if variableName == VARIABLENAME
print "USE CAPS"
else
print "Follow your team's coding standards"

Related

How to prepare for learning Lisp off-line [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Tomorrow I will go on trip to Italy. I will only have my laptop with elementaryOS 32-bit running. I will most likely have no Internet connection. I decided, that I would like to spend my free time there to learn Lisp.
I installed emacs, sbcl and slime, but I'm not really sure how sbcl works, and I'm worried that if I have to do something a little bit more complicated, I will require someone's help from web, and I won't have it there.
I've also found and downloaded 2 free lisp books - Common Lisp - An Interactive Approach and Common Lisp - A Gentle Introduction To Symbolic Computation. I hope that these will be enough.
I have C++ programming background, but with C++ it looks simpler to me - we have standard that defines what should compiler have, we have few compilers that are used most(G++, clang, MSVC++), and since I know how to compile, it isn't hard to me anymore. Also, for beginners, there are IDE that compile code for you. Lisp, afaik, has no defined standard. Also, I don't know it, so I don't really know how to compile its code.
Question is: what should I install to have it running there? What materials should I take to be self-sufficient? I would be glad if you could provide me with link to some tutorial on how to compile my first code - I want to test it before I go(simple "hello, world" would be sufficient).
Get a copy of Practical Common Lisp: http://www.gigamonkeys.com/book/
The book gives more motivation about using Common Lisp and explains it.
Also download the HTML version of the Common Lisp standard from here: Common Lisp Documentation. Especially the Common Lisp HyperSpec 7.0.
Get the SBCL documentation from sbcl.org
Being from an C++ background you probably already learned other Algol dialects and because of they all are different dialects they usually are pretty easy to learn. It's pretty much the same as learning another spoken language closely related to the ones you know are easier than the ones farthest away.
LISP is not an Algol dialect so expect it to be different than the transition between C++ and Java. LISP dialects share most of the original specification made by McCarthy in 1958 so learning a new Lisp dialect when knowing one is simple. I recommend you start with Paul Grahams essay and his Common Lisp version of eval. There are numerous historical and current books you can download for free but for Common Lisp the CLHS (hyperspec, direct link) is the most important. Paul Grahams book On LISP is freely available too but it's more for intermediate Lispers.
I love Land of Lisp. It's a nice book where you learn the essence of Common Lisp. Previous version of an early chapter and chapter 8 from it are freely available. I've bought this book and think it's a fun way to learn Common Lisp. (I also bough the new Racket (Scheme dialect) version of the book called Realm of Racket, but I think the old LOL is slightly better book while the RoR has cooler (graphical) games)
I learned Common Lisp as my first Lisp. I don't think it's important what dialect you choose to learn but it's important to think in Lisp and making your own Eval from scratch (making your own dialect or subset of LISP) in LISP. Also if you like interpreters and compilers you should try to make one in something different than Lisp as well. You'll learn a lot from it.
I use Clisp when doing Common Lisp tasks since it has readline support and I think it's easier to understand it's error messages and debug interface. I even run my programs in it unless I need more performance. It doesn't happen often but then I use SBCL.
Good luck :)

Guidelines for creating a programming-language enjoyable to write programs in? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm currently working on the topic of programming-languages and interpreter-design. I have already created several programming languages but couldn't reach my goal so far:
Create a programming-language which focuses on giving the programmer a good feeling when writing code in it. It should just be fun and/or interesting and in no case annoying to write something in it.
I get this feeling when writing code in Python. I sometimes get the opposite with PHP and in rare cases when having to reinvent some wheel in C++.
So I've tried to figure out some syntactical features to make programming in my new language fun, but I just can't find any.
Which concrete features, maybe mainly in terms of syntax, do/could make programming in a language fun?
Examples:
I find it enjoyable to program in Ruby because of it's use of code blocks.
It would be nice if you could include exactly one example in your answer
Those features do not have to already exist in any language!
I'm doing this because I have experienced extreme rises in (my own) productivity when programming in languages I love (because of particular features).
You mentioned Ruby in your question. AFAIK, Ruby is the only programming language, for which Joy is an actual, stated, explicit design goal. (In fact, it is the only design goal.)
The reason that Yukihiro Matsumoto was able to design Ruby this way, is that he already knew and used tons of programming languages before he started designing Ruby and learned tons more in order to design Ruby. (Interestingly, he didn't know Python, and has said that he probably wouldn't have created Ruby if he did.)
Here's just a tiny fraction of the languages that matz has either used himself, or looked at for inspiration (or in some cases for inspiration what not to do):
CLU
Sather
Lisp
Scheme
Smalltalk
Perl
Python
Haskell
Scala
PHP
C
C++
Java
C#
Objective-C
Erlang
And I believe that this is one way that good programming languages can be designed (what Larry Wall calls postmodernist language design): Throw away everything that didn't work in the past, take everything that worked and combine that tastefully.
Of course, this requires that you actually know all those languages from which you want to "steal" and in particular, it requires that you know lots of very different languages with different paradigms, different concepts and different "feels", otherwise the idea pool from which you steal is rather small and inbred.
Consistency.
Its the feeling that you already know something when you use an API or feature you've never used before. It also makes you more productive as you don't have to learn something new for the sake of it.
I think this is also one of the Ruby 'likes', in that if you follow the naming convention, things start to 'just work' without bindings and glue and suchlike.
For example, using the STL in C++, many of the algorithms are the same for all containers - even strings. That makes it nice to use... except for those parts that do not follow the same API (eg vector of bools) then the difference is more noticable.
Two things to keep in mind are orthogonality and the principle of least surprise.
A programming language should make it easy to write correct programs and difficult (if not impossible) to write incorrect programs. For instance, in Java
long x = 2000000000 + 2000000000;
overflows, while
long x = 2000000000L + 2000000000;
doesn't. Is this obvious? I don't think so. Does anyone ever want something to overflow? I don't think so.
Hilarity.
http://lolcode.com/
Follow common practices (like using + for addition, & for bitwise/logical and)
Group logicaly-similar code in namespaces
Have an extensive string processing library
Incorporate debugging facilities
For a cross-platform language, try to minimize platform differences as much as possible
A language feature that appears simple and easy to learn surprises and delights the programmer with its unexpected power. I nominate Haskell type classes :-)

What is the tersest/densest commonly-used programming language currently available?

I refer you to the following video, which describes how to implement Conway's Game of Life in APL, using a few dozen keystrokes:
http://www.youtube.com/watch?v=a9xAKttWgP4
This video was featured prominently in the Return of Uncle Bob Martin podcast, in which Scott Hanselman complains that "his hands hurt" from programming in languages that require too many keystrokes.
Of course, none of us are going to replace our keyboard just to learn an old, obsolete programming language (or are we?), but I have heard that programmers can be two to three times more productive, depending on the language they are working in. Is it because they are working in "denser" languages?
What are the densest commonly used (practical) programming languages currently available? Do they improve productivity because they are dense?
just look at threads tagged code-golf
:)
From a definition of code golf ...
It seems that someone gives us a problem to solve, tags the question
code-golf and the winner is whoever completes the solution in the
fewest characters
Like in golf where the low score wins, the fewest amount of characters
"wins". While certainly the best solution in every case is not
necessarily the solution that has the fewest characters or fewest
lines of code, it can be a fun way to exercise your programming
muscles.
I think this question can only be answered if you consider the sort of support libraries that a language has available. For example I can do things in PHP using very few lines of code because there's loads of help for network requests, graphics processing, array and string handling etc., etc.
Using jQuery means I am typing less also when writing script. So the question isn't as simple as you suggest.
It has to be J.
Nowadays both Perl and many functional languages can be very terse, although APL is still considered the champion in that.
In terms of productivity, there is a level when terseness can help (Python and Ruby are considered more productive than Java/C# because they are more terse), and then there is a level where terseness makes the code very hard to read (APL is famous for that, as well as short Perl scripts). One needs a balance between the two. Also, there are a number of autocompletion editors that allow, for example, longer variable names without requiring a lot of extra typing.

World's First Computer Programming _Language_? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
OK -- a bit of an undefined question (is the pattern of plugs in an Eniac plugboard a language ??) but contenders include:
Konrad Zuse's PlanKalkül (1940s) -
never implemented (generally
accepted as the first).
Whatever Ada Lovelace (1840s) programmed in (not
Ada) -- if she is the first
programmer, as everyone says, she
must have used the first programming
language, no? Again probably never
implemented - but did Babbage have
anything that could be called a
language?
Turing's description of
his Turing machine (1936 paper). In
the paper he actually writes
programs and simulates their
execution mathematically - that
makes it as good as (and earlier
than) PlanKalkül in my book.
Autocode for the Machester Mark 1 computer (1952) -- compiled, high level, beats Fortan to the punch (?). Mr Turing again (!).
Fortran (Early 1950's) - beats out Lisp by a couple of years and undoubtedly passes the sniff test. But was it earlier than Mark 1 autocode ??
The PBS series Connections made the argument that the holes punched in tiles to control the patterns created on looms (circa 1700s??) were the first programming "language".
These were followed by player piano scrolls: Codes, on paper, which are read by, and control the operation of a machine. That's a programming language, isn't it?
DNA -- or does it have to involve silicon computers? ;-)
Since Ada Lovelace is widely regarded as the first programmer, I'd investigate what she called the set of symbols she was using.
Update: You can read the notation that Lovelace used in her Notes on Sketch of The Analytical Engine Invented by Charles Babbage By L. F. MENABREA. Lovelace was the translator, but her notes describing the programming of the Analytical Engine ended up being about four times longer than the original publication.
I think we need to agree on a definition of "programming language" to answer this question in any useful way. Is directly manipulating machine code a programming language?
Konrad Zuse's PlanKalkül (1940s) - never implemented
There was actually an implementation of the language published by Rojas et al. somewhere around the year 2000.
DNA -- or does it have to involve silicon computers? ;-)
Well, if you go down that road then the correct answer has to be RNA which existed before DNA. But then, do we have a Blind Programmer? ;-)
In the beginning there was Ada Lovelace , Then Bill said 'Let there be C#' And there was light !!
Assuming a definition of "programming language" as "a textual notation used to describe/control the intended behavior of a digital computer", I think there's only one possible answer: raw (numerical) machine code.
Many of the other answers (e.g. recipes for cooking) are clever, but aren't about programming per se, but about description/control in a different context or more general sense.
I would say that the first programming language actually used was the machine language of the first stored program computer, which I believe was Baby: http://www.computer50.org/
The language the analytical engine would have used was its own machine code, entered via punch cards indicating the operation to be performed and the columns (effectively registers) to perform it to. See these notes for some details.
Programming, at least in the declarative sense, comes down to combinations of sequence, alternation, and repetition. One might consider recipe authors as programmers, and therefore very early ones. Think about a recipe: it contains sequence (slice this, then chop that, then heat so and so...), alternation (if you want it moist then bake for 40 minutes, else if you want it "cakey" bake for 55 minutes), and repetition (while not stiff kneed the dough, repeat stirring until the batter is smooth). Recipes go back thousands of years.

Anyone know of any statically-typed scripting languages? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm about to start an LFS-based linux distro just for a hobby project. I plan on doing some very non-standard tasks, and most of it will involve change almost all scripts in the distro. (mainly init scripts, but also I'll be writing a simple set of package manager scripts.) Since I'm gonna be going this far off the norm, and since I have never been a fan of dynamic-typed languages (perl, python, bash and the rest are good, but just not my forte), I was wondering if anyone knew of an interpreted language that actually has declared variables.
Typically the statically typed languages are compiled languages. I guess the reason is, that statical analysis of types is rather expensive and you have to have an in depth look at all the code you're processing. After you've done that it feels like a waste to not write all that information into a file, so that you don't have to do it again next time. So you quickly end up with a compiled language.
On the other hand, to turn a compiled language in a "not-compiled" one is rather easy. You just don't store the results of the compilation anywhere but execute them directly. One compiler I know that provides such a wrapper is GHC, the standard Haskell compiler. You can add #!/usr/bin/runhaskell to your source files and then directly execute them. And since you're planning to be far off the norm, Haskell seems like a perfect fit ;). But expect some rather large startup time for your scripts, because all the "compile time" analysis and optimization isn't free.
Haskell isn't made for shell scripting and it's a functional language, so if you've never seen it before, it might take some time to get used to. But it has very little syntactical overhead and the strength of functional languages is abstraction, so I don't see why you couldn't create a library that makes shell scripting fun. There is even some experimental Haskell shell, but it does seem to be more a proof-of-concept than a real solution.
Generally I would say the overhead of all the type analysis is significant, but I would suggest you pick your favorite statically typed compiled language and look for a wrapper like runhaskell to execute scripts written in it.
quick google. F3, javaFX script, Linden Scripting Language (scripting for second life), Unlike the comment on the first answer F# can be used as a scripting language http://blogs.msdn.com/chrsmith/archive/2008/09/12/scripting-in-f.aspx
Felix, Tuga, CFGScript, Talc, Angelscript, and guessing there is more than that quick search.
Douglas
Groovy. By default it's dynamic, duck-typed. But also supports static typing.
F# provides a combination of "type safety, succinctness, performance, expresivity and scripting".
Look in to the "typeset" command in your favorite shell. bash and ksh93 both can enforce integers and strings, use references (variable variables), etc. With ksh93, you can also do floating-point math and use objects with attributes. Static typing doesn't really buy you anything useful in init scripts and similar. You're primarily going to be reading files and running system commands - which is what the shell's really good at. Take some time with the O'Reilly "learning the Korn Shell" book before deciding that all those other Unixes are stupidly designed... ;)

Resources