This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aws (3)
- # beginners (186)
- # boot (25)
- # cider (2)
- # cljsrn (57)
- # clojure (161)
- # clojure-boston (1)
- # clojure-dusseldorf (11)
- # clojure-italy (5)
- # clojure-russia (20)
- # clojure-serbia (1)
- # clojure-spec (10)
- # clojure-uk (16)
- # clojurescript (207)
- # community-development (86)
- # core-async (2)
- # cursive (40)
- # datascript (1)
- # datomic (2)
- # editors (5)
- # emacs (8)
- # funcool (1)
- # gsoc (2)
- # hoplon (2)
- # jobs (5)
- # leiningen (3)
- # liberator (18)
- # luminus (18)
- # off-topic (106)
- # om (2)
- # onyx (5)
- # pedestal (7)
- # powderkeg (7)
- # re-frame (7)
- # remote-jobs (1)
- # ring-swagger (4)
- # rum (5)
- # slack-help (1)
- # untangled (11)
- # yada (48)
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
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?"
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 (http://dataintensive.net/)
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 :-)
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
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.
it is different in the way it communicates intent to me the developer when I’m using the function
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
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
::not-a-map now I have to dispatch on 3 things.
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
since beyond your option types, the presence of null's can still haunt you?
(try (cond (left option (do thing ... (right option (do thing ... (catch exception
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.
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.
I know, but it allows us to write our libraries and communicate intent clearly to users
> 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
In a sense though, I'm not joking...when you have predicates, you literally have the power of the language.
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
What's the best test framework to use with spec? clojure.test? Or some 3rd party test lib?
The official doc looks pretty good: https://clojure.org/guides/spec#_testing 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.
do you still get the same ads? or ads for thevthing you googled yesterday or three weeks ago?
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.
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.
interesting. could mean the web is changing, insofar as the goog is driven by link.
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.
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 🙂 )
there’s quite a bit more guessing about what google thinks you really wanted without that setting.
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.)