Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "preact"
-
You know who sucks at developing APIs?
Facebook.
I mean, how are so high paid guys with so great ideas manage to come up with apis THAT shitty?
Let's have a look. They took MVC and invented flux. It was so complicated that there were so many overhyped articles that stated "Flux is just X", "Flux is just Y", and exactly when Redux comes to the stage, flux is forgotten. Nobody uses it anymore.
They took declarative cursors and created Relay, but again, Apollo GraphQL comes and relay just goes away. When i tried just to get started with relay, it seemed so complicated that i just closed the tab. I mean, i get the idea, it's simple yet brilliant, but the api...
Immutable.js. Shitload of fuck. Explain WHY should i mess with shit like getIn(path: Iterable<string | number>): any and class List<T> { push(value: T): this }? Clojurescript offers Om, the React wrapper that works about three times faster! How is it even possible? Clojure's immutable data structures! They're even opensourced as standalone library, Mori js, and api is great! Just use it! Why reinvent the wheel?
It seems like when i just need to develop a simple react app, i should configure webpack (huge fuckload of work by itself) to get hot reload, modern es and jsx to work, then add redux, redux-saga, redux-thunk, react-redux and immutable.js, and if i just want my simple component to communicate with state, i need to define a component, a container, fucking mapStateToProps and mapDispatchToProps, and that's all just for "hello world" to pop out. And make sure you didn't forget to type that this.handler = this.handler.bind(this) for every handler function. Or use ev closure fucked up hack that requires just a bit more webpack tweaks. We haven't even started to communicate to the server! Fuck!
I bet there is savage ass overengineer sitting there at facebook, and he of course knows everything about how good api should look, and he also has huge ass ego and he just allowed to ban everything that he doesn't like. And he just bans everything with good simple api because it "isn't flexible enough".
"React is heavier than preact because we offer isomorphic multiple rendering targets", oh, how hard want i to slap your face, you fuckface. You know what i offered your mom and she agreed?
They even created create-react-app, but state management is still up to you. And react-boierplate is just too complicated.
When i need web app, i type "lein new re-frame", then "lein dev", and boom, live reload server started. No config. Every action is just (dispatch) away, works from any component. State subscription? (subscribe). Isolated side-effects? (reg-fx). Organize files as you want. File size? Around 30k, maybe 60 if you use some clojure libs.
If you don't care about massive market support, just use hyperapp. It's way simpler.
Dear developers, PLEASE, don't forget about api. Take it serious, it's very important. You may even design api first, and only then implement the actual logic. That's even better.
And facebook, sincerelly,
Fuck you.17 -
Discussion between me and my N+1
(Note : I'm in the company for 3 months)
Me : As the tech leader, shouldn't you review my code ?
N+1 : I'm not the tech leader.
Me : Wait what ?
N+1 : I wrote the app from A to Z, hence I'm the architect.
Me : That's what I mean. Being the most knowledgable dev in the company makes you de facto tech leader.
N+1 : No, I'm not the tech leader. The CEO is.
Me : But he didn't even know the tech we are using !
N+1 : .... Anyway, I won't do code reviews. I don't like that.
(2 hours later)
N+1 : You made a mistake in the code. You broke a hidden functionality. You should be more careful, or ask me if you have doubts.
This guy is collector.3 -
My own language, hence my own parser.
Reinvented the regular expression before realizing it already existed (Google didn't exist at the time).
I'm a living reference for regular expressions since then.7 -
@dfox I just want to say thank you !
Most of my friends are not devs at all. Thanks to you, I can share my adventures to people that actually understand what I'm talking about.
This is priceless.9 -
!rant, a success story.
I made a tool for a live streamer I like, for free. Something to find highlights in a VOD based on the chatlog.
It took me around 15h to make. It is a very simple electron app, the "valuable" code is ~70 lines.
I wasn't sure he would even bother to try it.
Anyways, I send it to him. 10 minutes later, the guy tells me that "this is amazing! You just saved me hours of derushing my streams ❤️"
That's great already, but it does not end there. A few minutes later he asks me "I know other streamers that would love it, can I share? And can I add you in our private discord?"
I have now a direct access to some of the best youtubers/streamers in my country 🤩.4 -
VueJS FTW!
Today I realised I've been a fucking idiot.
For the last few years I have familiarized myself with libraries like React, VueJS, Preact etc.
All while playing around on my own side projects but when it came to doing actual work (perhaps from a lack of confidence/working experience with them) I always reverted to vanilla js or jQuery because I convinced myself it wasn't the `right` use case or `the project was too simple or small`.
I WAS AN IDIOT.
The below screenshot is a prototype of a n invoicing tool I needed to write which uses VueJS and is implemented in 50 beautiful, clean, maintainable loc. Combined with TypeScript it is a dream - never did I think I would see the day where I could grab an inputs numerical value without prepending the variable with + so I don't end up concatenating them as strings.
If your like me and haven't started using some kind of data binding view framework stop procrastinating and just do it. I feel like I wasted a large chunk of my life clinging onto my old ways.7 -
That moment when your manager tells you that he's okay with ultra-flexible schedules, because "I trusts you 100%. You proved your value, please come late if you prefer"
I love my job11 -
The brief history of Facebook open source:
- FB releases React under an oppressive licence that tells "woopsie, can't sue FB if you use React"
- a lot of money goes into making React popular to gain leverage from mass adoption
- VMware bans React in their company
- FB releases Flux to bring state management. It flops. Replaced by what some Russian student wrote in several evenings (Redux)
- Preact is released. It's faster than React, and it has MIT licence. Vue beats React in GitHub stars.
- Under mass pressure, FB changes React's licence to MIT. Initial plan to gain leverage fails spectacularly.
- FB releases Flow Types. It flops. Replaced by TypeScript.
- FB releases their own app market for React Native. It flops.
- FB releases Relay. It flops. Replaced by Apollo.
- FB tries to push React.Suspense for the whole JS landscape to obey and comply to how it works. Community says "Fuck You".
- FB releases react-native-web. It flops.
- Web Components are out in all browsers, adopted as a standard. React doesn't support them.
- Google releases Lit, a virtual DOM framework on top of Web Components to fuck with React. It's a massive success.
- React 18 is out. Still no Web Components support.
- (you are here)17 -
When the impostor syndrome hits me, I try to remember my achievements :
- I won a national coding contest when I was 18,
- I made and still maintain a complex app for 15 years, still actively used,
- I cannot count the number of languages I know; too many of them...
Not bragging here, btw. It's just important to actually enumerate your achievements.
If you get hit by the IS, just remember what you did 😉.12 -
Backend colleague : the API is online. It's tested and working, you can start the dev.
Me trying to manually call the API with all the fields pre validated : "error : invalid fields"
EVERY. FUCKING. TIME !
To all the backend developers : we are NOT your personal testers, and we are NOT supposed to clean your mess because you're too lazy to FUCKING TEST THE HAPPY PATH!!!
Thank you for your consideration.5 -
Me: okay brain! We had our morning coffee. We're ready to work. Lots of things to do today.
Brain: yay! I feel unstoppable! Can't wait for logic problems and amazing things we're going to build! What's the plan?
Me: great! Today we're going to work on the ios implementation of our app. Where should we start?
Brain: ...
Me: brain?1 -
Dates are f***ing annoying, we humans deal with them in such a weird way. It's almost impossible to define a algorithm dealing with them consistently.8
-
TL;DR : do we need a read-only git proxy
Guys, I just thought about something and this potential gitpocalypse.
There is no doubt anymore that regardless of Microsoft's decisions about Github, some projects will or already have migrated to the competition.
I'm thinking : some projects use the git link to fetch the code. If a dependency gets migrated, it won't be updated anymore, or worse, if the previous repo gets deleted, it can break the project.
Hence my idea : create some repository facade to any public git repository (regardless of their actual location).
Instead of using github.com/any/thing.git, we could use opensourcegit.com/any/thing.git. (fake url for the sake of the example).
It would redirect to the right repository (for public read only), and the owner could change the location of the actual repository in case of a migration.
What do you think ? If I get enough ++'s, I'll create a git repo about this.6 -
I wanted to be able to physically start a home computer remotely.
- raspberry pi
- power relay to simulate the button
- a messenger chatbot linked to my account only
Now my local server is startable from anywhere7 -
!activism
Guys, what should we do about Article 13 ?
The bill passed, well, that's unfortunate. We can still scream as loud as we can that it's a very bad idea, but let's face it, it won't probably work...
Personally, I'm sick of this shit. Every year they try to "regulate" the web with a new fucked-up legislation that they actually don't understand. I don't blame them for not knowing any better, but I blame them not to surround themselves with actually competent people (and no, lobbies are NOT competent, only interested).
So there it is : I want to act on this one. With traditional, ineffective methods (petitions, mails...), but I want to get further this time.
Here are some ideas :
- create/promote a platform explicitly made for "copyrighted" stuff (basically memes). Located outside of EU. But is it enough for being outside of the law ?
- Put some physical-paper memes near the EU parliament (I live in Brussels), just to mess with them ^_^
- Make the filtering algorithms crazy by spamming them with copyrighted content. I doubt this one will have any effect though...
Any ideas ? Let's go crazy there, they deserve it.8 -
University, first year. I went to my Java/OOP teacher's office to about the course (I had started programming C++ ~5 years ago).
I wanted to discuss the fact that some parts of the course seemed too theoretical for beginners in my opinion. Rookie mistake : do not criticize the cursus of an academic if you are in your first year, even when you are right. I learned it the hard way...
The teacher started to tell me that I was just a first-year student, I had no experience yada yada...
To that I replied "I'm doing C++ for 5 years. This is OOP so yeah I do know a little more than you think".
I will never forget his reply "LOL C++ is not Object-Oriented !"
I never went to his course after that. I learned a few years later that the teacher was a well-known a**hole along his peers and got fired by the University...40 -
Guys, I just received a *constructive* comment about a code of mine on StackOverflow.
WTF is going on?7 -
I always wondered how it would be to have English as mother tongue.
Because :
- Insects are causing problems in computers,
- you're using a glass door or a fruit for OS (well, some of us),
- the internet is made of people bringing your glass in the restaurant,
- you navigate on the spider's fiber,
- ...
That must feel weird considering it's the same words that you use for other parts of your life7 -
I would build something to go in space. Probably in the energy or propulsion field.
I have zero Knowledge in those, but hey, unlimited time.2 -
Does anyone have experience with alternatives like Preact in industry?
Asking because Facebook has mind numbing license clause which means they can infringe any patent they please, because as soon as we sue, they withdraw our license.
Such a lovely way of supporting startups.3 -
"No signature of method: build_4z0stktnpkjsyfd6ol74tcab1.android() is applicable for argument types: (build_4z0stktnpkjsyfd6ol74tcab1$_run_closure2) values: [build_4z0stktnpkjsyfd6ol74tcab1$_run_closure2@5edbe9fa]"
Thank You gradle. This is very useful.... FML2 -
its 2:30 here and ill have to wake up for work at 7:00 and im trying to figure out what the hell is redux3
-
My brother (not a dev) asked me for help for his A* algorithm he's trying to optimize.
I'm so proud5 -
If you could choose one, what should happen in 2020 :
1. Apple let developer build iOS apps on non Apple machines
2. NPM/Maven/... run 10x faster
3. Javascript dies and gets replaced by a better language
4. Governments stop trying to ruin encryption
5. Facebook splits
6. Quantum computers are being sold for consumer use
7. We have our first high - level generic AI working17 -
Guys, serious question.
I work in a startup as a cto. We have a very low budget and considering hiring people offshore.
Does anyone have some experience in hiring and piloting a remote team? Would you recommend it?11 -
Scheduled an interview with a company regarding a frontend position, everything seemed perfect until I actually got on my way to head to their office.
They didn't have the address of their office anywhere, it wasn't listed on google maps, their own website didn't have any information on where their office is.
I tried calling them / emailing but they didn't respond until like 5 hours after the interview should have taken place.
So I didn't even get to the testing part.4 -
Just spent the whole week trying to build an Ionic app for iOS. Of course, I don't have a Mac.
I should charge Apple for the enormous amount of time I lost because of their f***ing policy. Seriously guys ? We're in 2018. -
Not really a recruitment experience, but when I was a uni student, my IT teacher told me face to face that "C++ is not object oriented"7
-
Can anyone explain to me how is it possible that some devs like to work on macos?
This feels like a punishment to me. Every time.26 -
Pitching Preact for a client. They wanted us to use Dojo because they bought support for it and I was like OH HELL NO FUCK NO
-
In 2020, the Earth slightly accelerated its spin.
For the first time in history, we need to add a *negative* leap second in our datetime systems.
...
Which means all the datetime libs need an update. I hope they anticipated this.20 -
My Frontend team lead came to me today to show me some "amazing" React component he wrote.
It was a pile of overengineered shit. -
Took an interview, where the interviewee was trying to spin tales around react fiber and preact. I was like sure, I just was watching React Conf 2017 yesterday, and he shut up.
-
Well, the James Webb Telescope runs on Javascript (partly)
JS haters, any comment? 🙃
https://theverge.com/2022/8/...12 -
I feel there aren't enough tutorials on "best practices" when it comes to combining server/client tooling in a monorepo.
Having done so this weekend, the tasks involved were:
* using graphql w/ express to serve requests and expose a "graphiql" ide instance
* differentiating build steps in prod vs. dev
* applying middleware in prod vs. dev
* working with a single heroku dyno
Still missing:
* hot reloading
* my general sense of direction -
I have a unique opportunity to go to the websummit for peanuts.
As the staff requires us to install the websummit app before the event, I did yesterday....
Now I'm being literally spammed by every sales person on the app chat. Some even posted *before I registered* !
My god, they're everywhere !1 -
A new js framework has come up with all features similar to React but of just 3kb. For the love of God, when is this madness going to stop?!
https://preactjs.com -
The CI on Mac is broken. Again.
Next time I have a client that wants me to work with Apple, I'll double my rate. -
Quick JS tip
If you want to split a string into characters, you can use the ES6 spread operator
If you have
const name = 'react-dev'
You can just spread it like this:
const charsInName = [...name]5 -
How to realize that experience matters : make a demo where all your code works, but everything fails because the other dev has done a shitty job 😅1
-
Another new JS library rears it's head. It's called 'Preact.js'.
I'm as little suspicious at this point. Is it written by devs from China? A year from now I'll have to learn 'Predux' if Preact gains popularity. -
Amazon just launched DocumentDB, a clone of MongoDB.
I personally waited for this for a long time. How about you?4 -
I was looking at 2019 stateofjs survey. I'm really surprised with all this hate towards Angular. I've been using Angular for past 3 years now, and apart from the mess with versions, I think it's the most complete and beautiful framework out there. I get that not all the people like Angular that much as me but 38% satisfaction (compared to 78% for preact and 88% for svelte for example) in my opinion is craziness.
LINK: https://2019.stateofjs.com/1