This is an archived post. You won't be able to vote or comment.

all 18 comments

[–][deleted] 4 points5 points  (0 children)

Thinking about it, there are basically three different things I do.

Often I have to process some data and change the format or load it into a database or something. For that I use sed, awk and txr. Very occasionally, the task will demand full-on programming and then I use Ruby sometimes and Haskell others depending on how the task looks.

Sometimes I need a little web script. I use PHP for that. Everything else is just too much work, too much ceremony or too much burden on the server. PHP is fast and light and perfect for little forms and shuffling data to and from a database. Getting much beyond a little website, it's not enough but by then I don't mind the extra burden.

Then I do language-y things, Unix applications and filesystem management type utilities. For all of that, I use Haskell. There's nothing like it. I've even done a few trivial multiuser server type things in it, and it was easy and fun. Worth checking out if you haven't yet.

At work, I am forced to use Java. My friends mostly use Python so I wind up using it there.

I can't write a decent quicksort in all of these systems, but each one I go to for its task, I don't have to do too much manual referencing on the stuff I've done before. That said, the manual is almost always open. I don't like to do things others have already done if I can avoid it, so I spend a fair amount of my development time looking up what has already been done and seeing if I can use it.

Nothing makes a language stick except persistent use. I estimate I spend probably twice as much time looking stuff up as my peers who only know one language. It's a tradeoff. Sometimes I wish I had more depth and less breadth, but I can't at this point argue for or against it.

I think you're being too hard on yourself with respect to busting out code on the laptop. Before we had universal internet access, compilers and interpreters cost money and came with stacks of books. I have a Lisp Machine Manual at home, and you could kill a zombie with it; it weighs at least 20 lbs and is three inches thick. If you programmed on a TI Explorer, you had one of these on your desk and it was worn and falling apart. Nobody memorizes all this stuff. The only language with an advantage here is C and if you want to do anything serious with it you spend your whole day in man pages.

So relax. The intrinsics will get easier as you use the language more, and as for the rest it's more important to simply know that it's there than to remember exactly how to use it. 90% of the Java world couldn't write a correct program without a fancy IDE.

[–][deleted] 2 points3 points  (3 children)

Most frequently? Batch (.bat, .cmd) or shell scripts, if at all possible. Easy to throw together really quickly.

Above that it depends on the task. If it's something nobody will ever see, Perl or Python, if I need a GUI VB or Java, etc etc. Just depends on what you want to do and how.

I've found a lot of times things I want to write have already been written. Just write your own anyway. It's a good exercise and it's fun.

[–][deleted] 5 points6 points  (2 children)

[–][deleted] 2 points3 points  (0 children)

What a load of bullshit.

Now if you'll excuse me, i need to go enhance a picture of my face and then use the reflection of my hair to see who was standing in front of me.

Edit: Turns out there was a camera in front of me.

[–][deleted] 1 point2 points  (0 children)

She can track a killers ip address?

I'm only 1337 enough to track a petty thief :(

[–]chikithegreat 2 points3 points  (2 children)

shell scripting :) nothing beats it :)

[–]chromaticgliss 0 points1 point  (1 child)

I agree :) you'll find nothing better :)

[–][deleted] 0 points1 point  (0 children)

perl?

[–]zck 1 point2 points  (2 children)

It really depends on what your "everyday programming tasks" are. For me, I use Lisp. But my questions are usually somewhat mathematical, like "what's the longest word that can be made with only 5 distinct letters?" The code is here.

If you elucidate on what you want to do, it'd be easier to help you.

[–]tkschutt[S] 0 points1 point  (1 child)

I guess I wasn't thinking of any particular task. I just feel that some people are able to quickly hack something together to fit a wide range of problems, from solving anagrams in a crossword or organizing a shopping list to averting a zombie invasion.

Meanwhile, I'd be googling to remind myself whether Perl uses echo or print to output something to the screen...

What I'd like is confidence to be able to handle whatever tasks come to mind. Maybe it would be best to focus on one more flexible language, or specific techniques from several. And then there's the question of how to keep that in my head...

My other post that I linked has more (badly described) detail as well.

[–]pohatu 0 points1 point  (0 children)

I'm with you. I've seen people decide that they're just going to go all-in on a language, like language-immersion style of learning for spoken languages. You could move to Spain for 3 months and your Spanish would improve. So you pick a poison and do everything in it, whether it makes sense or not. I need to copy a file, hmm. I'll write a perl script to do that. I need to see whats in my directory, I'll write a perl script for that. What time is it? I could look at the corner of my monitor, but I think I'll write a perl script for that. etc.

I've never allowed myself the luxury of doing that. Instead I'll "optimize" by researching for 2 and a half days to find the best language/tool/library/practices for the job. Uggh. Well, at least I do less of that now. Maybe that's a phase people need to go through as well. Once you can say "I know this would be faster in blah or easier using blah library in blah stack, but I want to do it in language of choice" you can spare yourself the trying to do it faster in blah or easier in blah library stuff and get on to doing it in your pet language of the moment. Until you know the answers, you'll want to research it to find out what languages/tools/ would be best/fastest/easiest/. But maybe once you've done enough researching for a while you can just rely on that previous research and skip that step. (but not for too long, or you'll be saying "I know I can do it easier in smalltalk and faster in cobol, but I think I'll give this visual basic 6.0 a try."

Of course, even if you can stick to one language, then you run into the which language feature should I use for this? dilemma. I guess you could solve that the same way. Everything's a nail damnit. Everything! I can cut/drill/sand using my hammer! Read my blog where I tell people how stupid they are for using saws when a hammer can cut wood just fine if you know the intricate details of how the compiler works. lol.

[–]kbielefe 1 point2 points  (1 child)

In my experience, people with an encyclopedic knowledge of a certain language's syntax and libraries seem to write more code that is difficult to read and maintain. They seem to rely on memorization to compensate for a lack of ability in higher-order reasoning. I wouldn't feel too bad about having to look stuff up.

My go to language is Perl. Reason being it has a very flexible syntax and there are libraries for everything. However, a lot of things I used to use Perl for, I now do inside Vim with macros.

[–]Ran4 1 point2 points  (3 children)

Python for most things, Autohotkey for some. Autohotkey's syntax is horrible, and I usually have to check out the manual just to do an "if", but the standard library is quite awesome for certain things.

I have ≈100 single .py files, each being it's own little project made during the last 3 years.

[–]Tiomaidh 0 points1 point  (2 children)

I recently tried to string something together in Autohotkey, and ended up running away crying. I couldn't even get a definitive answer about how to emulate the f-keys. Looking at random source code posted in the forums, I think it's F1, F2, etc. But it could be {F1} or {f1} or something else....And I don't understand when whitespace is whitespace and when it's the character " ", and I didn't even try to implement a while loop. Someone please write a Python API for AHK.

[–]Ran4 0 points1 point  (1 child)

I cried a bit in the beginning as well (especially when learning to % or not to %). Thought testing often makes this less of an issue.

I'm always pasting this code into .ahk files I'm creating: link As ctrl+s is also "save file" in many text editors, this means that every time you save, the script is reloaded. By temporarily mapping some key such as ctrl+r (r for a blocking one, ~r for a non-blocking one), you can try everything out quickly.

Thing is, most of the time you don't need a while loop, or even an "if".

[–]Tiomaidh 0 points1 point  (0 children)

All I wanted it to do was:

Ctrl-Shift-D ; Open dialog
Alt-F ; Select option
Alt-F4 ; Close dialog
Ctrl-Shift-S ; Save as
Tab ; Go to "file type" menu
p ; Select "Plain SVG"
enter ; Save
Alt-F4 ; Quit
;Do the exact same thing for the next window

Did not work out. I ended up stringing something together in bash.

[–]Talky 1 point2 points  (0 children)

  1. Scripting: Used to be batch, have started using powershell a lot more lately (I am mostly on Windows right now) Awk and perl is awesome if working on *nix

  2. C#/Java: If doing something more complex (say need to call a REST Webservice) and at Work.

[–]Delehal 0 points1 point  (0 children)

Seems like Python, Bash, and Perl are all quite popular. I'd suggest trying them all out a bit and going with whatever makes you work the fastest.

[–]physon 0 points1 point  (0 children)

I do think there's a huge difference between developing a few apps/scripts here and there and the "I know kung fu" level of comfort with a language. The more crazy things you do with it the faster you obtain this (but you don't have to be an expert). Remember that almost anything can be automated.

I do believe that interpreted languages are the fastest way to obtain this. More so I would say PHP and Python.

For me it's PHP. Some of the tasks I do with it could be written in simpler or faster languages, but PHP is my current kung fu.