Programming languages

Let's talk about programming languages. Post programming languages, features, tips and other syntax.

Other urls found in this thread:

ccs.neu.edu/home/matthias/HtDP2e/
twitter.com/NSFWRedditImage

I might as well start
Perl
Writing a program that takes a script and draws on a terminal window based on the contents
Dispatch tables. It's basically a jump table made with an associative array. Great for parsing user input.
my %dispatch;$dispatch{go} = sub {something(shift);};$dispatch{stop} = sub {otherthing(shift);};my $input = shift; #get input$dispatch{$input}->(arg);
It's made to be practical rather than correct. It's ugly as fuck but behind the ugliness there are some really clever design choices
Pic related

Python
Web Dev
It's not Ruby or PHP
Best scripting language
Python.org

Rails is the bad one here, not ruby. Really wish more people cared/hired for sinatra/padrino style microframeworks instead of that monolithic monster. It's almost as bad as Django.

Django is fine.

Gno

C++
Signal processing and other applied math
Portable assembly with objects, generics and closures
Infinitely better than C despite flaws. Allows much more disciplined code for less errors
book by Scott Meyers, cppreference.com

C++
Musculoskeletal simulation
Standard library's pretty great. Templates, although I tend not to write them myself. The auto type specification is nice too. It allows you to avoid writing the entire type out when it's the return type of some other function, such as an iterator, since you can change the container and the iterator's type is update automatically. Since it's not a type itself it also forces initialisation of data. Converting between invalid types, including pointers, is also disallowed without explicitly stating it.
You can get away with writing modern C++ that doesn't use explicit dynamic memory allocation. It can all be abstracted away through std::unique_ptr, std::shared_ptr, or containers. The types also make the usage of the data pretty explicit too.
Learn C first. I found that most online tutorials jump straight into classes and templates which is really annoying to learn from the start. If you already know how to program, then just start on whatever project you want and look up how to do specific things.

I'm trying to learn Racket, but it looks like no one who has written about it knows how to teach. I have the book Realm of Racket, which is supposed to be good, and I have made it to the fifth chapter, about one third through the book, and I still don't think I have learned anything beyond how to glue libraries together.

It also frequently directs you to the official documentation, but if I were a complete beginner (the target audience for the book) I would not be able to make any sense of the language reference. Like WTF is a "contract"? Yeah, I know what it is, but I didn't learn it from RoR.

There is also the language guide, but it's not good for learning from scratch either, it will often reference topics that come later

ccs.neu.edu/home/matthias/HtDP2e/

OK, that's on the other end of the extreme, it babies the reader like they never programmed before. Well, at least it's true to its purpose this time.

Once I'm finished with my education I'm gonna sit down with Racket again. Never programmed in my life but Racket was really easy to get a grip on.

Any good ideas for programs I could write in the private health sector, just for my own convenience?

R for data analysis and econometrics. I like that it's a functional programming language because I can work on lists of data sets easier without getting lost in loops. You can find a lot of resources to learn R online, but I'm a fan of Hadley Wickham's books that you can read for free online.

It's called a hash. This isn't PajeetHP.

An associative array is an array which uses keys instead of numbers. A hash table is an associative array where data is added randomly, so that write times are consistent. There's nothing wrong with calling a hash table an associative array, which is what awk does. I'm calling it an associative array because I care about the string keys, not the random entry.
Not everything is an Indian conspiracy to dumb down tech.

associative arrays and hash tables aren't the same thing you dummy.

Did you mean to quote there friendo?

"Associative array" is a much more descriptive, general term. Perl might call it a "hash", but that's specific to Perl. When you're describing language features in a general thread about programming languages your goal should be describing them, not telling people what they're called.

In more general usage of the word "hash" it's just an operation with many applications, including hash tables, which in turn are often used to implement associative arrays. It's a confusing word for this, especially when you're targetting people who don't know about all of Perl's neat features yet.

What's wrong with it?

D also calls them associative arrays, I don't see the problem

I can recommend the book 'Data Analysis Using Regression and Multilevel/Hierarchical Models' by Gelman and Hill as a pretty good, practical-minded resource on fitting models to data in R. It talks about BUGS (Bayesian inference Using Gibbs Sampling) as well.

Thanks for the suggestion. I also would recommend Hadley's books, Advanced R and R packages to learn more about the language itself. Great books!

Nobody cares except some people who have something to prove and look for low-hanging fruit to show off how smart they are (not really). It's like that kid in class who constantly interrupts the teacher to ask question when he's not really interested in the answer, just wants attention.