What language people learn out of own motivation, vs what languages people do for pay. I'd say based on this graph it, and knowing Haskell myself, that choosing Haskell is still a viable way to attract talent. (that Haskell-spike in the animated chart half through the article is... opportunity I guess)
What programming languages are used late at night?
221–230 of 244 posts
Re: What programming languages are used late at night?
#222It's funny that the runner up is on the opposite side of the abstraction spectrum: assembly. Students, longbeard contractors, and hax0rs must be the nocturnal contingent there.
Meanwhile, COBOL programmers are stuck in bank basements with no internet access.
Re: What programming languages are used late at night?
#223Otherwise written as "what programming languages are being asked about late at night." To me, who rarely pulls up SO, correlating SO questions and page views with usage is a bit biased.
Whoah! The big news for me is that there is a programmer who rarely uses SO. I use it constantly. Can you say more about: 1. What your programming set up is. 2. What you do when there is an issue? I didn't know there was a reasonable alternative. I do the Google -> SO a lot. The only time Google brings up a different page is if the question is REALLY basic like how to use a function. Edit: added this postscript: I ha…
Re: What programming languages are used late at night?
#224I wish there was one of these correlating gender (actual gender) of the author of the question and language.
Re: What programming languages are used late at night?
#225Earlier quoted context omitted.
I helped out a bit with the BCL pretty-printer in my day. (Mostly contributed in-depth code reviews.) Is Ganeti related to Ganpati? Sorry, it's been a bit since I left Google. Memory is fading.
Not at all, only the name is very similar :)
There are only so many words. And many of them similar.
Re: What programming languages are used late at night?
#226Earlier quoted context omitted.
Out of curiosity, what do you currently dislike about the shell, if anything? I'm not setting up a "you hate the shell" statement here - hashing out gripes and dislikes can sometimes be a great way to jump straight into the middle of an iterative positive feedback loop of learning. (Or at least I think so, anyway. I think that if I did that myself it would identify the (sometimes not intuitive) blocks and glitches I…
I think it's mostly that I need to write it so little, that I never get to become proficient "enough" with it. There is little motivation to invest hours to learn it properly, because a) I get to write bash scripts so little that b) I would forgot half by next time I use it. I think I'm basically stuck on the worst part of learning curve. Btw I use console for pretty much everything from git shell to vim. But when I…
The fact that you're already in the console puts you in a pretty good position: now you just need to stay there whenever you perform complex tasks. I have very few bash scripts myself (the little code I actually have saved is scattered everywhere; most of my scripts are on some disks that are offline at the moment). Rather, I primarily use the shell as an interactive way to let me hop to wherever it is I need to go as a sequence of steps.
Ultimately using Haskell (or Scala) will also definitely get the job done, but with that you have to create a file, hammer the code out (and write whatever boilerplate for forking and execing and piping), then save it and run it. With bash you just type something and hit enter. See what happens, hit the up arrow, edit, repeat. So it's a standard REPL, but this REPL can launch and pipe and fork in much less characters than other languages can.
I'm very curious about the use-case you loosely described. There are a few ways I could interpret what you said; depending on which you mean, what you describe might genuinely not be easy in bash.
If you need to fork two processes and merge their output, that is definitely not easy to do in any shell, AFAIK - you can do (proc1 & proc2) and hope for the best, but output might get mis-buffered and partial lines from one process might get merged with partial lines from other (eg, read(4096) from one might get "hello world" and read(4096) from the other might get "...blah\nblah\nbl" and then you could end up with "blah\nblah\nblhello world" - I've seen this happen once when two processes fight for priority on a terminal). AFAIK this is "not supposed to" occur :) but doing your own line buffering (ie, making a program, like you're already doing) would be critical if you needed this kind of merging.
If you're just doing simple things like running a program that outputs a list of URLs, doing some simple testing on that list, and then doing something else based on the results, that's quite easy.
Here's a highly-contrived script that
- gets a series of URLs
- directly pings all HTTPS URLs via curl and collects the output in output1.txt
- pings all HTTP URLs against https://example.com and collects the output in output2.txt
- parses the contents of output1.txt as a series of comma-delimited lines, then looks for lines that contain "URL" after the 2rd comma, and looks for a URL on the next immediate line after the 1st comma
- only fetches URLs matching the above specification that are HTTPS, chops up the URL from https://example.com/path1/path2.ext to https://example.com/path2.ext, and runs wget on the result
- runs 50 copies of wget in parallel (xargs will start new wgets as old ones finish) on the contents of output2.txt (warning: this will result in a thoroughly messed up terminal if you ever do this, but it works great!)
program_that_outputs_urls | sed -n ',^https://,{p;b1}w/dev/stderr;:1' \
2>(while IFS=$'\n' read x; do curl -s "https://example.com/?url=$x" \
|| echo "$x fail"; done > output2.txt
) | while read x; do curl -s "$x" || echo "$x fail 1"
done > output1.txt
u=0
while IFS=$',' read -a x
Some notes:- the sed command first grabs HTTPS URLs (,^https://,{...}), prints them directly (p) then jumps to :1 at the end (b1); if the {} block doesn't fire that means the ,https://, match didn't work, so that means the (w/dev/stderr) runs, which does what you think (GNU sed accelerates writes to /dev/stderr; on other UNIXes that path - or /proc/self/fd/2 - needs to exist for this to work)
- 2>( .......... ) is a bash subshell thingy that spits all of stderr (fd 2) into a subshell (this is also great for "command | ... do; ... x=1; done" situations - you'll lose your "x=1" association from the other side of the pipe. Doing "while ... do; x=1; done - - The "2>(...) | while ... done" structure is simply the way I've expressed pushing stderr into the subshell, while pushing stdout into a pipe.
- "while IFS=$',' read" is the way you get `read` to use a different internal field separator. As an aside, I often use "IFS=$'\n' x=($(ls -1))" as a way to fix the "everything in the array is one of the words in the line" problem, as well as similar "unfixable" issues when bash is parsing input with tabs and spaces in it, or when you're using "read -a" to split things into arrays.
- The "if (u == 1) ... done; if (this_is_a_url) u=1" is a standard structure you've probably used elsewhere that implements the "look for URLs on the next line" behavior.
- Nobody's checked the git access logs, but I'm personally pretty sure bash's regex functionality was checked in from a cave full of dragons :) - besides the \/\"\/ picket-fence issues it often has its own ideas about matches. You cannot single- or double-quote strings; your quote will be considered part of the regex (:D :D). On bad days just pipe everything through "awk '/^https:\/\//{ print $1 $2 $3 ...; }'" or similar (yes that command needs editing but you get the idea).
If you want to explain the use-case you described in more detail, I could probably take a crack at figuring it out. I kind of went off on a very random tangent here, but it was fun.
Re: What programming languages are used late at night?
#227Earlier quoted context omitted.
I think it's mostly that I need to write it so little, that I never get to become proficient "enough" with it. There is little motivation to invest hours to learn it properly, because a) I get to write bash scripts so little that b) I would forgot half by next time I use it. I think I'm basically stuck on the worst part of learning curve. Btw I use console for pretty much everything from git shell to vim. But when I…
I see. Okay, well, here's how I'd respond to what you've said. The fact that you're already in the console puts you in a pretty good position: now you just need to stay there whenever you perform complex tasks. I have very few bash scripts myself (the little code I actually have saved is scattered everywhere ; most of my scripts are on some disks that are offline at the moment). Rather, I primarily use the shell as a…
Re: What programming languages are used late at night?
#228Earlier quoted context omitted.
I see. Okay, well, here's how I'd respond to what you've said. The fact that you're already in the console puts you in a pretty good position: now you just need to stay there whenever you perform complex tasks. I have very few bash scripts myself (the little code I actually have saved is scattered everywhere ; most of my scripts are on some disks that are offline at the moment). Rather, I primarily use the shell as a…
hey, thanks for response. Even though that example was just something I made up, your post helped me in learning.
(Bash won't solve every problem (particularly tooling and things that might evolve over time; see also GNU autoconf :D), but it is awesome when it can be used to speed interactive tasks up.)
Re: What programming languages are used late at night?
#229Earlier quoted context omitted.
The fact that you work in one of the most beautiful & well-designed cities for walking around or eating outside doesn't hurt either!
Also more money for food usually means more wine usually means more time before return to work
[1] http://www.edenred.co.in/Our-Offerings/Work-life-Benefits/Ti...
Re: What programming languages are used late at night?
#230Earlier quoted context omitted.
There's definitely the overhead in re-loading where you were yesterday, although sometimes that's handy - "sleeping on it" does work. I find (in any work, not just the rare C work) that when I get into a juicy problem I just don't want to stop. It's nothing to do with the task switching / reload cost, it's that I'm interested in what I'm doing. So I think you're right that it's about what kind of developers a languag…
"Some people who paint are workers, others are craftsmen, others are artists. All use paint." That sounds so profound. Did you just make that up, or is it a old paint industry koan?