Fork me on GitHub

laff or cry?


I feel that nil gets a bad rap due to OOP and unsafe languages. Null (or nil) really isn't a big deal when you can do (type nil) and when (foo nil) is way more common than (nil foo) or (.foo nil)


I get NPEs in Clojure, but most of the time I just look one level up on the exception and see "oh yeah, I get that value out of a hash map, I wonder if the value is actually there?"


And if your functions can be polymorphic on nil, NPEs really become a non-issue


but yet, somehow thats "the billion dollar mistake" and not something like mutable objects.


Yeah, the central problem at the root is 'null as unallocated / unassigned'. It's used as an intermediate state before 'real use', and then used also as a placeholder arbitrarily. Without mutability, nil can be used pragmatically. Clojure (and I'm guessing other lisps) are a pragmatic take on the use of nil.


I’m asking this to the clojure community because I feel belonged in clojurians and thus getting inputs from the community would align with my interests. Please try to reply via thereads so that we don’t end up spamming the channel. ------ Thinking about my career

This weekend I had a sudden urge to draft a plan outlining an approach towards my future career.
I'm in my late 20's and have been a full-stack developer for the most part. I have a masters in computer science. I would have gone on to do a PHD but did not realize my (apparent) affection for research until later.

Looking back, I've drifted through jobs that have not been fulfilling enough or complex enough. I spent my time writing SPA web apps (nodejs,ReactJS, good experience and learnings) or writing enterprise software in Java (meh)

Looking ahead, I want to take a more determined approach towards what I choose to work on.

The criteria I've decided on is : Technology that is mature and will be around for a long time with high probability, solves complex-interesting problems, which currently has and will have good jobs with good pay and a side effect of which will be a gain of transferrable skills.

An example project that meets the criteria : Kafka - Kafka is mature-ish, solves complex & interesting problems (distributed systems), open source (can immediately start working on it), has jobs, decent pay and has transferrable skills relating to Java, distributed systems and data systems.

My plan is to dig deep into the technology, understand the domain, start contributing to the codebase and take up a related job.


Any comments on the criteria  as well as suggestions for projects would be appreciated.

Please also comment on the approach as a whole and if there is a better way to go about it.


@U4WGD1SMC: I think it depends a lot on 'how scientific' you want your job to get. For instance, contributing to Kafka probably requires a solid understanding of distributed systems, which would probably require an investinment on your part studying them!


OTOH, there are tons of areas in IT where you can innovate without needing a specific scientific background.


For instance, I find that the whole React + GraphQL/Falcor/Om Next + Datomic stack offers a lot of architectural opportunities, and we've barely started to explore them.


However, I don't know how that translates into jobs, nor what will be the longlasting technologies that emerge from these approaches (React and Datomic are probably here to stay, but I don't know that they need contributions).


I strongly recommend the book by Martin Kleppmann for getting started in this domain: Designing Data Intensive Applications (


Wow, I could have written the first two paragraphs... Hence I can offer no advice, but I'm interested in the feedback you'll receive :-)


Deep Learning.


re nil & Option: I side towards having an Option or Either type. Mostly for readability reasons. I can discern intent much faster when there is an either or option type when reading through code or the docs of an API. I find it especially useful when dealing with things that will throw an exception (like some network call). I’ve gotten bitten by APIs that don’t communicate that I need to handle and error explicitly. The problem with having nil do that, is that nil is too pervasive and its meaning changes from function to function, making it harder to figure out how (and if) to handle errors when calling a function.


@roberto but that's really a side-effect of incorrect API/language design, imo. (get-customer-by-id nil) may throw a NPE, but you'd get a "cast error" if you did (get-customer-by-id "42") and the id was supposed to be an int


null errors are exactly the same as any other runtime type error, it's just people don't think about how they interact with their function


I may write (fn [a b] (+ a b)) and that would blow up on a string or a null


yes, I understand. But the issue is that when I am using a function, it might not communicate that to me in an effective way, and I might only find out about it when it blows up in prod.


But how is that different from any other type error?


it is different in the way it communicates intent to me the developer when I’m using the function


something that says: hey, these are the errors you need to handle when you use me


exceptions don’t quite cut it because they don’t compose


(option doesn't really compose either)


I beg to differ 🙂


more specifically Either for the cases I have in mind where I have used it heavily.


Right, but you still have to handle the possible outputs of Either, you're still dealing with two possible return values, just adding another layer of abstraction on it


yeah, which I prefer to nil because like I said: it is about communicating to the user how to work with the output


nil can mean too many things and I’ve been bitten by it too many times.


so communication by value instead of communication via docs?


because the docs might not even be there and get out of sync


but the code won’t lie, especially if using an IDE


but that's just adding a different name for the same thing. Look at JS's "undefined", great now I have to handle "== null or ==undefined". Let's say get returned ::not-found, or ::not-a-map now I have to dispatch on 3 things.


yeah, and I’m fine with that if the compiler forces me to do that


I don’t want to have to find out about it until things break in prod


And that doesn't compose, since now I can't simply do (-> (get mp :e) (get :a) (get :r))


well, wouldn't you need to then have

       (left option (do thing ...
       (right option (do thing ...
     (catch exception
since beyond your option types, the presence of null's can still haunt you?


sorry, if you use a good abstraction, you can compose


Can, but Clojure's functions trend towards using them smartly.


why would you add a try-catch there?


And that's the problem...I just don't get NPEs in production. Parse errors, data validation errors, etc, but never a NPE. I get them in development, but that's what unit/integration tests are for.


I get them in prod, especially ones that you can’t predict ahead of time when dealing with third party services


So in the end trying to remove NPEs is just a ton of bookeeping for something that's not a problem. I'd rather handle 10 NPEs than annotate every callsite with an Either/Option/etc.


I’ve been bitten by this working with third party services that were poorly documented and we only found out about the error cases in prod.


becaues an option or either type doesn't remove the presence of NRE's


but having an internal library that codified the possible errors and forced the users of the libs to always handle those helped a great deal


a static compiler aint gonna help you with 3rd party services being poorly documented.


If they can't write good docs, they aren't going to properly handle nils


I know, but it allows us to write our libraries and communicate intent clearly to users


or properly return errors. They'll just say "internal error".


> but having an internal library that codified the possible errors i'm not sure this is possible in the type systems of java or clojure


yeah, not possible in clojure, we did that in kotlin


@dpsutton anything can be done with spec 😛


yeah, spec doesn’t really solve the same issue for me


i'm waiting for that to be non alpha


In a sense though, I'm not joking...when you have predicates, you literally have the power of the language.


i find it much more complicated than an ML-like type system


I understand the potential but I find the UX a bit hairy right now


and I’m having a hard time using it properly


yeah, there's room for improvements, personally I'd like to see some "is-a" logic, and something like contravariance, but I'm sure that stuff will come with time


it also ends up being more verbose than just writing types


yeah, that would be great, I think it will only get better


What's the best test framework to use with spec? clojure.test? Or some 3rd party test lib?


Or is there a good doc out on how to integrate spec with a testing framework?


Or any example of a project that has "full test coverage," that also uses spec.


The official doc looks pretty good: But any other examples would be great. I'll ask this over in #clojure-spec too.


Anyone noticed google search results getting worse over the past year? Lately, when I modify my search query, I still get mostly the same results. Whereas before, slight modifications to the query could result in very different results, which was useful in some cases.


don't worry, they know what you need.


do you still get the same ads? or ads for thevthing you googled yesterday or three weeks ago?


i tried duckduckgo for a while but it just got annoying.


try creating a new gmail acct and searching from it. haven't tried myself cause i'm lazy. but it would be interesting to know.


thanks, i'll give it a try.


what i want is a search box that will randomly pick a search engine, disguise my identity, and let me slap "n" to try the next search engine. is that so much?


@mobileink hmm, duckduckgo seems to return similar search results... Maybe google search results are changing in general. The results just seem more programmer friendly than a while back. Search terms not necessarily related to programming seem to have a higher rate of returning programming related results. I figured it was just learning about me.


same goes for other topics I search regularly


interesting. could mean the web is changing, insofar as the goog is driven by link.


not sure i like that. simple_smile


Well, I was worried that I was creating a search bubble for myself - occluding potentially relevant results that I would have otherwise seen. Maybe the link space is changing though, like you say.


it's biological, really. always adapting.


i want a metasearch!


It's definitely an extension of the human cerebral cortex, of sorts


i was thinking more along the lines of populations in environments.


we're the population of organisms. the web is the env. we mutually adapt.


right. makes sense


Yeah, lots of cognitive ability is being replaced by the web. I'm convinced that 10 years ago, before ubiquitous GPS navigation, I had a very different cognitive grasp of my own location with respect to surrounding towns and nearby locations. Like actually looking at a map. Nowadays, not so much. Now I don't care about the zig-zag pattern it takes to get to some local store. If I do it enough times, it'll start to stick, but I never try to make it stick. Whereas years ago, everyone used to establish directions, either on paper or in their head, prior to leaving for a destination.


10 years ago, we were all much more like taxi cab drivers that understood their surroundings. Nowadays, we're all like kids that get chauffeured around by GPS taxi drivers. But we still do the driving (for now 🙂 )


haven't had a drivers license for 15 years. happiness.


Yeah, so you're already living it 🙂


@john are you using verbatim search?


that can make a big difference.


verbatim? like a quoted "search term"?


Tools -> All results -> Verbatim


there’s quite a bit more guessing about what google thinks you really wanted without that setting.


nice, I'll try that


Hi. How do you guys find a good interaction and visual designer? I am working on a startup and we are struggling to find a good, trustworthy designer. We want someone that will work with us through the entire app design process -- from a req's sheet to high-fidelity mocks. And someone who has done this before that understands you can't skip from ui flow diagrams to high-fidelity mocks. I really want to find someone that is able to work with us along every step of the app creation process. We have already started an engagement with one firm, but it is not going too well. The firm does not seem to have a good knowledge of the app design process, so we are probably going to end the engagement in a few days. Does anyone have any recommendations? (i.e. websites to look for designers on, a freelancer you know, etc.)