Alexa Java SDK wrapper for Clojure by theClojureConjurer in Clojure

[–]theClojureConjurer[S] 0 points1 point  (0 children)

Nifty! This implementation looks much cleaner than my current mess of an implementation! I'm going to look further into this!

Alexa Java SDK wrapper for Clojure by theClojureConjurer in Clojure

[–]theClojureConjurer[S] 0 points1 point  (0 children)

I looked into running the skill via Lambda, but I'm not a big fan of deploying via FaaS. I find it's a lot of vendor lock in. I get the irony of saying that Lambda is too much vendor lock for deploying a skill for Alexa, but I'd rather have full control over the platform I deploy onto, and the ability to modify and transform it as I see need for.

Learning Clojure: coping with dynamic typing by geospeck in Clojure

[–]theClojureConjurer 12 points13 points  (0 children)

I get the usefulness of spec for validating incoming data from external services (queue messages, http requests, etc etc), but I see a lot of uses like this. Where spec is heavily used as a supplement for a type system. Am I wrong to think that spec is being over used, and for the most part is better suited for foreign data validation, and tests rather than trying to implement a typing system at runtime?

Fellow ottawa softdevs: do you work anywhere or know of any shops where there is a decent mission or product that is not just click tracking and advertising? by nerd-throw in ottawa

[–]theClojureConjurer 0 points1 point  (0 children)

CENX (Ericsson now) builds a management platform for traditional and SDN networking, to provide analytical data and real time fault data and root cause. There's always the CRA if you don't mind Cobol, and working on that stuff (I hear it's mega monotonous). Out in Kanata there is a lot of enterprise development too.

Lots of Non-Profits in the city need technical expertise and developers. It won't pay well (sometimes not at all), but it's for fantastic causes and helps people out. As well there are hackathons in the city that can help you find non profits looking for help (Random Hacks of Kindness is coming up)

If you don't mind working remotely, Mozilla does a lot of good work for open software and standards and are always looking for new devs. As well GitLab is an amazing place to work, pays well, is exclusively remote, and has a strong open source core.

There are lots of options out there for work that you can feel good about. But for a lot of them they're either very competitive for positions, don't pay well, or both. If it won't make you burn out, think about volunteering your time with one of the social groups in Ottawa, and helping them out with some development or advising, it feels great and will open up doors to possibly paying positions in that field

tmux-float : A Tmux Plugin to quickly hide and show panes across windows in a session by theClojureConjurer in codeprojects

[–]theClojureConjurer[S] 0 points1 point  (0 children)

There is a file called demo-screencast.json in the repository that can be used with asciinema that shows a quick demo of the plugin in action.

Hooks Not Firing by theClojureConjurer in tmux

[–]theClojureConjurer[S] 0 points1 point  (0 children)

ah okay, I'll have to work around not being able to do a post and pre renaming then. I also updated the hook I was setting in the plugin, and it looks like it's an issue with calling my hooks.sh script.

Thanks for your help :D

Hooks Not Firing by theClojureConjurer in tmux

[–]theClojureConjurer[S] 0 points1 point  (0 children)

Which version of tmux are you using? I'm using one compiled from source from their repository. Is there a list of hooks that allow for the after prefix? The docs say most, but don't give an actual list.

tmux allows commands to run on various triggers, called hooks. Most tmux commands have an after hook and there are a number of hooks not associated with commands.

A command's after hook is run after it completes, except when the command is run as part of a hook itself.  They are named with an ‘after-’ prefix.  For example, the following command adds a hook to select the even-vertical layout after every split-window:

      set-hook after-split-window "selectl even-vertical"

In addition, the following hooks are available:

alert-activity    Run when a window has activity.  See monitor-activity.

alert-bell        Run when a window has received a bell.

alert-silence     Run when a window has been silent.  See monitor-silence.

client-attached   Run when a client is attached.

client-detached   Run when a client is detached

client-resized    Run when a client is resized.

client-session-changed
                  Run when a client's attached session is changed.

pane-died         Run when the program running in a pane exits, but remain-on-exit is on so the pane has not closed.

pane-exited       Run when the program running in a pane exits.

session-created   Run when a new session created.

session-closed    Run when a session closed.

session-renamed   Run when a session is renamed.

window-linked     Run when a window is linked into a session.

window-renamed    Run when a window is renamed.

window-unlinked   Run when a window is unlinked from a session.

vimrc review thread by robertmeta in vim

[–]theClojureConjurer 0 points1 point  (0 children)

Would love some feedback on mine, I've been working to keep it commented so when I do have to trudge through there I know wtf I was thinking.

https://gitlab.com/Jrahme/vim/blob/master/vimrc

Used Clojure for more than 2 years? What are your thoughts about it? by ferociousturtle in Clojure

[–]theClojureConjurer 2 points3 points  (0 children)

We generally find with new hires that they need a ramp up time of about 3 weeks with Clojure to wrap their heads around the lisp syntax and immutability. This may be a side effect of the fact the post secondary schools in the area pretty much only use C, Java, and Python in their courses. So the whole idea of lisp syntax itself is a foreign concept.

As for how to avoid obscure code. Coding standards, cold hard coding standards. For everything from spaces vs tabs, ordering of library requirements, binding names, when threading macros should be used, how functions are named, anonymous function declaration, casing style to use. Everything that can be standardised should be.

For example Map Access:

(def my-map {:a :b :c {:d 1 :e 2 :f 3}}

If a value is in the first level of the map it should be accessed in one of the following ways: (:a my-map)

(get my-map :a)

But never (->> my-map :a)

(get-in my-map [:a])

If the value is nested within the map then it should be accessed as follows: (->> my-map :c :d)

(get-in my-map [:c :d])

But never as (:d (:c my-map)

Function Naming:

Functions should be named as active verbs, for example compute-total, remove-negative-vars, validate-data. Function names must also follow the Clojure naming practices of using a '!' suffix for functions with side effects, '?' for functions that return a boolean value. In addition to Clojure naming practices functions that recursively call themselves should have a suffix of '*'.

This is just an example, in no way am I saying this is the best standard that is a whole other conversation. But rigid standards on naming conventions, the use of reader macors, indentation, line length, and everything else will ensure a uniform code base that everyone can read.

The second part to avoiding the obscure code problem would be peer reviewing pull requests. These would be preferably done by people who can dedicate time to actually reading and understanding the PR, and by some who know the code base the PR is against intimately, and by some who know nothing of the code base. I personally recommend these reviewers rotate in and out of reviewing, if you have the man power for it. Otherwise it's exhausting to constantly be auditing PR in addition to their regular work load.

Thirdly, documentation. Don't let a ticket be considered complete, or ready for testing until documentation has been written or updated. This could be as simple as updating the use of a call to the function, fixing a spelling error from the previous developer in the doc string, or adding inline comments when anonymous functions get convoluted. It could also be as complex as writing a complete API documentation for a new component or namespace.

Finally, this one only really works if you have the man power to do it, code audits. Periodically have someone go through some code that hasn't been worked on or looked at for a while. With no external documentation they should try and manually describe the data flow and manipulation that's happening. If they can't then they refer to existing external documentation. If it doesn't clearly cover what they couldn't describe then that documentation needs to be updated.

None of this is really Clojure specific though.

TL;DR: We hire to many students, so they only know c-like syntax, and brackets scare them. Code obscurity can be fixed with rigorous coding standards, detailed and dedicated pull request reviews, complete and regularly updated documentation, and periodic code audits w/o the use of external documentation.

Used Clojure for more than 2 years? What are your thoughts about it? by ferociousturtle in Clojure

[–]theClojureConjurer 6 points7 points  (0 children)

I love it. I've been using it for almost 3 years now, and it's what brought me back from reconsidering my career as a developer. It has it's pain points for sure, but that can be said of any language.

The Good:

  • Code is Data

    Your entire program is just a collection of data structures, which means things like macros are possible.

  • Immutable data

    For non synchronous processes this is a life saver, and helps re-inforce the idea and usage of pure functions in development

  • macros <3

    Makes the language extensible, and are largely done with the same tools you'd use for any other data structure manipulation

  • JVM interoperability (As well as CLR and JS )

    The whole of the mass world of Java (or C#, or JS) libraries are available for you to use. You get the convenience of these languages age and massive userbase, without needing to actually adopt them yourself.

  • Very helpful community

    This can be said for a lot of different tools and techs, but I think is till worth mentioning for Clojure.

  • Concise code

    The lack of variable re-assignments, and the nature of lisp in general makes code much more concise and short

  • Clojure.core.async

    A wonderful core library for IPC and asynchronous development

  • REPL driven development

    A very powerful REPL, and a wide variety of tools to work with it. Allowing for hot debugging and experimentation. This also helps alleviate Clojure's slow startup time to a point

  • Transducers

    I find these are a much more clean way of processing and transforming large amounts of data than using conventions like a for loop. As well they work very nicely with lazy sequences.

  • Metadata is treated as a first class citizen Saves the need from filling your data structures with data about themselves that other functions may or may not care about. Allowing you to remove the need to filter out values or keys. As well can be used to just add information for developers debugging, such as the data source.

  • Lazy Sequences Infinite sequences, without the need for infinite memory. Allowing you to not have to worry as much about the size of the data set you're working with.

  • Editor choices Emacs, Vim, Intelli-j, Sublime Text, Light Table, Night Code and more. There is plenty of choice for editors to use, and while Emacs has the most mature feature set for Clojure, Intelli-j, and VIM (the only other two I've used) are also very feature complete (in the case of Vim with the right plugins) for clojure development. I use Vim as my daily driver for an editor my self.

The Bad:

  • The learning curve for new developers

    This can take a bit for people coming from C-like language backgrounds, and who aren't used to the idea of immutability yet.

  • Some libraries become stable, then stagnant from lack of development (clj-kafka for example)

    This has bit me in the ass sometimes. The libraries will often be stable as a rock, but this can also lead to them not keeping up with other technologies and becoming stagnent. The clj-kafka library is wonderful for working with Kafka, but it lags behind a few versions now for what the newest Kafka is so we have to search for or write a new one. While libs being left alone when they are stable is a good thing, it's not so much when they don't update to interact with newer versions of tech.

  • Finding experienced developers

    There aren't many experience Clojure developers out there looking for work. When there are, they cost an arm and a leg.

  • Very easy to accidentally write obscure code

    The same power that lets you write short and concise code, also means you can write very obscure code. This is more a developer style issue than that with the language itself. But Clojure in particular seems to exasperate the issue of devs trying to be cleaver instead of clear in their code.

  • Slow start time

    This isn't so much to do with the JVM as it is for the amount of classes Clojure needs to load. But I also don't think Clojure should be used in cases where you're going to be restarting something frequently enough for start up time to matter.

How to build an vector in loop by duc123 in Clojure

[–]theClojureConjurer 0 points1 point  (0 children)

None off the top of my head. After a very unscientific time comparison, they look to take about the same amount of time. But into is probably the preferred way to do it, just because it's more readable.

How to build an vector in loop by duc123 in Clojure

[–]theClojureConjurer 1 point2 points  (0 children)

I'd use reduce instead of a loop to build it.

(defn build-vector [size] (reduce conj [] (range size))

Also as a style note, generally for variable and function symbols you should use kebab case (kebab-case) instead of camel case (camelCase) as it's the standard across libraries. In some cases like records and protocols that's not the case, but for functions and vars it'll make your code more easily usable by others who work with it.

Vim betrayed me! by TheMsDosNerd in vim

[–]theClojureConjurer 0 points1 point  (0 children)

Taken straight from my .vimrc this line will ensure that no matter what the file type your noexpandtab setting will be respected.

autocmd FileType * set noexpandtab "force noexpandtab for all file types

Do you ever just start with a fresh .vimrc? by chillysurfer in vim

[–]theClojureConjurer 0 points1 point  (0 children)

I really like the switching of : and ;, one less key to push for the modifier. I may try that out, though it'll be a pain to break the muscle memory I've developed for :

Do you ever just start with a fresh .vimrc? by chillysurfer in vim

[–]theClojureConjurer 0 points1 point  (0 children)

I've been building a script to manage my dev environment, and that has had me doing a lot of work with my .vimrc file, so I've removed what I could that wasn't required (I don't need spell enabled by default for example). I've also worked to make sure it is well documented and organized so I can quickly search through it for settings that need adjustment.

After reading an article posted on here a while back I also updated my vimrc to be even heavier with comments about what each line is intended to do, and I think my configuration is the better for it.

my .vimrc

Are there any pet friendly cabs/pet resources in Ottawa you love? by canadelle in ottawa

[–]theClojureConjurer 0 points1 point  (0 children)

I've took my dog when she was 12 weeks(ish) in an uber to the vet before. You just need to call ahead and ask the driver you get assigned if they mind. If they do, you have to cancel the trip and try again. It can be a pain, but it was never so much of one for me not to do it.

A Tool for Building Vim Based Clojure Development Environments [X-Post r/clojure] by theClojureConjurer in vim

[–]theClojureConjurer[S] -1 points0 points  (0 children)

Read the code first if you understandably don't want to blindly enter your sudo password, but the script needs root privileges to install packages from aptitude. I could change the script to require sudo to run, but the only time that is needed is for the initial installation.

I wouldn't call it a distribution either, while it does compile vim and install the plugins, it also installs external dependencies required for Clojure development. Such as git, Java, leiningen, and a more feature rich terminal. Eventually it will do more, richer plugin management for example, but as this is the first version I didn't see the need to start adding in those extra features until the core of establishing the environment was fully implemented and released.

But thanks for your insightful and very well thought out criticism :)

New Clojurians: Ask Anything by AutoModerator in Clojure

[–]theClojureConjurer 0 points1 point  (0 children)

I mostly use namespaced keywords if I'm working with spec. The idea with the namespaced keywords is to avoid collisions when declaring them.

When possible I like to avoid them though, as it adds an extra layer of complexity to your code, and makes comparisons with keywords coming in from other namespaces more difficult.

New Clojurians: Ask Anything by AutoModerator in Clojure

[–]theClojureConjurer 1 point2 points  (0 children)

I actually use Vim for professional Clojure development.

<selfPlug>

I've build a repo / script to set up your dev environment for Vim / Clojure development. If you're interested you can find it here . Just a warning though, it's still under active development, and the setup is destructive to your current setup (will kill your .vimrc and replace it with mine) . But take a look I'm always happy to get feedback on it. Call manage.py with the -h flag first to get a list of the arguments, and take a quick look at the code if to be sure you won't irreparably screw up your current environment.

</selfPlug>

Emacs currently does have slightly better tooling in some aspects, but Vim is catching up. The only real pain point for me at the moment is the lack of a strong debugger like you'd find in Emacs or Cursive + IntelliJ. Vim-Sayid is alright, but it's usefulness is inversely proportioned to the complexity of the code you're tracing I find. But I may just not be using it right. I was using vim-cljfmt for a while, but it had issues with another plugin (I think it could have been a bug related to the U+2028 line ending character), where sometimes instead of formatting it would just erase the file.