Fork me on GitHub
#clojure-uk
<
2021-04-30
>
dharrigan04:04:11

Good Morning!

Aron04:04:18

Morning 🙂

dharrigan05:04:45

I'm curious, what are you using (if at all) for rendering the frontend with Clojurescript, i.e., component library?

Aron05:04:52

helix at the moment

harryvederci05:04:53

I’m experimenting with https://htmx.org/ for my side project, for some oldschool-but-newschool server side html work. Pretty happy with it so far, but it’s not a complex application that I’m using it for.

Aron05:04:00

but I am really disillusioned with react, at this point with cljs I think one doesn't need react although it depends what is the goal of the thing that we are building, personally I am not a fan of using something because it's popular (so other people can be hired and start working next day, which is the only reason anyone cares about popularity)

dharrigan05:04:31

thank you both, reading. I've never really been a frontend dev, although I have done an experiment using vuejs + bootstrap-vue. So, whilst I'm playing with Clojurescript atm, I'm just a bit unsure/lost as how to make the frontend pretty.

Aron05:04:30

the real difference between front/backend development is not just in the tools though

harryvederci05:04:41

For styling, I’d say just use https://getbootstrap.com/ if you’re unsure. Easy to drown in all the options otherwise. If it’s more of a learning experience, you can use no styling tools whatsoever, of course.

Aron05:04:09

yeah, I still think those are the very very very easy problems

Aron05:04:53

what styling. I mean, it's hard to make a good CSS system that doesn't end up making your life difficult, but not harder than writing any good software system

seancorfield05:04:41

I was a bit surprised that our frontend team don’t use a CSS library/framework — but then we have a full-time UI/UX person who has created our “house style” from scratch…

Aron05:04:52

yeah, that works best

seancorfield05:04:26

(they’re a big fan of Adobe XD and apparently now they can design “components” and export them to all sorts of media, of which CSS is just one flavor)

Aron05:04:44

1. BE devs have their environment fully in control, usually a single system FE devs need to consider people using multiple different devices, different OS, different screensize, different capabilities (e.g. touch or not) 2. BE devs have control when they change the runtime, FE do not, we use what the client use 3. BE devs have sync db connection, you write save-to-db and next line you know your data is saved (or something went wrong), FE devs have localStorage which is a bad k/v database, or you need to include something heavy like datascript to have database that's moderately useful 4. However, another really big issue is due to the nature of the problem BE devs write software whose output will be consumed by other software, you can do linear state transitions and everything will be fine most of the time. That never works for FE For frontend, all the state that is represented must be thought as "shared" even if they are not actually related in any other way, because to be able to construct a proper FE experience, you often need to implement effects that affect the whole visual experience. Linear state transitions are not good enough anymore.

seancorfield05:04:45

It’s all wizardry to me…

Aron05:04:06

these are the difficult problems imho in FE

seancorfield05:04:48

Oh yeah, the FE stuff is off-the-charts hard. I don’t know how they get anything done. The daily standup is always a revelation when the FE folks talk about what they’ve been blocked by…

dharrigan05:04:05

a bit of clarification on my side. It's not so much the styling, it's the ability to do things, i.e., to "react" (pun not intended), to things. i.e., pull down data from the server, render it in a table, make each row clickable, fire an event. Add a button to a row, make that do something as well, show a dialog box, let the user click on it, handle the yes/no response...and then, yes, make it look pretty.

dharrigan05:04:21

I echo @seancorfield's feelings here. FE just feels so hard 🙂

Aron05:04:55

well, I think I have learned it so that I can reliably implement things, but without clojure and without lots of clojure talks I would've never been able

Aron05:04:04

required me to switch mentality several times

dharrigan05:04:14

I like the warm bosom of backend dev, it's just data flowing in and out, with transformations 🙂

seancorfield05:04:37

Today, I updated our “deploy to production” console (which is built into our overall staging system admin app) and I wanted to display the versions of JARs on staging vs production — and that requires calls out to staging and production so I decided to display the page and then use JS calls back to the server to initiate those and populate the table. Writing the BE code to go fetch the versions took me maybe fifteen minutes. Writing the FE code to do the async calls and update the page in the browser… took me f’ing hours! I hate JS.

👍 8
Aron05:04:03

shouldn't take that long

seancorfield05:04:14

Almost anything I do with JS takes me hours.

Aron05:04:15

i mean, if it's the same work

Aron05:04:28

yeah, it's a lot about practice and dev environment

Gulli05:04:36

I tend to look at myself as both, but it usually ends up like this.

💯 4
😆 4
Aron05:04:44

also about integration testing, I don't agree with dnolen that automated tests are not useful, I refactored a big chunk of FE last week, at the end I ran the tests, caught all the remaining issues and I was able to not waste time with manually clicking around. Testing FE takes way too long, people just ive up 😞

Aron05:04:02

but these tests start with loading the page, clicking on elements, typing realistic values, reading the DOM, checking sizes of DOM elements... it's not just an 'assert'

Aron05:04:03

😄

Aron05:04:20

i know most tests aren't just asserts, but our python tests are almost all just that

Aron05:04:37

btw, the 4th issue, and I can't let it go if went this far, I think ultimately leads to the conclusion that encapsulation on the frontend is a much worse idea than anywhere else

Aron05:04:21

I got my final proof for this when I read this github issue:https://github.com/facebook/react/issues/11527#issuecomment-360199710

Aron05:04:02

> I want to highlight that in typical React apps that rely on `setState()` this is the single most common kind of React-specific refactoring that you would do on a daily basis.

seancorfield05:04:20

Our FE team are big on automated testing. And every new feature and every bug fix they do gets tests.

Aron05:04:21

Imagine being told that most of your job is to rewire what you did yesterday?

seancorfield06:04:22

We’ve had automated BE tests for a decade and we keep adding to that suite but we’ve only recently had completely automated deploys from our CI system (I’ve tweeted a couple of times about my battles with BitBucket Pipelines lately). I’ve also been working on simplifying and streamlining our build/deploy pipeline to the point where a deploy of most of our apps — 14 of them — is completely automatic to staging, based on CI builds passing, and then just “select & click” in the admin console to get them to production (which our product manager / QA folks can do whenever they want — including running SQL migrations).

Gulli06:04:45

Automated tests are awesome. They have helped our team multiple times spot side unintended side-effects of new features

seancorfield06:04:17

Automated deploys of all the shell scripts etc that support processes on staging/production is a little less automated — because we don’t have any real automated tests around the shell script stuff — but even there it’s a single command from anyone’s dev setup to get the appropriate scripts on staging and then a single (manual) command run on staging to get that same bundle out to all the production servers if it “passes QA” on staging. So I think that’s my next target for Pipelines 🙂

seancorfield06:04:40

And then, finally, there’s the two legacy CFML apps (yes, really), and those are also now down to a local command to package them and push to staging, followed by a few scripts to deploy them and restart the CFML engines. And a single command to push them to production, followed by a similar manual script step on production. Def. better than it was even a month ago. Of course we are actively rewriting those CFML apps to Clojure (and have been for years — it’s a lot of work) so that we can get to the same, fully-automated test & deploy CI process for those too.

Aron06:04:50

I didn't intend to say dnolen is against all automated tests, just in context of FE testing the other day he told me this https://clojurians.slack.com/archives/C03S1L9DN/p1618931137246900

seancorfield06:04:03

To be fair, he’s advocating a separation that makes FE testing viable/easy — just not testing the UI portion.

Aron06:04:07

Seemed to me that what he described as an ideal situation is specific to his needs, not a generally applicable approach

Aron06:04:52

and there are details that I bet would be causing trouble, like, if as he said all components are in js, that is basically saying almost all the important stuff is not in cljs

Aron06:04:12

-> behavior of generalized components

Aron06:04:05

so what I suspect is happening is that they avoid all the issues from putting behavior in the js components, but that's not really something anyone or any company can do

seancorfield06:04:07

I can’t comment on the cljs issue since our FE is pure JS — React.js, Immutable.js, Redux, etc — but I know the FE team has worked hard to be able to automate testing of all the components, independent of the actual UI.

Aron06:04:23

they must have great stories 😄

Aron06:04:29

pun not intended

seancorfield06:04:38

Oh yeah, seriously great stories. I’m in awe of them.

djm06:04:03

On the topic of testing front end stuff, Cypress is pretty amazing

seancorfield06:04:26

I’d never heard of Cypress until the recent “State of ColdFusion” survey (like our State of Clojure survey) and it was a popular write-in answer to “What testing frameworks do you use?”

djm06:04:47

Having suffered the pain of Selenium in the past, I was blown away by how good it is

Aron06:04:26

cypress is great

Aron06:04:01

I am using puppeteer right now though, I think when* I tried Cypress had some dev env issues

Aron06:04:24

on a different note, what do you think about my conviction that we (as in software people :D), should be actively producing many many more browsers for the internet?

seancorfield06:04:36

What do you mean by “browser” in that?

seancorfield06:04:42

Do you mean more programs like Edge, Chrome, Firefox, etc?

Aron06:04:28

yes and no

Aron06:04:50

Yes, as in, yes today all browsers are like that, no as in that's why we need more, that we need diversity.

Aron06:04:19

Essentially, if you reverse the situation, what this would mean not for the users of the browsers but the makers of the interfaces that we (FE devs) would not have to repeatedly write the same code. I imagine this whole thing along the lines of what Bret Victor talks about in his talks. E.g. when he mocks APIs, if you have seen it.

seancorfield06:04:25

How would “more browsers” not mean “more pain for FE devs”?

Aron06:04:40

🙂

Aron07:04:17

Let me ask a different question first: why would anyone use more than one browser?

Ben Hammond07:04:06

I use Firefox for online banking and nothing else I use Vivaldi for everyday browsing I use Chrome when I want things to just work and I don't mind being extra spied on to pay for it

Ben Hammond07:04:31

vivaldi I block 3rd party cookies chrome I dont

Jordan Robinson08:04:26

I use firefox for most things but I have to use chrome/ium for google meet and other assorted things

Jordan Robinson08:04:41

it does feel like google have a habit of breaking things in firefox and not really being arsed about it

Ben Hammond08:04:28

they see it as driving engagement, no doubt

👍 4
Aron09:04:24

And in general?

seancorfield07:04:59

I only use Microsoft Edge — on macOS, Windows, and Linux.

djm07:04:59

I use Firefox and w3m

seancorfield07:04:06

OMG! :rolling_on_the_floor_laughing:

danm07:04:28

I switched (back, after 6-7 years or so) to Firefox about 6-8 months ago, because there was a bug in some Chrome helper on macOS that kept maxing my CPU that eventually annoyed me enough to lose the benefit of multiple logged in profiles. Firefox containers does that anyway, more or less

danm07:04:28

And the profile stuff was always more of a pain on Windows, whereas FF containers works the same in both (and Linux)

Aron07:04:08

I think you misunderstood my question 🙂

Aron07:04:58

I meant it generally, not specifically. Why would anyone in general use more than one browser, not why would specifically use more than one browser from the existing ones.

Aron07:04:09

Second question has good answers, I use more browsers because I need to test what I do with them 🙂 Or because they have different 3rd providers baked in, e.g. difference between Edge, Chrome, Brave is just that.

Aron07:04:33

It's otherwise literally the same 'browser' experience.

Aron07:04:59

Think of it like this, how many other kind of browsers do we use, next to the web browser?

djm08:04:49

I'm thinking of buying a microphone. Does anyone have an recommendations?

Jordan Robinson08:04:13

I use a tonor tc30 which I picked up for cheap on amazon, it works flawlessly on linux if you care about that

djm08:04:58

A cow-orker has a different (slightly more expensive) Tonor mic, and said the sound quality is quite poor (and it has bad reviews on amazon).

Jordan Robinson08:04:39

hmm, this one seems pretty good for sound quality, but I must admit I mainly only wanted a step up from the one built into my webcam

Jordan Robinson08:04:48

I'm not really recording podcasts or anything

djm08:04:40

Based on the negative amazon reviews for the tc30, I'm getting the impression that the sound quality is fairly good, but that it picks up a lot of background noise

Jordan Robinson08:04:45

when I tested it out and first got it it seemed like a big upgrade from the built in one in the webcam, but your milage may vary, it is on the cheaper end of the scale

👍 4
alexlynham08:04:15

what is the mic for?

alexlynham08:04:30

i use a clip-on lavalier mic and it's the business

djm08:04:05

@U79NZHC6A work meetings

dharrigan08:04:31

I use a Blue Yeti Pro

dharrigan08:04:41

works wonderfully well 🙂

Aron08:04:28

Depends what you want to use it for and what environment. E.g. for recording or meetings or streaming or anything else.

djm08:04:52

I have considered a Blue Yeti, but it's a little more than I'd like to spend

Aron08:04:00

All mics work best if you can talk right into them, the farther they are the more problems you will have.

Aron08:04:41

I also got a cheap knockoff usb mic (won't share the name because I just checked and seems like they are shipping bad units now, there are many more bad reviews than when I bought it...)

Aron08:04:19

If you can isolate the stand from vibrations and move the mic close to your mouth, you can easily set up almost any quality microphone to have exceptional quality.

dharrigan08:04:35

imho, if it's only a little more....why not get it? It's something that I've used quite a lot whilst working from home. The quality is outstanding, and I always have the view it's better to spend money on good quality stuff, then buy cheap stuff repeatingly.

Aron08:04:43

Depends on hardware, but it was long time ago when we needed dedicated sound boards

Aron08:04:22

yeti is at least 3 times the cost of what I have.

djm08:04:57

https://www.amazon.co.uk/dp/B08VGMGXKQ seems to mostly have good reviews, or for a little more https://www.amazon.co.uk/dp/B08L91T9QV may be better, but I'm not sure I want a boom arm

dharrigan08:04:32

Be careful of those boom arms that have springs

djm08:04:33

I don't particularly trust reviews on amazon, but the first of those was recommended somewhere that's probably more reliable

dharrigan08:04:41

They can cause quite a bit of background vibration

djm09:04:47

Yeah, a nice idea in theory, but seems like it'd be more trouble than it's worth

Aron09:04:52

i don't trust the review that is positive, but i do trust negative reviews with photographs that sound human

Aron09:04:50

a good support might cost more in time and efforts than the mic

djm09:04:24

Looks interesting

alexlynham09:04:59

a decent clip on lav mic is a tenner

alexlynham09:04:17

if you can be bothered to clip it to your collar before a meeting

djm09:04:03

The ÂŁ10 ones on amazon don't seem too good from the reviews, as best as I can weed out user error, bad luck, etc

alexlynham09:04:44

i have a ten quid lav mic and it's brilliant, there's almost nothing that can go wrong as they're v simple devices

djm09:04:43

That's what I'd have expected (nothing to go wrong)

alexlynham09:04:03

i use it for calls, as a field recorder, i've used it with my mobile while out cycling & once a week i do a virtual ride with mates where i clip it to the handlebars - it can handle the fan + bike on the trainer with the wind puff, so

alexlynham09:04:26

as far as cheap solutions go 🤷

djm09:04:54

9% 1* reviews. Although I suspect a lot of those are related to usb-c + smartphones

alexlynham09:04:51

oh yeah obviously i connect it to a macbook with the standard TRS jack. TRRS/ TRRS -> USB-C is always a strong case of YMMV 'cos there's not really standards

alexlynham09:04:50

looking at one star reviews it's people having issues with TRRS vs TRS

danm13:05:40

I use headphones with a mic on. By far and away the biggest issue workmates had before that was their own voice feeding back to them from my speakers through the mic, and even relatively good mic still did that. The headphone one being nice and close to my mouth meant I could have the pickup level quite low too. And of course it was directional, but I imagine the standalone more expensive ones were too

djm13:05:53

@U6SUWNB9N I currently have a work provided headset, but I'll have to give that back when I leave. Plus swapping from nice headphones to the headset for meetings is suboptimal. So the plan is (separate) mic + headphones

danm13:05:58

Oh I just got headphones good enough to use the rest of the time for music 😉

danm13:05:14

https://www.amazon.co.uk/SteelSeries-Arctis-All-platform-compatibility-Detachable/dp/B07PS3Y5BY is what I got my last place to get for me as a 'video call headset', because anything without pretty hefty ear cans that prevent any part of the headphone from pressing on my ears at all ends up hurting in any meeting longer than ~10 minutes

danm13:05:31

I seemingly have very sensitive ears

danm13:05:25

They now seem to do a variant without the mute for cheaper, and a wireless one for more

danm13:05:45

But wireless became more important for me once we had Matt. Less for him to grab, and if he is elsewhere and yells I don't need to remember to take the headphones off before going to get him, which was a problem several times, hence I bought the Steelseries headset

djm13:05:09

I have.. too many pairs of headphones

danm13:05:02

I've just got a set of bone-conduction bluetooth ones, but they're for when I'm out and about more than anything else

djm14:05:23

How are the bone conductor ones?

danm14:05:05

I really like ‘em. A bit buzzy (on my head, not sound wise) at high volumes, but I absolutely don’t need them that loud. And they don’t sit in my ears (which also make ‘em hurt)

Aron16:05:08

https://www.amazon.co.uk/Status-Audio-Closed-Monitor-Headphones/dp/B01BDX1IVW https://www.amazon.co.uk/Philips-SHP9500-00-Headphone/dp/B00ENMK1DW/ https://www.amazon.co.uk/gp/product/B083T4XJDY the first two, I think I will buy more as time passes as both are exceptional for the price the last one definitely not 🙂 have a bunch of others too that i don't or can't use now because they are broken 😞 although the important parts sound wise are good, many new headphones are built in such a way that if they break, it requires extreme effort to fix them, often better to just replace most of it

folcon13:04:47

@dharrigan: re-frame for me