HN user

itsmonktastic

14 karma

http://twitter.com/itsmonktastic

[ my public key: https://keybase.io/trmonks; my proof: https://keybase.io/trmonks/sigs/Sr89KE0_-5o51zljmGiX9tJFCghocjA4s_Gv16Lzit0 ]

Posts0
Comments10
View on HN
No posts found.

I don't think people have a great consensus on what "TDD" really means, so there's a lot of "Do you do TDD? You should do TDD!", people taking mixed approaches that they sort of make up or copy from a quick blog post, then deciding that TDD sucks or rules.

For example, this article seems to think TDD is mostly about unit tests (and I've definitely seen the same opinion elsewhere). But somewhere else, specifically GOOS[0], the TDD cycle always starts with an end to end test, with an inner unit test/development cycle to get the test passing. I think this is really important, because if you don't have end to end tests, it's a lot harder to refactor your code in significant ways, and can leave you with extra work maintaining all of your unit tests.

Another thing is "fast tests" as resulting in "a dense jungle" of objects. At least in GOOS, the assertion is that a larger network of small objects is better than a smaller network of large objects. I'm not going to argue the benefits of one way or another, but what I mean to point out is that (at least some) people use TDD because they think it will help them write a more maintainable code base, and aren't just writing code to make their tests fast for the sake of fast tests.

[0]http://www.growing-object-oriented-software.com/

Go 1.2 13 years ago

With a better type system, taking ides from Haskell (ADT, generics done well, ability to implement interfaces for a type outside of its package etc) Go could be the perfect "dirty Haskell" for me

I wonder if you might like OCaml (which is my sort of "less strict haskell"). There's also rust of course, but that's explicitly not for production use.

Sorry for the poor choice of word on my part, I admit I was using "disingenuous" incorrectly there. I just thought the description of sublime/emacs/vim having "great" support for TypeScript might give someone the impression that something beyond syntax highlighting was supported.

I don't doubt that it's more work to support more than syntax highlighting, but that doesn't change the fact that the support in those editors is sub-par when compared with lots of other languages. For example I can install SublimeLinter and have basic error reporting for python code, or SublimeJEDI and have code completion and go to definition.

This seems a little disingenuous. I bet Intellij already has great support, but the top link you give there for Sublime Text, emacs and vim doesn't really give anywhere near the level of support you get in Visual Studio. Literally just syntax highlighting! In Visual Studio you get at least error highlighting/completions/code generation/navigation/refactoring.

There are definitely attempts to bring the language service to other editors but when I tried them last (just before the 0.9 release) they seemed either featureless or very slow. If someone can recommend one for sublime/emacs/vim that they actually use I'd be very appreciative!

EDIT: related thing that annoyed me: the language service is part of the TypeScript repo but as far as I can see from there is no official documentation on how to go about leveraging it for other editors! I admit I can kind of understand this until the language is less of a moving target. The best way to get started for now seems to be looking at third party efforts like https://github.com/clausreinke/typescript-tools.

Thanks for posting this. I found something similar but on first blush didn't think it was quite right as I was mistakenly thinking that you could only do this for TChans with the same type. Looks like it might be just what I'm after! When I think about it, STM seems like it makes sense here, since you probably want the ability to cancel/rollback the blocking gets that didn't return.

EDIT: Actually, this isn't right. The example linked does "if get from channel 1 fails, get from channel 2". I'm looking for "select" on multiple channels, where the result is based on the first channel to return.

EDIT again: Apparently I can't read, and this does achieve what I'm looking for, I just have no basic experience with STM. Awesome, will try this later!

Nice. I still haven't given Go much time, but I really like this form, where you can switch on multiple blocking calls.

I've definitely wanted this in other languages where I'm using thread safe queues for communication, and had to do manual multiplexing into a new queue whenever I wanted to do a blocking get on multiple queues.

Does anyone know of a convenient way to do this when handling multiple instances of python's Queue or similar with Haskell's Chan?

Hi, author of the post here. I'll admit I kept the premise simple here in order to provide a more introduction on how to "roll your own" effects without too much overhead.

The sort of thing you've described seems to have been implemented pretty well as a zepto plugin: http://blog.kojo.com.au/flickable-zepto-plugin/ (in particular this demo: http://blog.kojo.com.au/demos/flickable/demo2.html ) which works wonderfully on my Galaxy Nexus, but I haven't had much of a chance to play with this yet!