Live data from Hacker News

Why I'm Productive in Clojure

yogthos.net

91–99 of 99 posts

Re: Why I'm Productive in Clojure

#91

Earlier quoted context omitted.

In general, Python method is just combination of function object and pointer to "self" namespace.

I'd like to know if it's done differently in other languages. In my view, methods are curried function over self with a '.' syntactic shortcut.

That's pretty much how I view them as well.

Re: Why I'm Productive in Clojure

#92
post #87
post #80

Earlier quoted context omitted.

Why did you decide to switch from dentistry?

An intellectual, emotional disaster. I'd been programming since a child and I think in all honesty I was pushed into dentistry by the people that love me and wanted me to make money. However dentistry in London is medicine in two years then three years specialising in the head and neck. Then two years dentistry training. I found it a LOT of learning facts. I know that knowledge-based systems are better than humans fo…

Have you had any "portfolio" projects? That is, projects you can showcase? This goes a long way towards the lack of degree.

My story is too long to put into text, but the short of it is that I can relate to a lot of what you went through.

Re: Why I'm Productive in Clojure

#93
post #89
post #58

Earlier quoted context omitted.

Alfred North Whitehead on notation[1]: " By relieving the brain of all unnecessary work, a good notation sets it free to concentrate on more advanced problems, and in effect increases the mental power of the race. " Probably nothing in the modern world would have more astonished a Greek mathematician than to learn that...the whole population of Western Europe...could perform the operation of division for the largest…

Thanks -- I had seen this quotation but forgotten the source. It is even better than I remembered.

I keep having to look it up, and it's a devil to find.

Re: Why I'm Productive in Clojure

#94
post #92
post #87

Earlier quoted context omitted.

An intellectual, emotional disaster. I'd been programming since a child and I think in all honesty I was pushed into dentistry by the people that love me and wanted me to make money. However dentistry in London is medicine in two years then three years specialising in the head and neck. Then two years dentistry training. I found it a LOT of learning facts. I know that knowledge-based systems are better than humans fo…

Have you had any "portfolio" projects? That is, projects you can showcase? This goes a long way towards the lack of degree. My story is too long to put into text, but the short of it is that I can relate to a lot of what you went through.

That's another issue too. If it's not a public website that you're building it's quite hard to show off your work!

One of my favourites was a forward-chaining rules inference engine written in T-SQL on MS SQL Server for a sixth-form college. The Management Information System (MIS) was called unit-e built by Capita PLC and probably cost a LOT of money.

It was quite a good system, the query builder for advanced users was excellent (every MIS should have one), but it had a fair amount of data duplication - names, addresses, previous address etc. And the admin staff had lots of name changes and spelling corrections to make. Also you had the data entry dudes who'd write a lazy name like fiesta try basharat instead of Fiesta Try Basharat.

So I built the rules-engine as a stored procedure (SPROC) called by triggers on tables. The rules themselves were just simple SPROCs and some not so simple but the rule interface was simple and so the system was robust. All of a sudden every letter sent by the school was formatted properly and went to the correct address! The admin team even gave me and my junior a present! And the 'junior' became an expert in SQL and learnt a secret ninja weapon (rules, inference engines and conflict resolution).

How many good things were created? How do you demo the transition of knowledge? How do you monetize the time saved? How do you portfolio the potential for benefit of new rules that haven't been thought of yet?

Expansion of knowledge, the beginnings of infinities, there's so much out there I love it!

Re: Why I'm Productive in Clojure

#95
post #91

Earlier quoted context omitted.

I'd like to know if it's done differently in other languages. In my view, methods are curried function over self with a '.' syntactic shortcut.

That's pretty much how I view them as well.

Great then.

Re: Why I'm Productive in Clojure

#96

Earlier quoted context omitted.

In general, Python method is just combination of function object and pointer to "self" namespace.

I'd like to know if it's done differently in other languages. In my view, methods are curried function over self with a '.' syntactic shortcut.

Lua does not do the currying bit, but it does a lot less OOP and a lot more "dictionaries with stuff that can do something like prototype OOP if you squint hard enough". Java and whatnot just don't let you really use methods as first class citizens, so it doesn't matter.

Re: Why I'm Productive in Clojure

#97
post #84

Earlier quoted context omitted.

Right now I'm using a combination of leiningen, guard, livereload, compass and a shell script to handle my specific build workflow. I'm confused as to why you think leiningen has to do it all. I'm also not sure what you mean by auto rebuilder (for clojurescript I use the auto feature of cljsbuild ...). My workflow starts with starting a REPL. Also, I use vim very happily, many people use Cursive happily. But the reas…

I think you are misunderstanding. People have shown in this thread that they have a slightly different workflow from each other, but my point was that Clojure(Script) points you towards a particular type of workflow, one that I do not like. What I essentially want is 1 of three things: 1) Fast builds so I can set up an auto-build script. 2) A Leinengen daemon so I don't have to worry about building at all. 3) Clojure…

You can certainly get all of that stuff (except fast builds in some particular circumstances).

My project I described before is a web app, and my workflow involves my editor, a browser, a clojure repl, a clojurescript browser repl that runs code in the browser and a shell script that runs the various watchers I described before.

If I change any clojure file the browser refreshes automatically (and my tests run automatically).

If I change any clojurescript file it gets rebuilt automatically and the js file is reloaded in the browser (just the js, not a full page refresh)

If I change any sass file, it gets rebuild and the css in the browser refreshes (just the css)

If I change any html template then, depending on the template, either the page is refreshed or my clojurescript is rebuilt and the js refreshed.

So all those things are possible (I saw a cool post the other day of some ring middleware to handle using clojurescript inside tags transparently).

The non-clojure stuff is handled completely outside of the clojure ecosystem, I was using LiveReload and Guard when doing python dev to get that partial refresh on file save functionality and it was pretty simple to hook clojure into that same workflow.

I will say that if you are doing a lot of compile time template processing in your clojurescript like I am (using Kioo/Om/React.js) then the compile time for the clojurescript can be a little long, but since I have a browser REPL I do my experimental stuff in there instead of hitting that recompile cycle frequently so it's only a minor imperfection in practice.

So I definitely don't worry about building at all, and I don't even have to refresh my browser thanks to LiveReload - I just have to hit save in my editor.

There unfortunately aren't a lot of tutorials for setting this kind of thing up. I've got a start on writing up my setup and will put the project skeleton on github soon-ish ... I have this damn real work that keeps getting in the way.

Re: Why I'm Productive in Clojure

#98
post #88

Earlier quoted context omitted.

I personally find that to be a horrible experience. Nothing worse than having to install a bunch of tools that you'll never use again, to compile someone else's project. For example, if you use CMake, tough, project A uses autotools. You use bjam? Project B uses QtCreator/QMake. You use Waf? Project C uses SCons. No thanks, just give me a standard build tool like leiningen and be done with it. (Ok, so its not "usuall…

You're confusing the end user experience from the developer experience.

I don't understand how.

If I'm a developer, I've got the problem I mentioned. If I'm a user, I only have the problem if I build from source.

Either way, with a standardised build tool like leiningen, I don't have the problem because, as a developer, I only need leiningen. As a user building from source, I only need leiningen. Both use cases are much simpler.

However, having said that, I was only referring to the developer experience in my comment. I'm not really too sure what you read it as, but like I say above, I don't think it really matters: its a problem either way and both go away with a standard build tool.

Re: Why I'm Productive in Clojure

#99

Earlier quoted context omitted.

I'd like to know if it's done differently in other languages. In my view, methods are curried function over self with a '.' syntactic shortcut.

Lua does not do the currying bit, but it does a lot less OOP and a lot more "dictionaries with stuff that can do something like prototype OOP if you squint hard enough". Java and whatnot just don't let you really use methods as first class citizens, so it doesn't matter.

IIRC under the hood Java will 'evaluate' the methods body as a sophisticated function with 'this' in its environment.
Post reply on HN