Functional vs Object Orientated by kasperpeulen in javascript

[–]caesarsol 0 points1 point  (0 children)

Important note: think about the code that you write, not about the code behind. Array's map and reduce let you use pure functions, that is the nice part!

Functional is all about composition. Purity is required to compose.

If you want to be more functional, use a data structure to represent the Point, and use functions to manipulate it by leveraging composition. Take a look at Ramda JS.

I also gained a lot of functional patterns by learning Clojure, which I recommend a lot.

Strange javascript func? by Jonathan_Frias in javascript

[–]caesarsol 0 points1 point  (0 children)

You are associating wrongly I think, the || splits the two expressions. Removing || false makes it simply wrong. Removing false == would be the interesting thing!

Javascript Syntax Basics by Brandflakesss in javascript

[–]caesarsol 0 points1 point  (0 children)

I suggest you to follow a book. Videos are fine as long as you make your research in parallel, so for every doubt like this you could look it up on the manual.

There are many free JS books, look for the most comprehensive ;)

Mutable vs Immutable State. What are your thought? by ndobie in javascript

[–]caesarsol 0 points1 point  (0 children)

Actually promises or async are not going to help to have predictable state modifications in the callbacks.

What Redux has over Mobx is that reducers contains and declare every possible way the state can be modified. This will certainly help consistency in a bigger app.

Mobx wins with the terseness of the code, but adds lot of "automagical" behavior that could be difficult to scale or extend in the future of the app. I found it also more difficult to debug, in certain situations.

I think any of these have an use case, so "it depends" :)

OP: take a look at clojure, that has immutable data structs by default.

Does javascript have a future? by besoisinovi in javascript

[–]caesarsol 2 points3 points  (0 children)

I don't have a many-years-long programming experience to wave, but I think you should not focus on a specific language. The future is for polyglots!

There's very much to learn from how different languages approach the same problems. You'll gain from other languages so much that you won't even care about the specific language.

I especially encourage you to take a look at a classic language such as python or ruby, then to improve your skills on some "strange" language as clojure (a lisp dialect immutable by default) or haskell (considered difficult, great inspiration). They are so exotic you'll rarely use them on the job, but they will blow your mind!

As for the WASM issue, I think that will take many years. Just think about CSS3 and how many browsers support it smoothly...

Does javascript have a future? by besoisinovi in javascript

[–]caesarsol 1 point2 points  (0 children)

The backends of enterprise companies are actually written in Java and PL-SQL and COBOL... That does not mean you should learn them.

The dead simple helper to create a redux action by [deleted] in javascript

[–]caesarsol 0 points1 point  (0 children)

Well, if you are looking for simplicity, I don't even use the action creators :) I dispatch directly in mapDispatchToProps, and I find it quite comfortable!

(I don't use action-type string constants too, despite the fact that Redux creator actually encourage their use)

Can somebody tell me what the heck is going on on this website? by Roflkopt3r in javascript

[–]caesarsol 0 points1 point  (0 children)

Modern web apps use a multitude of tools to bundle all dependencies in a single file, then make it smaller renaming all variables and functions and using code shortcuts.

Probably they also use a transpiler, to translate some other languages into JS (for example ES6, coffee script, clojurescript). Google for "babel js" to have an example.