MATLAB

I really like MATLAB, even if I don't use it all that much in my job (C, mostly, with a fair amount of Python that I learned on the job, and then occasionally MATLAB).

The things I like about MATLAB:

  • the Easter eggs, particularly the "why" command, but also the many others

  • has a great console environment -- I particularly like the ability to easily track memory usage and variable sizes and whatnot with the "whos" command

  • backslash notation for matrix division

  • clever access methods with matrices (for instance, A(A>0) would return only the elements of A that are greater than zero)

  • matrix manipulation galore; it's so easy to use the A(:) notation with sub2ind or ind2sub to do pretty much whatever you want to a matrix without loops (well, internally there might be some), but also reshaping matrices is simple as can be with the reshape command

  • Working with images and audio is quite easy -- imagesc (I don't really like imshow as much) is really easy to use

  • I don't have to use commas between items in a row or column vector ( "A = [1 5 2 6]" is easier to type than "A = [1, 5, 2, 6]" )

  • like the above, I like that string concatenation is similar (I don't have to use "+", I can just type disp(['Your result is ' num2str(num)]))

  • spectacular tools with graphing, including labeling graphs with LaTeX formatted equations

  • so many great tools, and things like taking an FFT or applying a digital filter to an input couldn't be any easier

  • the "keyboard" command makes for easy debugging when things are going wrong

  • Usually, the error messages are simple enough to understand

There are plenty of downsides, but I don't really get hung up on the 1 indexing aspect of it, even if 0 indexing does come more naturally -- although you have to admit, it can be a little confusing when you're explaining something and to access the first item in a list, you have to use index 0, I find this can make reading code with 0 indexing more difficult to explain to a rubber duck).

/r/shittyprogramming Thread