Live data from Hacker News

Ask HN: Help For Clojure Addiction

news.ycombinator.com

1–10 of 15 posts

Ask HN: Help For Clojure Addiction

#1
I have recently been playing with Clojure for personal projects. It is quite addictive. Also I am shocked by its leverage and how productive I am in it.

Now at work (Java and C++) I am constantly thinking of ways of getting my next Clojure fix.

How should I solve this problem? The problem is that I would rather program in Clojure than anything else. Here are some ideas and issues with them.

1. Switch jobs. Except that most of the jobs on Craigslist (SF Bay) that mention Clojure list it with five other buzz words. It sounds like interview bait. There is no guarantee there will be Clojure on the job.

2. Ask my company to use Clojure. I suspect they will not be open to this because they have a mob of Java programmers who won't understand the code. They rejected another person's request to use Scala a few months ago. Still worth a shot. But I can see the PHB eyes glazing over.

3. Create a web-based start-up using Clojure. Despite Clojure's productivity this will take some time. This is the path I am working on right now. But it seems like such a long slog.

Ideas?

Re: Ask HN: Help For Clojure Addiction

#2
Use Clojure to generate your Java code. As far as anyone else is concerned you're writing Java.

I've used code generation at work quite a bit, whenever I've had somewhat repetitive code to write that I couldn't factor away. It makes my job a lot less tedious and more fun.

Re: Ask HN: Help For Clojure Addiction

#3
You can sneak a lot of functional style programming into Java/C++. It's easier with C++ because they have first class functions, but you can do a lot even with Java. I think it's not optimal to do a 100% functional style, even though you can, because all the syntax junk gets in the way, but just by thinking in terms of higher order functions instead of objects it will make a lot of the pain go away.

Re: Ask HN: Help For Clojure Addiction

#4
post #2

Use Clojure to generate your Java code. As far as anyone else is concerned you're writing Java. I've used code generation at work quite a bit, whenever I've had somewhat repetitive code to write that I couldn't factor away. It makes my job a lot less tedious and more fun.

Is there any public Clojure code for this?

Re: Ask HN: Help For Clojure Addiction

#5
I am a "PHP" developer at work. All day I sit around writing "PHP" code. Here is how I start my day: "You guys want this done quickly and reliably or should I do it in PHP" ..

We're a PHP shop with a huge Common Lisp code base.

Re: Ask HN: Help For Clojure Addiction

#6
post #2

Use Clojure to generate your Java code. As far as anyone else is concerned you're writing Java. I've used code generation at work quite a bit, whenever I've had somewhat repetitive code to write that I couldn't factor away. It makes my job a lot less tedious and more fun.

Is there any public Clojure code for this?

I have no idea. It's easy enough to make special-purpose code generators yourself...don't bother trying to make some kind of universal system, just hack out code to generate exactly what you need for your current project. You may see ways to generalize it later.

I'm at a C# shop myself, and generally just write my generators in C#. Just spitting out strings of sourcecode and writing them into files. I would think Clojure would be better for this sort of thing, since it's got macros.

On the other hand, doing it in C# worked really well for one project, because after writing the generator I realized that I could convert it from a compiler into an interpreter, and make a program that didn't need a generator after all because it was so flexible at runtime.

Re: Ask HN: Help For Clojure Addiction

#7

You can sneak a lot of functional style programming into Java/C++. It's easier with C++ because they have first class functions, but you can do a lot even with Java. I think it's not optimal to do a 100% functional style, even though you can, because all the syntax junk gets in the way, but just by thinking in terms of higher order functions instead of objects it will make a lot of the pain go away.

> they have first class functions

No it doesn't. C++ has function pointers, and you can make functors objects. But that doesn't make first class functions at all. Thinking in terms of higher order functions in C++ is just a different sort of pain, though it's admiteddly usefull sometimes. But you better like making template functors then.

Re: Ask HN: Help For Clojure Addiction

#8
There is a company named WeatherBill which I personally know is interested in hiring Clojure users. (I think the only online advertising they did was a tweet which was maybe picked on disclojure.org.) One person there recently told me that they're very friendly to telecommuting -- but only within the US.

(This telecommuting thing probably doesn't matter much to you, given they're IIRC in SF, but others might like to know that...)

BTW, have you tried going to Clojure meetings, if there are any in your area? Some people prefer to go to them to find coworkers.

Re: Ask HN: Help For Clojure Addiction

#9
Don't ask for permission. Recognize the need for something important at work and write it in Clojure and often coworkers/bosses will be so glad to have it and not have had to write it themselves that they won't care what language it's in. Of course now you're responsible for it.

Re: Ask HN: Help For Clojure Addiction

#10
I recommend #3. Hang out on IRC & the groups, open source the non-secret-sauce from your startup. Build a brand around yourself as a badass Clojure programmer. Best case scenario, you have a successful startup. Worst case, you're a well known Clojure expert, and someone will hire you to work for them.
Post reply on HN