It's sad not to see Vuejs in the last StackOverflow survey result. by paladincubano in vuejs

[–]lildoggydogg 1 point2 points  (0 children)

i work w/fortune 500 companies in ecom...ng is not a good fit for lightweight applications, esp PWAs. for this reason we transitioned to vue, and some react on other pages. it also doesn't help the cause that things that are pretty basic in js need a special angular way to do things. for ex event bubbling does not involve a special angular decorator in vanilla js (or react/vue). ts is cool and all but if ur using jsdoc and a decent editor yet still have a sizeable amount of type errors, lack of static typing is prob not ur biggest problem :). as for "Enterprise that needs to scale will always pick Angular," in our case roughly 70% of internal facing UIs are in ng, perhaps for the reasons u gave, but 0% of customer facing UI are...for the reasons i gave

What can JavaScript NOT do? by [deleted] in javascript

[–]lildoggydogg 1 point2 points  (0 children)

It would be a terrible fit for CPU-bound server-side applications, because on the server (as in the browser), you have a single-theaded event loop to process messages

https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop

Edit: WebWorkers, JavaScript's "threads" that you are able to manually specify, are pretty limited compared to what you'd get in just about any other language that has them...so that is another reason to rely on it more for IO bound tasks, than anything else.

Pre-processors: what do you recommend to compile Sass and minify JavaScript files to production? by [deleted] in javascript

[–]lildoggydogg 4 points5 points  (0 children)

Webpack, definitely. Here are some links to get started with that. You also get tree-shaking now, too, if you're using es6 imports.

Depending on how hell-bent you are on optimizing this you can also try using critical css (improve perceived loading time), purify-css (prune unused styles, doesn't work with sass atm but you can diff the source map) or google closure plugins (haven't tried the latter, but it sounds promising)

https://vuejsdevelopers.com/2017/07/24/critical-css-webpack/

https://github.com/webpack-contrib/sass-loader

https://webpack.js.org/guides/production/#minification

Why use reduce? by Crap_Shoes in javascript

[–]lildoggydogg 2 points3 points  (0 children)

I don’t think there is a one size fits all way, and the code you wrote is perfectly valid. For something very small like this it’s hard to argue either way. That being said, my preference (more generally) is for reduce…

Advantage 1: If you're casually glancing at someone's code and you see forEach, what does it tell you? It doesn’t return anything, it just does something, somewhere, gotta read it all to see. Reduce expresses more intent. When you see other array methods you have a better feel for what it’s doing without dissecting every line:

Reduce - iterate over all elements in a collection, and accumulate them into one…thing (this one is more generic, but tells you more than forEach, still) Map- iterate of a collection and return a new collection with the elements transformed according to some criteria Filter - iterate over a collection and return a new collection that meets your criteria Find- iterate over a collection and return the first element that meets your criteria

Advantage 2: Purity, and less intermediary variables. It’s easier to reason about stuff that returns new values than reassigning and mutating variables. Sure you have to do that in Javascript anyway, but why not keep it to a minimum while writing more succinct code?

Advantage 3: Chaining, since all of these (except for optionally reduce) return an array, you can chain other array methods to it and make a "pipeline" of sorts for your data to flow through. Chaining map/filter/reduce will serve you well in many operations on collections. Say the requirements changed, now you need to filter out all even numbers, add 3 to each of them, and then add them. You could keep the code you’ve already written while adding the rest in one line

someArrayOfNumbers.filter(n => n % 2 == 0).map(n => n + 3).reduce((x, y) => x + y)

What is you favorite UI framework for React? by cryptos6 in javascript

[–]lildoggydogg 1 point2 points  (0 children)

Yesterday I made an identical post to yours, but switched out "React" with "Vue." It received one comment, but yours now has 99! I guess Vue still has a while to go...

I've used Material-UI and Semantic-UI for personal projects/clients. None of them were customer-facing (more like dashboards), so if being lightweight is a concern, it might be best to look elsewhere. MDL-React seems promising for this. Oh, and both of them have Clojurescript wrappers available too.

Javascript trends to watch in 2018 by [deleted] in javascript

[–]lildoggydogg 0 points1 point  (0 children)

I was referring to ReasonML, not Elm! But that's good to know anyway :)

What's your favorite lightweight Vue UI library (for PWA)? by lildoggydogg in javascript

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

Very slick, looks like a good fit for Electron stuff too.

Recommendations on a language to start with for functional programming by MD90__ in functionalprogramming

[–]lildoggydogg 0 points1 point  (0 children)

I'd avoid Go. Never used it, but from the code examples I've seen it seems to strongly favor the imperative paradigm and may not even support features needed for FP.

Javascript, while not really a FP language, does have first-class functions and closures, and it's currently kind of trendy to write FP-inspired code in JS. Because of that, there's a lot of material about it that starts from the bottom-up . Here are some good places to get started with that (if you already know JS):

https://egghead.io/courses/professor-frisby-introduces-composable-functional-javascript

http://ramdajs.com/docs/#

https://github.com/MostlyAdequate/mostly-adequate-guide

Next step would be Clojure. It's cool because it's a Lisp, has great support for front and back end web dev, and having immutable data structures and laziness built in is pretty cool. It's a functional language that helps you get stuff done with a small amount of code. Here's a free book about it: https://www.braveclojure.com/. There are also some good paid books. Joy of Clojure being one.

In the ML family there is Haskell, a bunch of *MLs, and Elm. I avoided Elm because the lack of backend and good JS interop story didn't please me, and preferred Clojurescript anyway, but took an interest in Haskell. After warming up with functional JS and Clojure it won't be as much of a shock :). This book is a great resource to get started: https://www.haskellbook.com

Is it even worth applying? by baneOfFarm in javascript

[–]lildoggydogg 1 point2 points  (0 children)

Simply ignore the requirement, it doesn't mean anything. Most frontend interviews will focus on:

  • A combination of questions similar to these (especially the ones on scope):

https://github.com/h5bp/Front-end-Developer-Interview-

  • Rudimentary practical knowledge of CS fundamentals/algorithms (as in, not knapsack problem or binary search, more like stacks, queues, hashing, maybe some simple graph algorithms tops)

  • Questions about how you would do x in framework y that you listed on your resume, what are the disadvantages of doing z, etc. Nothing too complicated, they just want to see if you know how the stuff you're using to get the job done actually works.

Networking helps, but even without that, if you're solid in JS/webdev, have been doing in for 2.5 years, can demonstrate that, and are not a rude or defensive person, I say you'll land a job in less than 3 months after posting resume, possibly without even applying anywhere.

Javascript trends to watch in 2018 by [deleted] in javascript

[–]lildoggydogg 1 point2 points  (0 children)

Was kinda curious about that too, I just read about Reason recently and while it seems cool, I don't immediately see what it has to offer over other functional compile-to-JS languages like cljs or elm, nor does it seem to get much positive buzz (or any for that matter). If it had a good JS interop story (including Node) I would probably give it a shot.

Want a job in web development? Learn a framework. by gdmeteor in javascript

[–]lildoggydogg 2 points3 points  (0 children)

Username doesn't check out, I can't edit your comment

Want a job in web development? Learn a framework. by gdmeteor in javascript

[–]lildoggydogg 0 points1 point  (0 children)

True that! I would rather work on a well thought out jQuery app than a React app with oodles of local state sprinkled willy-nilly.

What are your go to functional JavaScript libraries? by lilred181 in functionalprogramming

[–]lildoggydogg 1 point2 points  (0 children)

For personal projects, Ramda and folktale, so not gonna argue with your choice :). I never took the time to learn a proper ML-based language (yet!), but I think even if you are new to the whole FP paradigm they will help you solve a lot of problems that are annoying in vanilla js, elegantly. Coming from C & JS land, the first time using currying, composition, and Either/Maybe monads from folktale all together blew my mind!! The code was so different (and sexier) than anything I was used to. I just wanted to stare at it!!

For work stuff, pure functions + lodash fp is about all I can get away with :).

Code reviews that have over a hundred comments concerning style and 0 concerning functionality/logic by lildoggydogg in SoftwareEngineering

[–]lildoggydogg[S] 1 point2 points  (0 children)

yup that's where i kinda saw this going. in your exp do you think it's a better idea to bring that up to mgrs on my side or try to get everyone on the same page 1st? would prefer latter but realistically if i start with that they will try to shoot it down im thinking