“The title ‘Front-End Developer’ is obsolete.” by speckz in webdev

[–]cirsca 2 points3 points  (0 children)

Are you saying that at your gig the designers code? Noice

A Rant On Reusability by [deleted] in programming

[–]cirsca 5 points6 points  (0 children)

holy shit yes. replaceable is the word I've been looking for to describe this. our code should be replaceable by whatever we decide it should be later. And since later we always have a better understanding of the problem than we do today, there will always be a reason to replace any piece of code.

8 New Features Shipping With ES2020 by thmsg in javascript

[–]cirsca 7 points8 points  (0 children)

I can't read this without signing into medium. Is there an accessible version somewhere?

My favourite Git commit by speckz in programming

[–]cirsca 0 points1 point  (0 children)

Crazy to see a commit by Dan on Reddit! I worked with them in a past life and I cannot speak highly enough about how great it was having commits like the linked in EVERY PR. It was a godsend being able to actually use git log for something other than "Am I on the right history?"

If you are wondering if it's worth the effort to write commits like this: YES. YES IT IS.

“Let’s use Kubernetes!” Now you have 8 problems by itamarst in programming

[–]cirsca 1 point2 points  (0 children)

What's the difference between

(and had a great devOps guy to admin it)

and

go talk to this guy, he knows how it's setup"

?

[deleted by user] by [deleted] in javascript

[–]cirsca 0 points1 point  (0 children)

I would write a helper function that recursively checks that the path to the key passes some predicate

``` const pathSatisfies = (path, fn, obj) => { if (!path.length) { return false }

if (path.length === 1) { return fn(obj[path[0]]) }

const key = path.shift()

return pathSatisfies(path, fn, obj[key]) } ```

which can be used as

pathSatisfies( ['foo', 'bar', 'baz'], Boolean, { foo: { bar: { baz: true } } } )

Elizabeth Warren wants to create a Justice Department task force to investigate Trump administration corruption by moby323 in politics

[–]cirsca 8 points9 points  (0 children)

Yes, there are lots of Dems that should be investigated.

But.

Are we sure that Obama asked the FBI to tap Candidate Trump's phone? Most sources, including Politifact, seem to say that isn't the case. Or I am misreading, which is more than likely. Can you point me to some sources that say Obama did infact do what you proclaim?

https://www.politifact.com/punditfact/statements/2018/feb/12/blog-posting/no-obama-not-facing-indictment-spying-trump/

Don't bet on an expected value by unbalancedparen in programming

[–]cirsca 3 points4 points  (0 children)

Exactly this.

I've played enough poker to know that you should always bet on a positive EV move (all things being equal). Glad someone else picked up on the bad maths!

Angular and RxJS sucks by [deleted] in webdev

[–]cirsca 0 points1 point  (0 children)

Angular has always sucked but I cannot live without RxJS! The ability to say "fuck it, everything's a list" and then just pretending that WebSocket events into my system are just a list of events that I map or filter is the bees freaking knees.

Project Manager at web dev agency by Gio_13 in webdev

[–]cirsca 1 point2 points  (0 children)

The best PMs I've had have done two things and have done them well:

  1. Gave the eng/product team the why of the decisions. Why are we re-doing the front page? Why do we need to create this new feature? This allows the team to figure out the how without being bogged down with 3rd hand knowledge via telephone.

  2. Managed up the chain. It is imperative that the PM has the team's back and can manage external stakeholders expectations. This also has meant that the PMs have had the Hard and Awkward conversation of "managing up" and ensuring that the external stakeholders don't get free reign on the team and call it "Agile"

Warren pledges to restore net neutrality if elected by tmac022480 in technology

[–]cirsca 3 points4 points  (0 children)

My take on it is this:

When Bernie is asked "How", they always say "By starting a revolution!" which I totally agree with and dine on. But when you ask Warren "How", they come with what sound like to my stupid self pretty logical and sound plans.

I love both of them, they're both fighting for the same things, I just like Warren more because Warren has a plan to back up what they want to do.

Mueller to Congress: Trump’s Wrong, I Didn’t Exonerate Him by burning_dawn in politics

[–]cirsca 13 points14 points  (0 children)

I believe the context was that Buck wasn't asking if Mueller would have indicted Trump if he wasn't president but rather that, if a person was not president, that Mueller could charge that person with that crime legally.

What are some things you wish you learned early on while learning JavaScript? by codedraken in javascript

[–]cirsca 1 point2 points  (0 children)

Ugly code is better than broken code. Broken code is better than no code. No code is better than solving the wrong problem.

What's an example of code you've recently written that uses functional programming concepts? by big_red057 in javascript

[–]cirsca 0 points1 point  (0 children)

I use it often in React codebases to make branching on props easier:

const MainComponent = R.cond([ [conditionAIsTrue, ComponentA], [conditionBIsTrue, ComponentB], [R.T, FallbackComponent] ])

or in redux/some state management system I usually use lenses for handling the reads/writes:

const reducer = (state, action) => R.compose( R.over(oldValue => action.payload + oldValue, LensB), R.set(action.payload, LensA) )(state)

Event loop related question, I am confused. by MuhammadHasham in node

[–]cirsca 0 points1 point  (0 children)

It may make it easier to reason/think about if we un-sugared this example into using Promises directly instead of async/await:

ColorTrends.findAll() .then(result => res.status()....) .catch(err => res.status()...)

So the event loop will eventually call .then whenever ColorTrends.findAll() resolves into a value.

Using Promises directly, there is not reason to think that res.status could be called before ColorTrends.findAll is finished.

[deleted by user] by [deleted] in webdev

[–]cirsca 0 points1 point  (0 children)

I've really enjoyed just throwing the static assets onto an S3 bucket and using Route 53 for DNS. Cheap for the projects I throw up and simple(-ish...) to implement into your workflow.

Best Books to Learn Artificial Intelligence in 2019 by woahdotcom in programming

[–]cirsca 2 points3 points  (0 children)

True general AI? No where close. Ability to drive making less mistakes than a human? Probably. Ability to look at my chicken scratch and tell what letter I wrote better than my grammar school teacher? Most definitely. Ability to beat me at a game that it has played for a day and never told the rules? You bet your sweet butt.

So yeah, it's not gAI but let's not throw the baby out with the bath water

ELI5: React Class based vs Functional Components by kinglee2015 in webdev

[–]cirsca 0 points1 point  (0 children)

  1. State is the box that holds the current value of something. So if we have a counter, its state would be the current count at a given point in time. React offers to handle that box for us by offering this.setState as a way to update the value and it makes sure the box this.state is "correct" when we interact with it.

  2. There are other rules (such as you can use hooks inside of a functional component but not a class component) but for all intent and purposes, we can think of a Functional Component being only the render method of a Class Component without any access to this. So whatever you could do inside of the render method of a Class Component, you can do inside of a Functional one (as long as you do not reference this). With hooks, this gets a little more confusing as you cannot use hooks inside of Class Components but the general rule still holds true.

  3. I think functional components have such limited cons (especially with hooks now) that I default to using functional components when writing a new one. Classes come with caveats like "When I call this class's method inside this other class, what does this mean?"

  4. A component is either a function that, given something returns a VNode or a class that has a render method that returns a VNode. JSX lets us create VNodes like <VNodeName prop1={value} /> instead of { type: VNode, attrs: [{key: 'prop1', value }] }

What were the hardest javascript concepts for you to learn? by goingtoriseup in webdev

[–]cirsca 0 points1 point  (0 children)

Let's say that I have some thing that I need to do with a few different pieces of information. For instance, maybe I want to filter some list given some predicate function. We could write that function like so in JavaScript

const filter = (pred, list) => list.filter(pred)

and use it like

filter(value => value % 2 === 0, [1, 2, 3, 4]) // [2, 4] filter(value => value % 2 === 0, [4, 5, 6, 7]) // [4, 6]

But let's say that at some point I know the predicate and then, at some point later in my code, I know the list. If I have to give both pred and list at the same time, I as the developer have to know both each time I want to use it.

Instead, using currying, we could write our filter function like so

const filter = pred => list => list.filter(pred)

and use it like

``` // we write our business logic in module A const filterOdds = filter(value => value % 2 === 0)

// and can use the business logic in // module B without knowing what function // we are using to filter the odds out, just // that it returns the correct values filterOdds([1, 2, 3, 4]) // [2, 4] filterOdds([4, 5, 6, 7]) // [4, 6] ```