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 - "ts"
-
In one of our first C programming classes today in college, I booted up Ubuntu on the dual boot systems to practice our first few programs which we were supposed to be doing in Turbo C on Windows.
I successfully compiled it using gcc on the first try which appeared like magic to my neighbor. Soon our teacher came to check my program and said that I made a mistake. I asked her what is the mistake? She said that I was supposed to be using conio.h!!
I argued that it is not a standard header file and using it makes the code non-portable. She tried it to edit it to include conio.h but couldn't edit it since I was using vim. I was asked to switch to Windows and use Turbo C instead and also use conio.h. I denied and she told me to follow her or leave the class.
The weather was nice.19 -
API Guy.
He has a serious regex problem.
Regexes are never easy to read, but the ones he uses just take the cake. They're either blatantly wrong, or totally over-engineered garbage that somehow still lacks basic functionality. I think "garbage" here is a little too nice, since you can tell what garbage actually is/was without studying it for five minutes.
In lieu of an actual rant (mostly because I'm overworked), I'll just leave a few samples here. I recommend readying some bleach before you continue reading.
Not a valid url name regex:
VALID_URL_NAME_REGEX = /\A[\w\-]+\Z/
Semi-decent email regex: (by far the best of the four)
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
Over-engineered mess that only works for (most) US numbers:
VALID_PHONE_REGEX = /1?\s*\W?\s*([2-9][0-8][0-9])\s*\W?\s*([2-9][0-9]{2})\s*\W?\s*([0-9]{4})(\se?x?t?(\d*))?/
and for the grand finale:
ZIP_CODE_REGEX = /(^\d{5}(-\d{4})?$)|(^[ABCEGHJKLMNPRSTVXY]{1}\d{1}[A-Z]{1} *\d{1}[A-Z]{1}\d{1}$)|GIR[ ]?0AA|((AB|AL|B|BA|BB|BD|BH|BL|BN|BR|BS|BT|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)(\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}))|BFPO[ ]?\d{1,4}/
^ which, by the way, doesn't match e.g. Australian zip codes. That cost us quite a few sales. And yes, that is 512 characters long.47 -
rant? rant!
I work for a company that develops a variety of software solutions for companies of varying sizes. The company has three people in charge, and small teams that each worked on a certain project. 9 months ago I joined the company as a junior developer, and coincidentally, we also started working on our biggest project so far - an online platform for buying groceries from a variety of vendors/merchants and having them be delivered to your doorstep on the same day (hadn't been done to this scale in Estonia yet). One of the people from management joined the team working on that. The company that ordered this is coincidentally being run by one of the richest men in Estonia. The platform included both the actual website for customers to use, a logistics system for routing between the merchants, the warehouse, and the customers, as well as a bunch of mobile apps for the couriers, warehouse personnel, etc. It was built on Node.js with Hapi (for the backend stuff), Angular 2 (for all the UIs, including the apps which are run through a WebView wrapper), and PostgreSQL (for the database). The deadline for the MVP we (read: the management) gave them, but we finished it in about 7 months in a team of five.
The hours were insane, from 10 AM to 10 PM if lucky. When we weren't lucky (which was half of the time, if not more), we had to work until anywhere from 12 PM to 3 AM, sometimes even the whole night. The weekends weren't any better, for the majority of the time we had to put in even more extra hours on the weekends. Luckily, we were paid extra for them, but the salary was no way near fair (the majority of the team earned about 1000€/mo after taxes in a country where junior developers usually earn 1500€/month). Also because of the short deadline given to us, we skipped all the important parts like writing tests, doing CI, code reviews, feature branching/PR's, etc. I tried pushing the team and the management to at least write tests and make feature branches/PRs, but the management always told me that there wasn't enough time to coordinate and work on all that, that we'll do that after launching the MVP, etc. We basically just wrote features, tested them by hand, and pushed into the "test" branch which would later get tested and merged into master.
During development, one of the other juniors managed to write the worst kind of Angular code you could imagine - enormous amounts of duplication, no reusable components (every view contained the everything used in the view, so popups and other parts that should logically be reusable were in every view separately), fuck - even the HTML was broken (the most memorable for me were the "table > tr > div > td" ones, but that's barely scratching the surface). He left a few months into the project, and we had to build upon his shit, ever so slightly trying to fix the shit he produced. This could have definitely been avoided if we did code reviews.
A month after launching the MVP for internal testing, the guy working on the logistics system had burned out and left the company (he's earning more than twice the salary he got here, happy for him, he is a great coder and an even better team player). This could have been avoided if this project had been planned better, but I can't really blame them, since it was the first project they had at this scale (even though they had given longer deadlines for projects way smaller than this).
After we finished and launched the MVP, the second guy from management joined, because he saw we needed extra help. Again I tried to push us into investing the time to write tests for the system (because at this point we had created an unstable cluster fuck of a codebase), but again to no avail. The same "no time, just test it manually for now, we'll do that later when we have time" bullshit from management.
Now, a few weeks ago, the third guy from management joined. He saw what a disaster our whole project was. Him joining was simply a blessing from the skies. He started off by writing migrations using sequelize. I talked to him about writing tests and everything, and he actually listened. He told me that I'm gonna be the one writing them, and also talked to the rest of management about it. I was overjoyed. I could actually hear the bitterness in the voices of the rest of management when they told me how to write the tests, what to test, etc. But I didn't give a flying rat's ass, I was hapi.
I was told to start off by writing a smoke test for the whole client flow using Puppeteer. I got even happier, since I was finally able to again learn new things (this stopped at about 4 or 5 months into the project).
I'm using jest as the framework and started writing the tests in TypeScript. Later I found a library called jest-extended, but it didn't have type defs, so I decided to write them and, for the first time in my life, contribute to the open source community.19 -
You know what I realized we should always say no for demo driven application development.
We should always ask for enough time do a proper development and if its not enough, shouldn’t write a single line.
Because once we deliver a working demo. Its release ready for them because its FUCKING WORKING..
And trying to explain why this is just a demo and cant be put to production is even bigger pain in the ass than saying no in the beginning.
LESSON LEARNED .4 -
I have my best moments but the first time I felt badass about computers was when I was at kindergarten.
There was one computer with one cool game with skateboard. I wanted to play but the other kids didn’t let me.
I thought that if it look like I fix the computer they will let me. I took me month or little more but I made shutdown bat(I didn’t really understood fully) and I added it to the game shortcut from usb.
One of the other kids started the game and the computer turned itself off. Hi tried a few times and then I offered to fix it, I created new shortcut replacing the “hacked” one and the game ran.
From that moment the computer and the game were always free for me.7 -
At the Samsung store:
Woman looking for a phone: Can you recommend me a phone by a picture of me?
Seller: Why not, show me the picture.
The woman shows https://devrant.io/rants/728524/... and the seller starts looking for something.
The woman asks: What are you looking for?
Seller: Note 7.1 -
The overhead on my JS projects is killing me. Today, I went to implement a simple feature on a project I haven't touched in a few weeks. I wasted 80% of my time on mindless setup crap.
- "Ooh, a simple new feature to implement. Let's get crackin'!"
- update 1st party lib
- ....hmm, better update node modules
- and Typescript typings while I'm at it
- "ugh yeah," revert one node module to outdated version because of that one weird proxy bug
- remove dead tsd references
- fix TS "errors" generated by new typings
- fix bug in 1st party lib
- clean up some files because the linter is nagging me
- pee
- change 6 lines of code <-- the work
- commit!3 -
Tech support: we need to install backup software on your laptops.
Devs: what for?
TS: to backup all your important files, like word docs, excels, etc.
Devs: we don't use those. everything is on git/confluence/etc
TS: my boss told me to install it everywhere, so I have to do it.
Devs: well just disable it. uses too much tam, disk time and such
TS: whatever.
So he installed it on each laptop separately, took half a day, then we just disabled it and proceeded with our tasks. Now we get a question every other week why nothing is being synced from our computers. "We paid for the system and we want you to use it".
yeah..7 -
"Sooo, children of the village, what are we going to write front-end in?" - I said to my infant students.
"Typescript with ts-loader/awesometypescript loader for webpack" - simultaneously yelled the kids.
"Exactly! Brilliant! And now, what are we going to be writing back-end in?" - asked I then.
The kids yelled: "PHP 7.2 with Laravel, or Go with Gingonic and juliensmith/httprouter, or Typescript without loader, with express/koa"
Truly stunned with their excellence, I asked "Well, now you 100% ain't gonna get it right - what are we going to be writing a desktop application that doesn't require a lot of native functionality and preferably, cross-platform in?" And the kids didn't hesitate to yell happily "Typescript targeting Electron", which has only brought tear to my eye.
"A native ms windows app?" "WPF under C#"
"A native gtk app?" "Vala"
"A native KDE/XFCE app?" "Cpp/Qt"
"A native mac app?" "Swift3.2/4"
I was in tears, just thinking about what future these kids have, but suddenly I have noticed one of kids seemed puzzled. It was Pajeet, an indian guy, ugh, his mom was a bitch. I asked him "What is wrong, little acoustic?" "But I like Java, and I would like to make back-end with Tomcat!" he replied. "Ooooh :3" cutely I moaned, trying to reach the handle of the table locker "I've got something just for you". I pulled out a rope, with sewed-in spikes, covered in drool and piss, came up to Pajeet and tenderly put it around his neck, making a knot. Pajeet fell under the table, and I got fired.8 -
First day of job tomorrow.
Will be working on Angular 4, TS, JS, front end.
Wish me luck!
Also, Any advices?10 -
Hello everyone 👋
I see people blaming the developers when you see a crappy software product , saying that they have done a bad job.
But even it could be true also it could be the product managers who didn’t give enough time todo what needs to be done or project scope is too big for the persons knowledge.
I’ve worked in a company where deadlines were so tight I didn’t have enough time to proper UI and Testing. I used to be only developer who has someone experience and I had to train the interns as well. I am also to blame to joining such company but in desperate times takes desperate measures.
And now when i’m leaving the company and I have spend 2 years of my life for apps that I’m not proud of.
Just rant. Please feel free to give ur thoughts2 -
Ever heard of event-based programming? Nope? Well, here we are.
This is a software design pattern that revolves around controlling and defining state and behaviour. It has a temporal component (the code can rewind to a previous point in time), and is perfectly suited for writing state machines.
I think I could use some peer-review on this idea.
Here's the original spec for a full language: https://gist.github.com/voodooattac...
(which I found to be completely unnecessary, since I just implemented this pattern in plain TypeScript with no extra dependencies. See attached image for how TS code looks like).
The fact that it transcends language barriers if implemented as a library instead of a full language means less complexity in the face of adaptation.
Moving on, I was reviewing the idea again today when I discovered an amazing fact: because this is based on gene expression, and since DNA is recombinant, any state machine code built using this pattern is also recombinant[1]. Meaning you can mix and match condition bodies (as you would mix complete genes) in any program and it would exhibit the functionality you picked or added.
You can literally add behaviour from a program (for example, an NPC) to another by copying and pasting new code from a file to another. Assuming there aren't any conflicts in variable names between the two, and that the variables (for example `state.health` and `state.mood`) mean the same thing to both programs.
If you combine two unrelated programs (a server and a desktop application, for example) then assuming there are no variables clashing, your new program will work as a desktop application and as a server at the same time.
I plan to publish the TypeScript reference implementation/library to npm and GitHub once it has all basic functionality, along with an article describing this and how it all works.
I wish I had a good academic background now, because I think this is worthy of a spec/research paper. Unfortunately, I don't have any connections in academia. (If you're interested in writing a paper about this, please let me know)
Edit: here's the current preliminary code: https://gist.github.com/voodooattac...
***
[1] https://en.wikipedia.org/wiki/...29 -
Is it just me who sees this? JS development in a somewhat more complex setting (like vue-storefront) is just a horrible mess.
I have 10+ experience in java, c# and python, and I've never needed more than a a few hours to get into a new codebase, understanding the overall system, being able to guess where to fix a given problem.
But with JS (and also TS for that matter) I'm at my limits. Most of the files look like they don't do anything. There seems to be no structure, both from a file system point of view, nor from a code point of view.
It start with little things like 300 char long lines including various lambdas, closures and ifs with useless variables names, over overly generic and minified method/function names to inconsistent naming of files, classes and basically everything else.
I used to just set a breakpoint somewhere in my code (or in a compiled dependency) wait this it is being hit and go back and forth to learn how the system state changes.
This seems to be highly limited in JS. I didn't find the one way to just being able to debug, everything that is. There are weird things like transpilers, compiler, minifiers, bablers and what not else. There is an error? Go f... yourself ...
And what do I find as the number one tipp all across the internet? Console.log?? are you kidding me, sure just tell me, your kidding me right?
If I would have to describe the JS world in one word, I would use "inconsistency". It's all just a pain in the ass.
I remember when I switcher from VisualStudio/C# to Eclipse/Java I felt like traveling back in time for about 10 years. Everyting seemd so ... old-schoolish, buggy, weird.
When I now switch from java to JS it makes me feel the same way. It's all so highly unproductive, inconsistent, undeterministic, cobbled together.
For one inconveinience the JS communinity seems to like to build huge shitloads of stuff around it, instead of fixing the obvious. And noone seems to see that.
It's like they are all blinded somehow. Currently I'm also trying to implement a small react app based on react-admin. The simplest things to develop and debug are a nightmare. There is so much boilerplate that to write that most people in the internet just keep copying stuff, without even trying to understand what it actually does.
I've always been a guy that tries to understand what the fuck this code actuall does. And for most of the parts I just thing, that the stuff there is useless or could be done in a way more readable way. But instead, all the devs out there just seem to chose the "copy and fix somehow-ish" way.
I'm all in for component-izing stuff. I like encapsulation, I'm a OOP guy by heart. But what react and similar frameworks do is just insane. It's just not right (for some part).
Especially when you have to remember so much stuff that is just mechanics/boilerplate without having any actual "business logical function".
People always say java is so verbose. I don't think it is, there is so few syntax that it almost reads like a prose story. When I look at JS and TS instead, I'm overwhelmed by all the syntax, almost wondering every second line, what the actual fuck this could mean. The boilerplate/logic ration seems way to off ..
So it really makes me wonder, if all you JS devs out there are just so used to that stuff, that you cannot imagine how it could be done better? I still remember my C# days, but I admin that I just got used to java. So I can somehow understand that all. But JS is just another few levels less deeper.
But maybe I'm just lazy and too old ...4 -
So, I just realised that a contribution I made to an open source project 12 days ago had gotten accepted 3 days ago. I'm so ecstatic over this!
I was basically just in need of type definitions for a javascript library, and seeing as it didn't have any, decided to make them myself. Done that, I made a pull request, but seeing as there was no changes after a few days, I forgot about it.
Now I just remembered about that, and wondered if it got any comments or anything, and it turned out that they had accepted my PR and it had already been put into a release 3 days ago
I can't contain myself right now, it was my first open-source contribution, and it just feels good to know that I somehow helped some people by giving them type definitions :D
Cheers1 -
Everybody still using Windows 7 is waking up to this this morning.
Thank you Microsoft for doing sales for us 😁5 -
Update on my old rant: I started writing type definitions for our project (it's basically a chunk of separate files where you document the objects you use; typed languages have this out of the box, js doesn't and it may become useful depending on the size of the project). Our codebase is reasonably big -not complicated, but big- and I felt like I was losing track of all the properties\objects\usage\comments\whatever. So I iiterally wrote some ts interfaces: properties with name and types, that's it, so you know what you're passing around.
Proposal was denied, I'll have to delete the documentation; "keeping the doc updated is going to require more work".
Me: Ok, but what am I supposed to do when I need to interface with your code? Run the debugger and figure out what the fuck you guys are passing around?
Team leader: Yes 😊6 -
Who the fuck writes a 200 line method with 52 if/else statements, 3 try-catches, 6 loops and only 1 comment saying //Array of system records. No dipshit I thought that was a Fucking interface. What happened to the whole keep it simple notion?!5
-
It's interesting how much fun Javascript is, when you just ignore it and use Typescript instead. 😎2
-
Applied to a Jr. Dev job and was hired as a Digital Marketer — I can deal with this, I’m AdWords & Analytics certified. What I can’t abide is that I spent the last year working my ass off learning to code and the person next to me with the Jr. Dev position only uses DIVI and has zero inclination to study, learn or write basic HTML & CSS—much less PHP. I’m not an expert by any means but I love programming, I love the problem solving, the challenges and the culture of it all. So far, and these are only two examples, I’ve shown him how to use the target attribute to open a page as a new tab, and how to register a nav in the functions.php file to create a menu but he is unwilling to even attempt it. Rather, he told me that I was too technical and that no one would be using code in this day and age.
For the record, I think DIVI is a cool platform, it’s clear that my boss knows nothing about code to be fair and I love my job— this is my only issue so far😂 I just needed to rant.5 -
Installed Manjaro KDE, updated macOS, updated Windows and fixed the mess in the EFI made by those actions.
And now it’s time for screenshots: https://imgur.com/a/KviNx
(high-res imgur link)4 -
The personal trainers in the fitness that I go to are graduated programmers(.net, javascript, sql...).
During rest I can talk about something I love to people who understand me, guess I am lucky. 🍀2 -
I hate these idiots that post source code examples as an image just so they can keep their cool highlighting and style. How the fuck am I supposed to test that without re-typing the whole thing myself? Ever try OCR on source code? Not too great, is it.12
-
Fuck web development - especially CSS. Actually only CSS.
Love Js/Ts, Vue, React (NextJs ftw) and especially thank you to SCSS for making things easier.
But CSS is my most detested LaNgUagE now.
After I finish these 2 projects, I’m not doing CSS anymore. Minimal touches, sure, but no more positioning.
Maybe that’s why I like Flutter, no hassles yet.20 -
I am good to the programs I use.
I give the all the needed ram.
Except Android Studio, I don’t have a fucking server.7 -
Everyone who says: "Just rename your .js file to .ts and it's going to work instantly, no errors, don't need to rewrite anything. WELL FUCK YOU ALL! VS code says: 200 errors in a 100(!) line file.9
-
Who else hates tutorials.
They are made with so much text and outdated code that it’s better to write the thing needed by yourself and stack overflow.🤔4 -
JavaScript is a rollercoaster. From "Golly hello world is easy and I can make webpages now", to "wtf '1'+1 is '11' kill me now", to "it's not be that bad if you know how to use it", to discovering typescript and it starts feeling like a real language.
... until you can't build the project because you have too many types so you blow the memory limit in node. I can up the limit, but I can't guarantee that we won't blow past this in the future. Browsing issues on the ts repo reveals that this has been a thing for years.
Sticking with the rollercoaster analogy I'm now at "Burn it all to the ground".5 -
Now my facebook messenger app does it's updates inside the app without my consent to install an apk.
I'm scared6 -
Fucking windows automatic reboots! They seriously need to fuck off with that. As of this morning I have a finance person who can't log on, a floor manager that can't schedule his employees and a robotics controller pc that rebooted and didn't save the changes I made! Seriously, FUCK OFF!14
-
I was applying for a job that I really wanted, and were told to code an assignment. I sat for 2-3 days coding an e commerce app in react which was super fun and challenging, I think I made a pretty decent app. but after I handed it in and a couple of weeks later I got back that I didn’t make it further in to the process. The feedback showed that I missed some essential stuff and I mixed typescript and JavaScript even though it was supposed to be in typescript (I’m new to TS) :(
I feel so disappointed, I probably had too many things going on while doing this that I didn’t had time to review it properly before sending it in. Oh well, at least I have a nice job now (but underpaid)8 -
I went to a friend to help him learn angular. I asked him to show me his code, he opened sublime text, the code was all white ...
- aren't you using a TS plugin ?!
- what is that ?
- since when are you coding like this ?
- more than a week ...
I installed the plugin, than showed him VSCode.
Hi bought me a beer later c:1 -
!rant
Found out about JetBrains student program and asp.net unix support and now I am the happiest person on earth!😊🙂😋 -
Hey guys, I published a package to generate typescript types from your BE specs that uses OpenAPI schema. Would love to have some feedback/improvement.
https://github.com/devTeaa/...3 -
Has to review another Devs TypeScript project. And what do I find?
A single ts file with 700 lines of uncommented pure hard logic1 -
Can anyone tell me why is it good to use some crap language that transpiles to javascript? Yes i hate js too but 90% of my time using reason/ts/elm is just
>ddg how to do x in y
>no answer
>Js.unsafe.eval "js code"
Like???? None of them is a 100% complete wrapper???6 -
Why is the interviewing process becoming worse over the years?
About 2 years ago I applied for a company and got into 2 interviews: one with the hr to see if I am bsing them and one with the tech people, to be sure I am not using buzzwords without context. Pretty straightforward, could be done in a single interview IMHO, but it's making me waste max 2 weeks.
Fast forward to one year ago: 1 interview with the hr, 1 interview with the tech people, 1 interview with CEO (why? Just.. why?)
Fast forward to today: 1 interview with hr, 1 interview with tech people, 1 interview with the CEO (again... why?), 1 coding assignment which "it's only going to take a couple of hours" and punctually has either poorly documented APIs to rely on or has trick questions/points. So "it takes a couple of hours", but if you want to pass it you need to spend a day on it... (and let's add that they may be using old docker versions so if it doesn't work cause they are using docker 1.0 and it fails too bad, you lost time for nothing, we are not trying to solve it, you just don't pass!).
Not kidding the last assignment I took and dropped required: external API, testing, don't use CSS libraries and make your own CSS, you must use TS and it was supposed to take "3 hours max".
My question is: why? Why is the interviewing process slowly becoming less of a: "I understand that your code may not be perfect for us but that you are a human being able to reason and adapt your code to our standards" and more of a: "You must do everything PERFECTLY and we don't give a sh*t about your time, start giving us your free time and then we see if we want you."
I just keep giving up after I analyze the assignments, cause a part of my brain thinks that if this is the way a professional relationship starts it's too easy to foresee weekend shifts and lots of overtime cause some manager thinks that "come on, it just takes a couple of hours!"10 -
You have a JavaScript application. You have to keep up with stupid devs that don't know TypeScript because you don't have the time to let them study it and they get demotivated when they can't do stuff so fine, you keep it JS. You use JSDoc to write the documentation. You miss using TypeScript so you start doing some @typedef's. Oh your linter gets it and starts behaving as a substitute of TypeScript. You get excited and write more and more @typedef's! ... until they get so complicated that you start documenting *that*...3
-
Not much of a haxk, just a stupid thing that works.
In my hs videogame programming class, the teacher has this program called LANSchool (most of you have heard of it) which he used to restrict apps/browsers to the point of uselessness . He didn't (and still doesn't) know anything about the stuff he 'teaches', most is tought by TAs.
Here's the dumb part: he WHITELISTED APPS. A friend, one of the TAs, figured out that if you rename something 'Google Chrome', lanschool wouldn't care. So I got Chromium (for unblocked internet) and switched its blue icons in the exe for original chrome icons, then renamed it 'Google Chrime'. Woo.
LANSchool is such a bad program (you can even unblock a site by spamming the F key for refresh).
The teacher did, and still does, treat the TAs like trash. He's a babysitter while students listen to online vids and the TAs.2 -
My password manager!!
I use passwords I can never remember, stay logged in, next time I need to log_in I use the passqord forgotten button, reset it with my e-mail or better phone2 -
Android flow I’ve found(fixed in android 8, working on 7.1.1):
To make app uninstallable by the normal user make the app device administrator, add “android.permission.SYSTEM_ALERT_WINDOW” to the manifest and make sure it’s not granted by the user.
Now when you try to uninstall the app, it tells you to disable it from device administrators but the device administrator disable dialog is System Window handled by the app itself and if the app has this permission but not granted, settings will crash with SecurityException leaving the app untouched.4 -
Why I hate typescript. Bored during quarantine so thought I rant a little more about this.
1. Compilation time, typescript increases project compilation time from 1 second to 3-4 seconds, which is basically triple or quadruple the time if you don't know math.
2. You write a minimum of 30% more code.
3. Many libraries are not written in TS by default, which means you end up having to manually install a fuckton of @types/(pckg name) manually which is incredibly shit.
4. Typescript is an absolute pain in the ass when using dynamic libraries. Plus when it works, it usually ends up finding maybe 1-2 errors in your code MAX, completely not worth it.
5.JSDoc is 100 times better. (Still don't use it though).
6. I actually enjoy loosely typed languages, having your compiler being smart enough to tell what the type of your input is is much better than it assuming you're a fucking retard so it forces you to manually type everything.
P.S if you hate loosely typed languages, kindly resort to Angular, C#, Java or whatever and leave JS alone, cunt.41 -
Today i spent one hour and half trying to understand why my ajax request was returning "undefined" instead of a json object. It turns out i had just to restart ionic because of some bug in the ts transpiler.
Fuck you typescript.6 -
all of them. countless wasted hours.
as fate decided to turn me from $random-dev-geek into "the guy that calls the shots in tech", one of my earliest decisions was to automate formatting.
everywhere, automated at CI.
gofmt was an inspiration for the industry.
js?/ts? use prettier
C++? use ClangFormat
etc.
always default settings.
enforced by pre-commit hooks and CI.
never a single argument about bracket style, I don't care if someone likes single or double quotes better.
"fucks given" counter is fixed at 0.
everybody prefers it (ok, sometimes after a while sometimes)
of course there is still some more conventions to do for us humans.
IMHO the most critical ones.
like naming or even casing (camel, snake, kebab, - which one works where), but taking out most of the "so what" decisions takes discussions to a much more resonable level.6 -
What do you guys think about TypeScript? Does it worth time to learn the syntax? Also what is the relation between Angular 2 and TypeScript?4
-
I've been asked by my manager to document my TypeScript project with more than a hundred .ts files such that "someone with no programming background should be able to maintain it."
I should get paid as a textbook author.10 -
Soon every hacker can move to Toronto and play real-life Watch Dogs.
https://amp.theguardian.com/comment... -
typescript, I HATE you!
ME: Trying to extend Subject and override Subject.subscribe(PartialObserver<T>)
ME: export class MySubject<T> extends Subject<T> {
subscribe(obs?:PartialObserver<T>): Subscription {
return super.subscribe(obs);
}
}
ME: compile
TS: Compilation error! No such method to override!
ME: load the app -- ERROR
ME: recompile
TS: Compilation error! No such method to override!
ME: load the app -- works perfectly
:confusedjackie:
Make up your mind! So is that class compileable or not???
If not -- how the fuck does it work then???
If yes -- why the fuck do you yell in my face with all those errors???8 -
Whenever I see a website ask
1. Accept all cookies
2. Customize selection
I can see what they're really saying...
1. Accept! and I'll fuck off out of your way and let you read.
2. So you wanna read the content heh? Step into our office. Ok then, lets go through them one-by-one and you can explain to me why you think you don't need that cookie. and then MAYBE we'll fuck off our of your face so you can read the scant few lines of text standing between you and finishing your homework/job/whatever.18 -
Why the fuck these managers can’t understand that you can’t build a full blown system with in a week. After building a demo driven application to show the client you can tell the client we are fucking ready to launch the damn thing . I FUCKING MENTIONED BEFORE GOING TO THE MEETING ITS NOT RELEASE READY GOD DAMN IT.
Now when I say we can’t launch this app we need to fix things . THE FUCKING MANAGER HAS THE GUTS TO SAY “one day is enough to fix the issues right ? Shouldn’t be a big deal for you to fix this” .
Kill me now 🤬🤬🤬🤬🤬7 -
So, I've had a personal project going for a couple of years now. It's one of those "I think this could be the billion-dollar idea" things. But I suffer from the typical "it's not PERFECT, so let's start again!" mentality, and the "hmm, I'm not sure I like that technology choice, so let's start again!" mentality.
Or, at least, I DID until 3-4 months ago.
I made the decision that I was going to charge ahead with it even if I started having second thoughts along the way. But, at the same time, I made the decision that I was going to rely on as little external technology as possible. Simplicity was going to be the key guiding light and if I couldn't truly justify bringing a given technology into the mix, it'd stay out.
That means that when I built the front end, I would go with plain HTML/CSS/JS... you know, just like I did 20+ years ago... and when I built the back end, I'd minimize the libraries I used as much as possible (though I allowed myself a bit more flexibility on the back end because that seems to be where there's less issues generally). Similarly, any choice I made I wanted to have little to no additional tooling required.
So, given this is a webapp with a Node back-end, I had some decisions to make.
On the back end, I decided to go with Express. Previously, I had written all the server code myself from "first principles", so I effectively built my own version of Express in other words. And you know what? It worked fine! It wasn't particularly hard, the code wasn't especially bad, and it worked. So, I considered re-using that code from the previous iteration, but I ultimately decided that Express brings enough value - more specifically all the middleware available for it - to justify going with it. I also stuck with NeDB for my data storage needs since that was aces all along (though I did switch to nedb-promises instead of writing my own async/await wrapper around it as I had previously done).
What I DIDN'T do though is go with TypeScript. In previous versions, I had. And, hey, it worked fine. TS of course brings some value, but having to have a compile step in it goes against my "as little additional tooling as possible" mantra, and the value it brings I find to be dubious when there's just one developer. As it stands, my "tooling" amounts to a few very simple JS scripts run with NPM. It's very simple, and that was my big goal: simplicity.
On the front end, I of course had to choose a framework first. React is fine, Angular is horrid, Vue, Svelte, others are okay. But I didn't want to bother with any of that because I dislike the level of abstraction they bring. But I also didn't want to be building my own widget library. I've done that before and it takes a lot of time and effort to do it well. So, after looking at many different options, I settled on Webix. I'm a fan of that library because it has a JS-centric approach. There's no JSX-like intermediate format, no build step involved, it's just straight, simple JS, and it's powerful and looks pretty good. Perfect for my needs. For one specific capability I did allow myself to bring in AnimeJS and ThreeJS. That's it though, no other dependencies (well, at first, I was using Axios because it was comfortable, but I've since migrated to plain old fetch). And no Webpack, no bundling at all, in fact. I dynamically load resources, which effectively is code-splitting, and I have some NPM scripts to do minification for a production build, but otherwise the code that runs in the browser is what I actually wrote, unlike using a framework.
So, what's the point of this whole rant?
The point is that I've made more progress in these last few months than I did the previous several years, and the experience has been SO much better!
All the tools and dependencies we tend to use these days, by and large, I think get in the way. Oh, to be sure, they have their own benefits, I'm not denying that... but I'm not at all convinced those benefits outweighs the time lost configuring this tool or that, fixing breakages caused by dependency updates, dealing with obtuse errors spit out by code I didn't write, going from the code in the browser to the actual source code to get anywhere when debugging, parsing crappy documentation, and just generally having the project be so much more complex and difficult to reason about. It's cognitive overload.
I've been doing this professionaly for a LONG time, I've seen so many fads come and go. The one thing I think we've lost along the way is the idea that simplicity leads to the best outcomes, and simplicity doesn't automatically mean you write less code, doesn't mean you cede responsibility for various things to third parties. Those things aren't automatically bad, but they CAN be, and I think more than we realize. We get wrapped up in "what everyone else is doing", we don't stop to question the "best practices", we just blindly follow.
I'm done with that, and my project is better for it! -
mfw
> 1 year into project in React.js with a 10+ members in team
> PM panics over last Apache statement
> PM: "fuck, rewrite it in Angular 4 : /"1 -
I am scratching my head since 2 days cause a rather large Dockerfile doesn't work as expected.
CMD Execution just leads to "File not found".
Thanks, that's as useless as one ply toilet paper...
Whoever wrote the Dockerfile (not me…) should get an oscar...
Even in diarrhea after eating the good one day old extra hot china takeout from dubious sources I couldn't produce such a dumpster fire of bullshit.
The worst: The author thought layering helps - except it doesn't really, as it's a giant file with roughly 14 layers If I count correctly.
I just found out the problem...
The author thought it would be great to add the source files of the node project that should be built as a volume to docker... Which would work I guess....
Except that the author is a clueless chimp who thought at the same time seemingly that folder organization means to just pour everything into one folder....
Yeah. That fucker just shoved everything into one folder.
Yeeeeeesssssssss.
It looks like this:
source
docker-compose.mounts.yml
docker-compose.services.yml
docker-compose.yml
Dockerfile-development
Dockerfile-production
Dockerfile
several bash scripts
several TS / JS / config files
...
If you read the above.... Yes.
He went so far to copy the large Dockerfile 3 times to add development and production specific overrides.
I can only repeat what I said many times before: If you don't like doing stuff, ask for fucking help you moron.
-.-
*gooozfraba*
Anyways...
He directly mounts this source directory as a volume.
And then executes a shell script from this directory...
And before that shit was copied in the large gooozfraba Dockerfile into the volume.
Yeeeaaah.
We copy stuff inside the container, then we just mount on start the whole folder and overwrite the copied stuff.
*rolls eyes* which is completely obvious in this pit latrine of YML fuckery called Dockerfile.
As soon as I moved the start script outside the folder and don't have it running inside the folder that is mounted via volume, everything works.
Yeah.... Maybe one should seperate deployment from source files, runtime related stuff from build stuff.
*rolls eyes*
I really hate Docker sometimes. This is stuff that breaks easily for reasons, but you cannot see it unless you really grind your teeth and start manually tracing and debugging what the frigging fuck the maniac called author produced.1 -
Just gonna leave this here because I am too lazy to write a proper article for my website:
If anyone is trying to create a Vue.js website with Node.js backend do NOT use express-vue, it is unnecessarily complicated and broken. Instead use this method I found.
You will need:
- IntelliJ IDEA / WebStorm / other IDE supporting multiple modules per project and tasks
- Nodejs and npm
- vue-cli
Step by step:
1. Create new empty project
2. Add your frontend module using vue-cli generator
3. Add your backend module using Express generator
4. Run npm build in your frontend module once
5. Move or remove public folder in your backend module
6. Create a symlink from your backend module root called public pointing to dist folder in your frontend module root
7. Make sure to add "Run npm build" from frontend module to your "bin/www" task (default task for Express module)
8. Enjoy developing your REST API in Node/Express and your frontend in Vue.js with single-file components and it being served by the same server that is providing the backend.
(Since they are separate modules and you are not mixing webpack and Node/Express you can add ts-loader, stylus-loader, pug-loader or any other loaders without screwing anything up)
For deployment you just need to copy the contents of dist into public on the server. (and not upload the symlink)6 -
I admit i don't like JavaScript... not one bit and mainly because it is not strongly typed. The idea of Typescript is interesting.
Anyways, i decided to jump in and learn Angular... So do you guys have any advice for me?10 -
I heard Google has prepared an AI for solving competitive programming questions by training models based on problems and solutions from GitHub.
*devil smile*...on my way to flood GitHub with wrong solutions. Ciao!6 -
What do you think about swift?
Does it have future?
It went open-source and is very fast and easy.
I found this project which brings swift to the server side in linux and mac: https://www.perfect.org/ and it seems promising.10 -
Here I am for three months trying to implement TypeScript in this project that was a dump when I picked it up.
And then some morons get assigned to the project and just start adding @ts-nocheck everywhere?
Like, WHAT THE ACTUAL FUCK?
And then you wonder why the project is bug-ridden??
FUCK THESE PEOPLE THAT CALL THEMSELVES JAVASCRIPT ENGINEERS!! NO WONDER JS GETS SUCH BAD PRESS WITH ALL THESE CLUELESS IDIOTS TO WHOM STATIC TYPING IS JUST AN OBSTACLE TO THEM CHURNING OUT LINE AFTER LINE OF "CODE"3 -
Working continuously on a task for like 3 hrs, cant get it done
*goes out, mind refreshed and completes the same task in 5 mins*1 -
Ah, when you run into a bug that only has 7 google results, and have of them is in Russian for some reason. Gonna be a long day.5
-
One thing JS does great is that everything from the server to the gui to the (extremely flexible) build system is 100% platform independent with very few platform specific bugs. And that's a big deal when a basic setup is 1200 packages from 650+ semi-coordinated people.13
-
I made a huge mistake
I got "in the zone", I was coding so nice and fast and everything was working, so I didn't want to commit every single minute and then have to go back, cherrypick commits squash them revert them etc.
So I didn't commit anything at all... Now if I were to commit the commit would modify 2 files, create 26 new files and delete 2 files.
The changes include moving from JS to TS, implementing a desearialization scheme, implementing a server class and wrapper client classes, with common type interfaces for different requests...
So now I need to save my changes somewhere, go back to the last commit and slowly incorporate the changes.
I'm dumb9 -
I knew AngularJS, just learnt Angular. Realized what typescript is and how amazing it is. I am a .Net guy so creating lambda functions in typescript made me excited lol. It's a little frustrating to write "imports" in every TS file though. Can now add ✔️Angular and ✔️typescript to my resume 😉. Starting with Vue.JS as soon as I am done playing with Angular.2
-
This is the kind of shit that I don't want to write.
The kind of shit that should be in an STL so I never have to include it in a project.
Because it doesn't belong in a project.
And it doesn't belong in a dependency tree either.
It belongs in a language. -
Being a front end developer and working in a team of motivated "full stack" developers sucks big time.
So, recently joined this new company with a very small project which just started, basically a cloud version of a really old desktop app. Few people from the team completely from the asp dotnet background decided the architecture few months before I joined in.
So, they did it something like this -
- mono repo dotnet project with VueJs app served within it (because that would be maintainable 😑)
- vue app served by pointing the built files through dotnet index file (simply because they didn't care about the gift to the front end world which is webpack or even had any knowledge about it 😑)
- added typescript because, u know it's cool 😑, without even knowing that they don't possess that team which know how to write the types (f***ers write classes for every payload object coz they don't know what interfaces are)
- no loader to load typescript, they are running tsc in watch mode and we have .js and .js.map for every .ts file in our project which some teammates are even pushing to repo
Recently, I added eslint with git hooks to the project so that everyone will at least stick to the coding standards. Now, to avoid the errors they are bypassing the git hooks by uninstalling the library and then installing it after the commit😂😂
Then we have a girl who uses document.getElementById to programmatically change styles in a Vue project😑😑😑😂
Then we have dotnet people using dotnet coding conventions all over the front end app.
People, how do I deal with these so called "full stack" people?12 -
**Sees a different error after hours of debugging the previous one**
ME (crying inside) - What type of sorcery is this?3 -
Dear TypeScript, could you not have chosen any other extensions rather than .TS? Apparently telesync have been using .TS for IDK may be decades. But all you could go with was .TS?
Now Windows Explorer keeps on thinking .TS is a telesync file thus it keeps on trying to load a thumbnail for the files whenever a folder with .TS files are opened.9 -
When you know your product sucks and even you won't support it. Too bad for those two windows phone users left in the world.
Working on a Project. Forced to use xaml I hate xaml. C# is so much more efficient/ easier. Now at least I have an excuse
. 😤3 -
Yo dawg, I heard you like asynchronous JavaScript, so I put a promise in your promise so you can promise while you promise6
-
Me: not even using typescript (even disabled everywhere), living a happy life.......
VS Code: TS ERROR....TS ERROR... TS HINT....
Well, fuck you too Microsoft.1 -
when TS does its job and team mates complaining that TS is too sensitive!
it does its job you douche, now you do yours!4 -
Google suggested me some article about how to preorder iPhone 8 and 8 plus.
To all devs who want to know my trick:
just buy second hand iPhone 7 or 7 plus and say it’s iPhone 8.
This is written by an iPhone 7 plus user and I suggest you if you want good look and functionality - buy OnePlus 5.2 -
RAAAAAAH fuck fuck fucking shit!!! Fuck jest Typescript "on the fly" compilation esModuleInterop typeroots, missing definitions jest ts-ignore and xtest everywhere, manual npm linking with different pkg mgrs & pub to a private registry, building docker images locally and doing tag management across git, docker & kubernetes then cross fingers that prod which has 0 common setup with local & test somehow works, open architecture "tickets" and wait months before they resolve, then repeat ad infinitum. How the fuck can I be productive when I need to be all over the place all the time and deal with these meta-code shenanigans. I just wanna code, damned3
-
*use windows, ms office, vsc, skype probably code in ts, ... *
*rant about microsoft buying github*
I'm not a microsoft fan either, but thats the sad truth.1 -
God, so tilted right now, after having to "urgently" (joke's on them, they will get charged the urgent rate) check why some deployments weren't working due to some npm dependencies not being found.
(Just from mentioning npm you surely think I'm gonna bash JS, but no!)
I'm tilted by TS devs that don't bother to learn the very basics of git pathspecs and just add "dist" to their .gitignore, not knowing that it's gonna exclude any file or directory named "dist" *ANYWHERE* in the project.
And when your poor CI pipeline tries to transfer the build artifacts (so, keeping the .gitignore excludes but manually including node_modules and dist), it excludes the dist dir in some packages and wrecks the deployment.
Please,, please, PLEASE.
if you want to:
A) Make your entry relative to the .gitignore...
Put a slash first.
B) make it only match directories and not files...
Put a slash last.4 -
For all the cheap-ass sys admins:
I wouldn’t pay 100$ a year to apple just to have push notifications when my server fucks up or an user fill my support form but I want to know that in real time but I have iPhone(forget about FCM).
So I downloaded pushbullet to my phone and integrated its API in my server and when something important happen I get completely free notification which (thanks to url schemes in ios) redirect me to my server administration app.
Note: I used xamarin for my management app to be ready for the moment when I switch back to android.2 -
Can we please stop making everything in javascript? Pretty please?
Like, I get it, js makes it easier to find developers and speeds up development, but writing a compiler to run on node? That doesn't make any sense to me. Typescript is taking ~11s to compile a medium-sized project, out of which ~9s are just type-checking (if I disable type-checking it takes ~2s to compile). Even Rust, which is considered to have a slow compiler (because of the borrow checker I assume) takes less time to compile a project of roughly the same size.
This is getting very irritating. If I want to keep type-checking, every single time I make a change on a single file I have to wait 11s before any tests start running. This was heavily affecting my productivity (and sanity), so I decided to disable type-checking and threw out the window 90% of Typescript's advantages.
Why the hell wasn't typescript written in an actually performant language? Just so you could say that typescript is written in itself? I don't get it, I really don't.14 -
So I do not get why people use ReactJS. I hate it. for 3 years passionately. And I have to work with it every day.
- one-way data binding
this makes you write twice as much code, which will have twice as much bugs, you need to read through twice as much code from other devs.
- mixing html and JS
after all I like to pour my coffee on my omlette so I can eat and drink at the same time in the morning. This kills productivity and ugly AF
- not unified
Every dev uses their own special snowflake framework with React there is no unified way of doing things and you cannot use your familiar tools. Every project you need to start over from zero.
- Bugs bugs bugs
infinite loops, max update depth reached, key not present on list element. Let me ask you something dear ReactJS. If you know that there should be a unique key on that element. Why cannot you just put it there and shut the f up?
- works reeaally slow when compiled with TS
ReactJS was never designed to work with TS and now the tools for it are really slow. And why TS? Explicit contract is always better than an implicit contract. TS helps you in coding time, but for some reason React devs decided to worth 3 seconds to wait for compile and then realize you mad an error. ReactJS is bad and inefficient so stop making projects with it please.9 -
wow... the regular react community sucks...
where with react-native 3rd party libraries/components have very clear and detailed docs, the normal react libs out there are like:
20K starred component
"here is a .txt file with some props, TS? yea we use it, but everything is just set to ?: any"
quite the shame :/3 -
I totally forgot how bad working with JavaScript is. After like a year of working with properly typed TypeScript base where navigation and documentation works very well, now I am in a world where IDE (IntelliJ IDEA) does very little, essentially it's just now a stupid editor. After few days I miss TypeScript already.
-
Even seniors make mistakes. In case you were ever doubting yourself - just remember that.
I just had a very senior level programmer on my staff add a function to a production system that issues an SQL UPDATE query without a WHERE clause. Fortunately, only the 1st entry succeeded and the rest failed due to "duplicate record" errors. Clearly he had intended to do a SELECT to check if an entry was present. If it was present, do an UPDATE, otherwise do an INSERT (think UPSERT - but done manually). However instead in the insert part they were both UPDATE's. The first update was normal looking but the second UPDATE was just this weird malformed-looking thing where he tried to do an UPDATE but to every field including the key fields. Clearly he was thinking about an insert but actually writing it as an update. Every now and then I need to remind myself that these things happen. The guy's not dumb - just made a mistake.
I'm just happy it "failed unsuccessfully".4 -
Dear everyone,
Stop turning off the monitors. That doesn't sign you out or turn off the computer, it just makes the next person wonder what's taking so long.1 -
Is it just me or has Windows SDK gone down hill horribly in recent times
WPF -> UWP was a giant and good step
then they kinda killed off UWP, focused on XAML Islands
then came Windows 11 which breaks some UWPs built with WinUI2 coz the components are tied to the OS and not self-contained, so some dont exist in Win11 and the apps crash on runtime
Now there's WinUI3 but it assumes that the starting point is Windows 11, I try to build em on Win10 (coz win11 sucks ass), and intellisense it all crazy
These are all issues one can circumvent IF they align their setups the way MSFT desires
But the fact that these issues exist and wont work out of the box, makes me wonder how long before they start recommending Electron or some other "JS/TS-based UI framework" that'll work within ChakraCore or something. Getting back to WPF/Win32 days5 -
Do you need a degree to become a software engineer ?
Now this is a question I’ve seen many people ask. I personally have no degree and I’ve been doing programming for the past 10 years (since I was 18 ). Whatever I learned, I learned from reading and watching tutorials.
So far It wasn’t a problem for me.
What do u guys think and what is your experience is this matter ?9 -
Fuck ES/TS 😐
Been trying for hours now to get ionic 2 to work with either generators or async functions. Doesn't work because async for ES 5 is only supported with TS 2.1 which breaks the angular compiler. Also can't use generators (not supported for es5 at all by TS).
Also can't really change the ionic build process to just take es6 output instead of es5 and transpile because it's a convoluted mess in a separate node module instead of just a gulp file like with ionic 1.x.
Why is the JS ecosystem such a fucking mess?3 -
If you're reviewing someone's code, do you run/test the code before reviewing the logic? Or do you review logic before running the code?4
-
I'm still using .then().catch() instead of the async await.
So, first of all, Fuck you for calling it a STANDARD now. its nowhere near to be called standard. You wanna get some data from an API? Wanna call it using axios or fetch? What if the server is down? what if there's an error that you don't even know existed? Where do I get that kinda error in async await? try-catch? no thanks :| I'm good -_-8 -
!rant
Got my new pc up and running, asrock x370 killer sli/ac mobo, ryzen 2200g cpu and radeon rx550 with 12g ram (don't ask). Nothing fancy but sure beats my old am2 system! New pc is so quiet :D9 -
What's the best nodejs framework for the MEAN stack? I need to do additional things to put TypeScript in node js and express. I have seen nestjs with a good directory structure and also uses TS by default. How about meteor or Koa?
Should I just add TS to my existing node and express? Or use nestjs or some other nodejs framework. What do you suggest?3 -
The day I realised There is an AngularJS before Angular 2
In our t ch stack, we have multiple components, most of them are backend, but 2 of them are fronnt end.
The first one is a straight Angular 4 application, and it has the normal angular structure, a ts file, a css file, a js file.
The other component, has a very weird structure I don't understand to this day.
It has a mix of js and html files, sometimes one inside another.
The js file has some "angular.core.shit" and I thought it should be Angular, but nothing in it resembles any angular project.
After much confusion, I finally came across an AngularJS website which is supposed to be deprecated last year.
Then I came to know of the story of Google taking ove rAngular and releasing Angular 2.1 -
Working on FCM today and actually this is not rant. 😃 🎉
Google documented everything correctly and everything is understandable. -
So ok, today was a crazy day.
New sprint, new ticket.
Work on the bug tickets first he said ….
Sure can. Oh had I just known that this very first innocent looking ticket is the way to coder‘s hell ….
‚Access of undefined‘ it said. Easy to fix, I thought.
Until I found the very same code twenty-fucking-two times over about 50 files!
Who would guess that exportSingleOperatorBooking, exportSeveralOperatorBookings, exportAllOperatorBookings (… and more) could in practically be the same? Nah, they all use different interfaces.
Oh wait, the alias type of the extended sub-interface of file misc.ts is the same logical content as a differently named interface below another different interface with the same content as in another ts file?
Wait that can‘t be. Riiiiight?? 😳
8h later I have barely scratched the surface of refactoring this shitshow of a project.
But no, I refuse to put the same error handling multiple times in different places.
I could have been done already. I could have saved my soul, my sanity. But I will be brave and strong to save the innocent developer that will cometh after me. For I shall be rewardeth for my sacrifice.
Amen.8 -
I just want to use Jest to unit test my Typescript classes, but that appears to be impossible!
Testing the compiled Javascript instead doesn't seem to recognize any classname at all :( -
Started using typescript and other than the toxic wasteland that is NPM, I'm actually quite enjoying my time. Fuck javascript in the ass, typescript is like a nice dick pic to that ex who called to threaten your life for the third time that day. Different phone numbers every time too. Fuck JS.2
-
idk why, but why focus so much on internal stuff that never will be public...this is also my favorite quote1
-
Typescript is like a condom that has sideways with passages to flow the stuff ! Which is basically a bloody condom with hole ! WTF 😑 .ts to .js !
You just want whole bloody damn Java to be implemented at client side ..😣 God bless us .. Hate u Angular ... I loved you like hell now u hokkin up with this hoe ...
Hail JavaScript !2 -
For learning purposes, I made a minimal TensorFlow.js re-implementation of Karpathy’s minGPT (Generative Pre-trained Transformer). One nice side effect of having the 300-lines-of-code model in a .ts file is that you can train it on a GPU in the browser.
https://github.com/trekhleb/...
The Python and Pytorch version still seems much more elegant and easy to read though...6 -
Hello devs. This happens to be my first rant. And I got a question to start off.
I'm looking for an existing public/open-source React project which is not too hard to understand and has a good folder/file structure and code structure. Something that gives me an idea of how a good production level code and project should be.
Any recommendation is appreciated. Can be your own project too.
Thank you 😊.10 -
Question: We are planning to transition our old ES5 codebase to modern ES6/ES7 and even typescript.
What would be the build tool you would recommend if we want to start supporting ES6/ES7 and even Typescript?
Webpack, Vite some other?
This is a vanilla Javascript Project with large codebase it's been built using custom build tools like UglifyJS and UglifyCSS and of after lots of begging it finally got the green light to move to a more modern build tool and start supporting a more standard JavaScript Features.
Mainly I want to move to TypeScript but transition would be slow so the build tool would need to support .ts and .js as well, that is traspile both the .ts and .js into one final production build.
What build tool would you recommend for that?8 -
CAN 👏 PEOPLE 👏 STOP 👏 ADDING 👏 `/// <reference lib="dom">` 👏 TO 👏 NODE.JS 👏 PACKAGES
It's a Node.JS package, for fuck's sake. But for SOME reason, sometimes to get around the lack of `URL` and `URLSearchParams` in @types/node, people keep including the *entire* DOM typings in their definition files/TypeScript files!
Sometimes I upgrade my deps in a Node.JS project and find that DOM typings have been added, causing errors when trying to use the global `URL`/`URLSearchParams` (I've shimmed these so that these (Node.JS versions) are in the global namespace). Then you have to search in all your dependencies for which one is including the DOM definitions.1 -
I think my TeamSpeak got a few bugs.😂😂 And for everyone who is calculating, it counts on the 1.1.19702
-
Opened up my laptop to install faster wifi card with macOS support and it turns out that I have m.2 type connection ready for ssd.
These fucking idiots in Toshiba have never said anywhere in this laptop’s specs that it supports m.2.
I bought 128gb ssd and installed it.
Fast af boie and no problems booting from it.2 -
How do you feel about using TypeScript with React? I appreciate the benefits, but, as every snippet of React code everywhere on the web is vanilla JS,I just don't want the cognitive overhead.
Yes, I know TS is JS, but, if I'm not going to use the features, why bother? I'd want to strongly type props, state, etc.
What's the status of TypeScript support in the React ecosystem (eg Router, MUI, etc.)?
I'm kinda hoping Reason will get some traction as the type inference is much better, but, will that happen? Or is that going to fizzle so it's a choice between TS and JS?
Appreciate any thoughts on this---including those from anyone who's in the same boat.
Looking for views on TS in React ecosystem---no need to sell me on TS in general.6 -
Typescript is a PIECE OF SHIT that adds 3 problems for every 1 it solves! Messing with so much shit from its linter and builder just so some OOP fools can code JS like *TAB* *TAB* *TAB* again!12
-
Part of the PR feedback was the use of capitals and the conventions. I tried to look up some backup documentation of angular in the styleguide regarding this topic. Didnt find any.
His answer was that it’s a C# convention. DUDE IM NOT PROGRAMMING IN C# AM I ?! You are mixing up conventions between ts, js, ng and now C# how the fuck am i ever going to follow this?!1 -
Iwas exposed to the world of computers when Iwas 6 years old. My dad bought a used C64 and me and my sisters were allowed to play some times. Later my father bought a PC with incredible 166MHz and I was allowed to play on it some times too. Started with tomb raider and when my parents weren't home Delta Force One. Later my father bought a newer model with 450 MHz and I got the old one. At this time he bought a 20GB HDD for me so I can get some more games on my computer. Then the internet came. My father booked ISDN and it was super fast. Since then I loved the world of IT and never stopped to. Later I played around 20000h of Counterstrike Source and came in contact with web development. I started to program with my first love: Java.
Now I love ruby, ts (js), Delphi and sometimes c#
next up is Clojure -
I recently went through a very detailed and well-explained Python-based project/lesson by Karpathy which is called micrograd. This is a tiny scalar-valued autograd engine and a neural net on top of it.
The project above is, as expected, built on Python. For learning purposes, I wanted to see how such a network may be implemented in TypeScript and came up with a 🤖 micrograd-ts - https://github.com/trekhleb/... repository (and also with a demo - https://trekhleb.dev/micrograd-ts/ of how the network may be trained).
Trying to build anything on your own very often gives you a much better understanding of a topic. So, this was a good exercise, especially taking into account that the whole code is just ~200 lines of TS code with no external dependencies.
The micrograd-ts repository might be useful for those who want to get a basic understanding of how neural networks work, using a TypeScript environment for experimentation.
With that being said, let me give you some more information about the project.
## Project structure
- [micrograd/](https://github.com/trekhleb/...) — this folder is the core/purpose of the repo
- [engine.ts](https://github.com/trekhleb/...) — the scalar `Value` class that supports basic math operations like `add`, `sub`, `div`, `mul`, `pow`, `exp`, `tanh` and has a `backward()` method that calculates a derivative of the expression, which is required for back-propagation flow.
- [nn.ts](https://github.com/trekhleb/...) — the `Neuron`, `Layer`, and `MLP` (multi-layer perceptron) classes that implement a neural network on top of the differentiable scalar `Values`.
- [demo/](https://github.com/trekhleb/...) - demo React application to experiment with the micrograd code
- [src/demos/](https://github.com/trekhleb/...) - several playgrounds where you can experiment with the `Neuron`, `Layer`, and `MLP` classes.
Demo (online)
---------------------
To see the online demo/playground, check the following link:
🔗 https://trekhleb.dev/micrograd-ts3 -
1. When someone Buzzes you on Jabber and wants you to join TS
2. Mum says it's dinner.
3. My little brother. -
Just when I thought js/ts is a mess with its npm, I ran into GO
$ xk6 build --with gitlab.com/<...>
smth wrong with module name
*fixes module name*
$ git push
$ xk6 build --with gitlab.com/<...>
smth wrong with module name
*go pulls initial commit instead of the last one*
$ go clean [or wtv it's called]
$ xk6 build --with gitlab.com/<...>
smth wrong with module name
*go pulls initial commit instead of the last one*
$ cd /tmp
$ xk6 build --with gitlab.com/<...>
OK
oh well... I guess this is how it's gonna be6 -
Setting up ts linting is a pain in the ass..
Until you realize you could try to reload the window. So your settings actually pick up you know.. -
Anybody else really annoyed at all these people getting mad at zuckerburg? Like, I've always questioned privacy of the internet in general. If you're dumb enough to put sensitive info on the internet (especially on social media) then you shouldn't have the right to complain about privacy. It's your responsibility to protect your information.3
-
Anyone know how to go about unit testing an application that is made up of:
- Electron
- Node
- React
- Typescript
(React using Typescript of course).
Electron has its own framework (Spectron), people seem to use Mocha with Node, React has its own tools like React testing library (and testing UI components will probably end me) and Typescript seems to play best with Jest - but a special Typescript flavour of Jest called ts-jest is preferable because the only other option is having Babel and its Typescript support that doesn't type check.
I want to beg for the sweet release of death.4 -
Switched to LG G5 from iPhone 7 Plus.
Lg's screen has burn in and took me about 10 hours to completely fuck it up, restore it, flash crDroid(Lineage os based, the only custom rom working fine so far) and workaround the faulty wifi chip giving null mac address by faking it.
Still love my new(old) phone more than the iPhone.2 -
Well, I love react-native and how easy to build mobile app with it. but damn look at these folder sizes jeez1
-
FUCK FLUTTER!!!
Who the hell wants to learn to program in dart, would rather learn php than learn an inutill, and complicated language that only works under Google frameworks. Also, a flutter app weighs twice as much as a app native and closes all the time. I hate Flutter and its community
#ReactNativeLover6 -
So `aws-sdk@^2` happens to include an ancient polyfill `url@0.10.3` which breaks webpack, specifically fork-ts-checker-webpack-plugin, causing it to warn about the inexistence of class "URL".
And this is the default included package for AWS Lambda node.js runtime.
wow, just wow.1 -
I want to start with Web development and for that I want to code a dashboard for finances with a connection to an Restful API.
I know HTML, CSS, TS and some JS. But I don't know which framework to use.
The framework should:
- have an easy way to separate HTML from JS or TS code.
- easy way to break down a single page into different html files.
- not have to use npm or Node.JS. Preffered is a CDN solution.
- HTML Templating
Maybe also tutorials on how to setup the coding enviroment.8 -
WHO THE FUCK THINKS
THIS SHIT
TS:
```
const a = function(callback: (err:any,data:string) => void):void{
callback(null,'balls');
}
a(function(err:any,data:string){
console.log(err,data)
})
```
IS BETTER THAN THIS
ES6:
```
const a = function(callback){
callback(null,'balls');
}
a(function(err,data){
console.log(err,data)
})
```
kys10 -
When something worked perfectly yesterday and now it’s just fucked up without touching anything:
Cause today
That was yesterday
Yesterday is over
It's a different day
(Love The Way You Lie - Eminem)1 -
So sick of my coworker explaining to me how I should do a task. Dude, I've already planned out how I'm going to handle the situation. If you really want to help, wait until I create my pull request, review it, and then make your suggestions there. Unless I ask for your advice on how to do something, I don't need you to tell me how you would do things, especially since i have, what, 5 years working in the framework when you have 2 months?
-
Inherited a massive code base today... All JS is still being accessed via global scope... what are modules & modular design even... SOLID and DRY are things that clearly never crossed the devs mind during inception of this beast... and to top it all off all there is a weird BEM / SCSS style going on that somehow manages to confuse the IDE... thus all style helper utilities in the IDE are useless...2
-
I am going to start a random stuff from dev life diary just for your annoyance… cause I’m bored (and kind of want to see how long I can be bothered to keep shit like this going)
So, work day 1 for 2022. Wrote TS and YAML. Yay, IaC is fun. Also, no one has bothered me with dms or calls or any such shite today, which is the way I like it. Leave me be, mofos!
Should still bother to prepare all the shit for tomorrow’s PoC spec planning workshop… what a chore. Couldn’t be bothered, I’d much rather someone else did the specs and I could skip to design and implementation. But I guess this is yet another context where I have to do it all myself. Woo hoo…2 -
My First ever VSCode extension is live.
https://marketplace.visualstudio.com/...
A symbols tree view provider that supports PHP/TS/JS only (for now). Any suggestions/recommendations are welcomed !!!
Boy, does it feel good to feel like a real developer again 😎8 -
When my mom asked what would I like to have - sweet corn or Avacado.
I said - Let's document all the possible approaches and setup some time to discuss pros and cons.2 -
A Yahtzee game.
In fewer lines than my first try in 2010.
Fyi... It was like only 15 thousands line with if else statements .... Nuthin much.1 -
Ever since I started learning about React with Typescript my respect for design patterns that restrict how state can change has grown massively. On the web, nothing happens when you say it should happen; everything always takes a while to execute and there is always a transactional period between validating an action with client-side state and receiving the result from the server, and if you want to account for that everything becomes infinitely more complex and you eventually end up with mutexes.5
-
It's probably no news that I love Typescript's versatile and powerful generics. Today I found what is probably the most brilliant use of these tools to solve a real problem. This package exports one generic type which takes one generic argument, reads it like a JSON schema and returns the Typescript type for it:
https://github.com/YuJianrong/...7 -
I look at the "Discover Repositories" sidebar every time I log into github. I've found some really cool stuff that way.
But I'm really confused as to why I keep getting typescript-related repositories there.
I've never created a ts repository
I've never made a pull request that had ts in it.
I've never created an issue in any ts repositories.
I've never even written a single line of ts.
The only reason I can think of is that I was browsing the official typescript language wiki for a few minutes...
A COUPLE WEEKS AGO
Yet sometimes, all 3 repos in the side bar have typescript in the title.
TL;DR: github, please stop pushing typescript on me.2 -
Fuck google's link hijacking!
If you don't like it, go into devtools and type:
rwt = null;
-- You're welcome.7 -
Sharing is caring, and continuing the streak, I have 3 invites to enki with the code: ASABE108
Enjoy :)4 -
Does anyone have a good 'getting started documentation' for react redux with typescript. youtube videos and official documentation are mostly ES5.4
-
Probably no news about the PWA today, but this:
https://github.com/dr010001111/...
Tell me what you think.7 -
So maybe stack overflow is better for this...but it's kind of ranty too so here goes.
Any react + typescript devs here? Cause I did something dumb. I ejected the project because I needed to build a custom express implementation...long story short, I can't run a webpack react dev server or use hot reload. Which is a PAIN! If I wanted to wait for a full TS and react static recompile after changing a css prop....I wouldn't be in the web game!!
Has anyone else had this and fixed it??1 -
So typescript 4.5 beta is out .... holy moly what did those guys smoke? 🧐🤨🤪
They keep adding stuff on top, that nobody needs. But they don't fix the stuff that is broken (like emitting broken prefix-paths ...🤦)
Imho, they should focus on the overall development experience, make it easy an consistent to setup a proper multi-module project with linter, auto-formatter, folder structure, file naming.
And please fix this ugly #private fields - just ignore this mess of a spec and emit TS private fields as #private fields. That's the only logical way. Everything else is BS.8 -
Am i the only one who thinks TypeScript is not necessary, more some kind of overhead creation?
Whats your opinion about TS? Do you use it or just "good" old plain JavaScript?5 -
Good Lord!
FP looks nice, feels right, scratches the itch when written well, but supporting, debugging and fixing/extending it is a fucking hell!
Well, it's either FP or TS/Node.4 -
Can anyone suggest a good TS based stack to use with electron? I'm (hopefully) looking to make an open source app3
-
Remember how I was - against all that was promised - assigned to a time-sensitive front-end (so definitely not my forté) project about a month ago? Remember how I struggled with the choices of how to go about it - switching from F# (Fable) to Rust (Yew) to eventually settling in with Vue and TS?
Yeah, I’m glad I went that way, even though there could’ve probably been better choices out there: my part is done now, even though it’s not quite prod ready yet (close tho), the team who’ll maintain it takes it over now, after I finish dealing with my current minor issue. And damn their front-end guy is GOOD. Makes me feel very inferior in that department. Well, I am. Back to back-end, thank you very much...
But I have an issue here, that bothers me. I’ve produced a codebase that’s obviously written on a tight schedule: no tests, no documentation, a few embarrassing hacks/workarounds and so forth. I actually feel bad for leaving it out of my hands to them in such a state...1 -
On page 19 of the ethereum yellow paper: http://gavwood.com/paper.pdf it defines the address of a wallet as: A(pr) = Β[96...255](KEC(ECDSAPUBKEY(Pr))), which is the right most 160-bits of the Keccak hash of the public key generated by the private key.
If I expose the public key to the network, do I allow people to impersonate me and sign transactions even though they don't have Tr, Ts, or Tw? My understanding is no, that without those values you can't hash the transaction.
Subsequently, this leads me to wonder if the purpose of the address (besides identifying users) to obscure the public key so that the private key is at a less risk of being reversed? Or can the public key of any address be captured?
If the public key of any address can be identified on the network or off network (without actually being the owner of that key), how do you do that? Are there any resources on how to perform this that are computationally easy?1 -
C++ or Python for coding interviews?
I used to do a lot of developments in Python and JS/TS. But now I have been doing a lot of back-end stuff in Golang at work (1+ year) and C++ for some of my side projects. So when I started grinding leetcode, I used C++ all the way.
Today this question struck me and I keep thinking if I should continue with C++ or use Python, which will help me focus more on the question than the language.5 -
I wanted to show our DBA an example of a web api using .net core 3 in regards of how easy it is to create such things. The reason? he has been wanting to get back into programming after many years of just sticking to dba related stuff. The dude has talent and brains, he had worked years ago as a delphi dev and a vb6 dev and we had the same employer at one point, none of this man's apps have been faced out on account of how complete they are and easy to maintain for other devs was after he left. Regardless of the ancient tech stacl, the man shows ample promise and well.
Thing is, the apps I make on the Microsoft stack usually tend to C#, and my frontends are using TS, so I am more on the curlt bracket side of things and he said he was to convert my app(very basic crud example, but with auth, authorization and everything in between to plug into the frontend) to VB.NET. I thought it wouldn't be that much of a problem but apparently microsoft does not hold templates for webapi for vb.net
I thought it was shitty. VB gave Microsoft a lot of developer market back in the VB6 days, and even though I really love c# I see no reason why they would just say fuck you like that to vb.net. Shit still polls pretty high in terms of dev popularity and you can apply the same design ideas to VB without much effort.
I just think this is very shitty from Microsoft's part. Much like how Apple is forcing people to adapt to Swift when there is a huge amount of obj c out there.
I dislike when companies shift focus on tech stacks like that.2 -
I feel dirty for putting an empty .ts file just so VSCode would stop complaining about my tsconfig file that I created so Vetur would stop complaining about not having one. I didn't need any of that.6
-
My mom was a media designer and as a kid I liked watching her doing stuff with CorelDRAW. And as soon as she played Sims in the evenings I really wanted to learn how to make a window and stuff in it happen.
So I started learning C, because my stepdad had a book laying around. (He did not know how to code by the way, now I'm asking myself why we even had this book)
But never got further than a few console applictions asking for input, messing with it and printing something.
Later I got into HTML/CSS/JavaScript (in that order over a course of a good 3 years or so) because I wanted to do stuff people can see and easily reach (an exe wasn't the nicest way of showing people something imo)
And that's when I totally fell in love with JS and it never stopped from then.:D
I did a few excurses to C++, Java, VB, C#, such kinda stuff and learned many many things about how stuff actually works. C being my very first language immensely helped with that.
I'm also trying some game development, as this was one of the main reasons I started coding, but I'm not creative enough and do it less and less.
Nowadays I do HTML, CSS, JS, TS and PHP for a living and I love it.:D1 -
pip kept screwing me up with permission issues in /usr/local etc. Changed permissions for respective python folders, still got pip permission errors,did a chgrp - R user /usr.
Sudo gone
Have to reinstall :/4 -
A year ago I built my first todo, not from a tutorial, but using basic libraries and nw.js, and doing basic dom manipulations.
It had drag n drop, icons, and basic saving and loading. And I was satisfied.
Since then I've been working odd jobs.
And today I've decided to stretch out a bit, and build a basic airtable clone, because I think I can.
And also because I hate anything without an offline option.
First thing I realized was I wasn't about to duplicate all the features of a spreadsheet from scratch. I'd need a base to work from.
I spent about an hour looking.
Core features needed would be trivial serialization or saving/loading.
Proper event support for when a cell, row, or column changed, or was selected. Necessary for triggering validation and serialization/saving.
Custom column types.
Embedding html in cells.
Reorderable columns
Optional but nice to have:
Changeable column width and row height.
Drag and drop on rows and columns.
Right click menu support out of the box.
After that hour I had a few I wanted to test.
And started looking at frameworks to support the SPA aspects.
Both mithril and riot have minimal router support. But theres also a ton of other leightweight frameworks and libraries worthy of prototyping in, solid, marko, svelte, etc.
I didn't want to futz with lots of overhead, babeling/gulping/grunting/webpacking or any complex configuration-over-convention.
Didn't care for dom vs shadow dom. Its a prototype not a startup.
And I didn't care to do it the "right way". Learning curve here was antithesis to experimenting. I was trying to get away from plugin, configuration-over-convention, astronaut architecture, monolithic frameworks, the works.
Could I import the library without five dozen dependancies and learning four different tools before getting to hello world?
"But if you know IJK then its quick to get started!", except I don't, so it won't. I didn't want that.
Could I get cheap component-oriented designs?
Was I managing complex state embedded in a monolith that took over the entire layout and conventions of my code, like the world balanced on the back of a turtle?
Did it obscure the dom and state, and the standard way of doing things or *compliment* those?
As for validation, theres a number of vanilla libraries, one of which treats validation similar to unit testing, which seems kinda novel.
For presentation and backend I could do NW.JS, which would remove some of the complications, by putting everything in one script. Or if I wanted to make it a web backend, and avoid writing it in something that ran like a potato strapped to a nuclear rocket (visual studio), I could skip TS and go with python and quart, an async variation of flask.
This has the advantage that using something thats *not* JS, namely python, for interacting with a proper database, and would allow self-hosting or putting it online so people can share data and access in real time with others.
And because I'm horrible, and do things the wrong way for convenience, I could use tailwind.
Because it pisses people off.
How easy (or hard) would it be to recreate a basic functional clone of the core of airtable?
I don't know, but I have feeling I'm going to find out!1 -
Got the new Android 10 update last night. cool dark theme for OS now and changes apps to dark theme if available. :)1
-
*Triggers OAuth request through browser
Returns : success and valid tokens.
*Another project triggers the same process and code.
Returns : well shit nigga, I know I use the same logic as above but fuck you. -
Don't you just hate it when there seems to be nothing but in some ways lacking solutions to a definite task in your capability arsenal? Or rather, I don't really know how I should feel about it... I've been developing this solution to receive a 3DES encrypted Azure Service Bus message, decrypting it and chewing the output XML down so as to be digestible to the PHP application whose API the message gets delegated to... but there just seems to be no perfect solution: subscribing to the event topic straight from the target app just... doesn't seem to work properly, a Python implementation.... well, let's just leave it at that... a Node.js implementation would require TS and completely rewriting a proprietary library with 100+ complex types - also, there's some hiccups with both the subscription and the decryption...
I started with an F# implementation (after deeming the PHP one flawed), and it seems it's still the best. But goddamn it I had problems with it on the dotnet core side of thing (decryption output incorrect), so I had to switch to dotnet framework... Now finally everything crucial is peachy, but I can't seem to be able to implement a working serialized domain model pipeline to validate the decrypted message and convert it to something easier to digest for the target application (so that I could use the existing API endpoint instead of writing a new one / heavily modifying the existing implementation and fear breaking something in the process...). I probably could do it in C#, I don't know, but for the love of Linus I'm not going to do it if I can avoid it, when implementing the same functionality I have now without the Dto and Domain type modules would take 3x LoC than the current F# implementation incl. the currently unused modules!
And then there's the problem of deployment... I have no idea what's the best way to deploy a dotnet framework module to an app completely based on MAMP running on a mostly 10yo AWS cloud solution. If I implemented a PHP or Node.js solution, it'd be a piece of cake, but... Phew, I don't know. This is both frustrating, overwhelming and exciting at the same time.7 -
Has anyone tried kivy for android on a mac using the newest android sdk and ndk?
If the answer is no, god bless you and your unhurt soul.2 -
Finally finished my macOS+iOS project.
Mac app which play your YouTube playlist while displaying changeable image next to the player with the workout you are doing. It has features like:
-saving workout details in calendar
-download the currently playing video
-remove song from current playlist and add it to playlist with Old songs
-save the remaining songs of the playlist shuffled to new playlist to listen to them from your phone while you take a bath after the workout for example
-the app detects three playlists based on the description:
*”music” in description for Music playlist
*”newest old” in description for Old songs playlist
*”rest songs” in description for rest songs playlist(the songs you didn’t listened to from music playlist, this playlist is auto generated on exit if you want)
-the app can play any playlist or video from YouTube sent by the iOS app over tcp and add a song to your Music playlist if you liked it.
The iOS app features:
-gesture control for the main app over TCP
-chart for the weekly calorie burn retrieved from calendar.
View images: http://imgur.com/a/likbS -
Open question:
Do you and your dev team openly embrace using a formatter for your projects, or do you not? And why?
My senior dev is trying to argue that it creates too much noise for commits, especially on older files and it's driving me nuts because I religiously use it (default TS formatter in VSCode btw, nothing crazy or super opinionated!)14 -
I have become very fond of React, but the pushback I've experienced when suggesting typescript is crazy.
I think this is the reason why so many enterprise apps are written in Angular. Type safety isn’t a crutch, it's a tool. Plus, interfaces are a dev time construct, and will not bloat the codebase since it doesn’t transpile into js.
But Ts also gives us a lot of other goodies that allow for cleaner design patterns and a better adoption of oop principals.
Also, generics/constructor types, whatever you wanna call it, are your friends. An Array<SomeEntity> or SomeEntity[] will give you peace of mind I’m so many scenarios.
Anyway, I have bitched enough.
Rant over.
Have a wonderful Christmas, everyone.
Ps. This isn’t aimed at anyone in particular, but a the react community as a collective. :)3 -
Why include a linter if you're just going to ignore it!
I just "inherited" an angular app from a year ago for a project that was put on hold, and after opening it in VS Code practically every TS file went red. Almost every rule in the config was not followed. Might as well have just disabled the darn thing?
The original developer is MIA so I can't contact him and ask him why either.1 -
My company is trying to convert all dev to become ts/js fullstack for all product and future projects. Which to me make sense because we don't have hire php/ruby/java/pyhon dev and no backend js dev have excuses not to help to fix frontend bugs now. So much productivity boost and cost saving for the entire org!6
-
Currently VSCode just because I am not that into Vim and it supports most languages I have to deal with very well (ReasonML/OCaml, TS, JS).
But when OniVim2 will be completed, that will probably it. I pre-purchased it and the instant startup time while still supporting vscode extensions are already promising.
https://v2.onivim.io/ -
so I'm the new guy now, my new team write complicated, deep-for-no-reason IFs instead of a switch, gave me a shitload of resources to get up to date with their standards, insisted to every time make sure my code has been tested, then the first deployment I see THEM do breaks production, because a major fucking app had no tests whatsoever, also half of the team has 30+ years of experience in backend, laughs about TS on the server (which is actually fair) and I'm the frontend guy
challenge accepted4 -
I did a challenge for an application which consisted of developing a landing page. I figured i wanna hardcode everything and not use any CMS or editor. Fknally i could use SCSS, ITCSS and BEM and it was the most fun i had in a long time. Going for PUG and TS next!1
-
Any backend devs here working with TypeScript? What are the best framework choices right now? I've been looking at Nest.js, but there seems to be a steep learning curve that might hamper onboarding of my (literally fresh graduate) new hires. There's also Ts.ED, which seems like the fat has been trimmed from it.
I know people will recommend something like, just using express / koa / hapi but I don't think we have the time to work with something super lightweight 😬😬😬. And besides, opinionated frameworks will speed things up for now (we have a lot of crap we want to do this incoming 2022)12 -
Just lost like half an hour debugging an issue because I was using .pop() to get the last element of an array, but not intending to remove the element from the array. I wish typescript had immutable references... Rust kinda spoiled me there.2
-
I'm a MERN stack developer but want to crack google interview, so could I use javascript (or ts) to solve DSA problems there or should I need to solve it with cpp?19
-
Is anyone frustrated with typescript or am I just doing it wrong? Like the types are never matched. Drill down the types in every prop. It just seems very extra.
Newbie in TS2 -
Have anyone in Norway/Scandinavia ordered a devduck/apparel from the swag store and can tell me how long it did take? Want to order one, but not until at the start of next year.
-
I'm a web developer.
I build web apps using JS/TS, vue.js and some Go in the backend
But I'm not that kind of dev who knows how a compiler work, and I usually get lost when I read a comment written by that guy 100110111.
Weeks ago, I started looking for a new language to learn, I tried Rust, Nim, V, I spent 30 minutes on the haskell homepage doin' the "learn haskell in 5 minutes"
I really wanna learn a new language, because I love learning new things.
Even if many of you here did not agree that Vlang could become a great language, I liked it and I'm following it waiting for the v1.0 maybe it's gonna achieve all its promises.
There is some other languages that I wanna learn too, like Nim and Zig.
What makes me like a language ?
1- the simplicity of syntax
2- performance (benchmarks)
3- the possibility to build anything with it
Now I'm wondering if it's a good thing to swap between languages like this, without knowing exactly what I'm gonna do with it, and what should I do to stop hesitating and stick with one language
...
what I really want, is to learn a language so good that can be used on servers (web backend) and on desktop (cros platform)7 -
I had to contact technical support for an API. I’m pretty sure I was emailing with a bot because I was getting all sorts of stupid replies.
Me: I’m using your SDK for language X. It’s returned null for some properties. In the user portal, I can see there are values for those properties for the transaction. I don’t know why I’m not receiving them on my end.
Tech Support: Hi! I see the following was sent in the API response. [Sends api response to me.] You can also go the the portal to see those values.
Me: Yeah, I know. You just repeated everything I wrote to you. I don’t want to go to the portal. I told you I want to figure out why your SDK doesn’t seem to map those properties correctly when I receive the api response.
TS: Let me look at the docs. I think you need to send the properties you want in your request in order to get them back in the reply from the api. Such as <property>value<property> in the xml message.
🤨 The docs do not say that. They don’t even imply that.
Me: What the fuck?! That makes absolutely no sense. We have already established that the api **is** returning values for those properties. I want to troubleshoot why your SDK is mapping them as NULL. -
Can somebody please explain to me how in the fuck does :
{
"src" : "./template.html",
"format" : "plain",
"input" : {
"noun" : "World"
},
"replace" : "templateExampleSkeleton"
}
Result in:
format: "plain"
input: "[object Object]"
replace: "templateExampleSkeleton"
src: "./template.html"
When put through JSON.parse()???12 -
stateofjs survey reminds me of all that's wrong with JavaScript: too many frameworks each of which has to reinvent the wheel and depend on too many node_modules child dependencies, most don't support TypeScript properly (ever tried to convert a node-express-mongoose tutorial to TS?), there is still no proper type support in JS core language, and browser features get added in form of overly complex APIs instead of handy DOM methods.
Instead the community gets excited about micro-improvements like optional chaining which has been possible in other languages for decades.
At least there is something like TypeScript, but I don't like its syntax either, it's overly verbose and adds too much "Java feeling" to JavaScript in my opinion.
Also there is too much JS in web development, as CSS and HTML seem to have missed adding enough native functionality that works reliable cross browser to build websites in a descriptive way without misunderstanding web dev for application engineering.
After all, I'd rather have frontend PHP than more JavaScript everywhere.
Anyway, at least the survey has the option to choose how satisfied or unsatisfied people are about certain aspects of JS. But I already suspect that most respondents will seem to be very happy and eager to learn the latest hype train frameworks or stick to their beloved React in the future.5 -
So you know those movies where the girl fells in love with the bad gay(kidnapper, thief...) and she doesn’t want to be saved.
Same relationship with me and JavaFX.1 -
Does anyone have experience with using Kotlin as a front end language? Seems to have excellent JS interop and I really don't want to deal with the garbage fire that is JS or TS 😬5
-
tldr: Fuck webpack with a big rusty pipe.
I have a class and in the construct a method is called with an imported value as the argument. This imported value is declared like this:
export const EXT = 'whatthef';
Seems like webpack moves things around in such a way that this constant isn't aceasable in all contexts.
Spent a good 4 hours figuring that out 🙃2 -
Cont. on: https://devrant.com/rants/3533743/...
So yeah, kind of had to figure out the semi-hard way that Yew really isn’t prod ready yet (as they clearly state somewhere). Too bad. Or maybe because I don’t have the experience in Rust to overcome some of the issues I’ve had... so it’s back to plan B, id est Vue with TS. At least I got much of the thinking work done already, so I could just write the damn code - and the stuff I had problems with in Yew were all simple for me in Vue.
Or that would’ve been the case if I hadn’t decided to use the newer composition API instead of the options API already familiar to me. Damn it took me all day to wrap my head around it and I’m sure there’s much more head-wrapping to be done. Still, I’m likely done with this at least 2-3 weeks before the deadline, so I can maybe spend the some time figuring out the Yew implementation, too... not sure why, but maybe it ends up better?1 -
Anyone know how to effectively write a DI in TypeScript with decorators? I’m working on a TS node framework and need some help4
-
Typescript is my new favorite and my grudge is the stupid scoping of type assertions. I have an async function that checks whether a variable is set and awaits a change event if it's undefined. This function is working javascript but invalid according to typescript, because it relies on the exact type changing while the function is running. I had to convert it to a mess of promises to bypass this because (and this is the best) the callback-based syntax of identical meaning will reset all type assertions, even locals that are never written after the callback's creation.8
-
I can't stand typescript lovers
it's just typing on top of javascript... it's good but that's all - one more tool to help you build solutions
why you keep talking everyday about types, why you keep creating types for everything in the most unusuble and unmaintainable ways??7 -
Seriously corp....who the hell thought is was going to be a good idea to try and cram together a Microsoft product with os....wtf. typescript has NO business being used with REACT. Ummm if ts doesn't know what push() is we are all f'ed
-
Integrating Algolia with Firebase cloud functions and a solid Js/Ts framework (or even Vanilla Js!) is definitely mint fuckin titties, I highly recommend checking it out if that's a solution you need.
🔥🔥🤘🏻👽🤘🏻🔥🔥 -
how many times a day can a dude shit? oh my God ts so fucking annoying!
shitted about 5-6 times today
every day i shit
max: 6 times
average: 3 times
minimum: 1 time6 -
I ngl miss the thrill of high-performance computing. Or more precise would be where the program's running was directly affected by what I did.
Ever since career took the applications/apps/backend route, i try to optimise but ik it's useless.
The c#/.net would anyway make its own changes, Im not allowed to write direct SQL queries and index-powered joins coz "EF will handle it". Any JS/TS is recreated by Node
Thats how work be but kinda saddening2 -
I've been using Supermaven for the past few weeks because my one buddy keeps raving about how it's going to replace me (he's a weekend coder type guy who's in the trades)
It just tried to write a Typescript switch block in a Ruby file. I was writing a .rake file this morning and it was trying to write some strange TS/Ruby hybrid code. Big yikes
Apparently Copilot is even worse lmao1 -
Babel fails about 10% of the time, but if I re-run it it works. What the fuck did I even get myself into, and why aren't elements of a modern javascript toolchain completely deterministic? (webpack, babel, typescript, react)1
-
The state of state management with react sucks ass. The boilerplate for a store with a type parameter is absurd.2
-
I dont get it. Please give me one good reason to use mongoose with a mongoDB.
Once upon a time it might have made sense to use a schema for the db. Today the native driver supports schemas and can check them on inserting. Nevermind one should validate the data before its hitting the db. I listened to an 1hr podcast last week where one of the maintainers tried to give reasons why its might be a good idea to use mogoose, and he failed miserably.
It introduces dependencies that are useless, it doesnt really abstract anything useful from the native driver, its TS support is shit and I dont like the API.
Every time I see someone use it he either fails or doesnt explain at all why to use it. Its so redundant it makes me angry. We have enough abstraction already. We really dont need more code that doesnt provide value. Please just use mongo the way the people of mongoDB intended it to be used.1 -
Hey everyone, need some advice here. To give some background, I am 17 years old, and currently residing in New Zealand. I love software and have my career path set on being a developer, most likely full-stack web. (Windows/native development & Game development I wouldn't mind either). I would say I am confident in JavaScript (incl. TS), web-dev languages (HTML & CSS) and Python. And with less experience, but a strong interest in Rust, C# and C++. I plan to go to my local university to study Computer Science. Because of factors like my age, location, lack of previous job experience and degree(/s) make it hard to meet any requirements for the few jobs available locally, or even remotely. Anyways, what have you done to get where you are today or what would you recommend based on my current background? My main goal is to get my foot in the door than to "have money" or "be occupied", so if other paths like certifications or more temporary contract-like work (similar to Fiverr) is a better idea then let me know.2
-
I was a bootcamper. I’m on my first job now (I’m still currently at the same place after a year and a half). Doing web development (all JS/TS) with node, react and angular. I started it out working with another guy and now I’m alone. I’ve made more progress being alone since I’ve had to take on stuff my colleague was doing. But with being alone comes more pressure as it’s all on me and when shit hits the fan I don’t really have anybody I can fall back on. Also I feel like I’m missing out on team dynamics and learning from other people I could be working with. In any case I’m learning a lot, I’m meeting the deadlines and getting the job done. It’s a good first experience.2
-
I'll need to do a survey on how different frontend frameworks support asynchrony, both in data and component loading.
I have a very powerful lazy loading primitive for React (https://github.com/lbfalvy/... ), but it's a bit broken so I'm rewriting it into a stateful TS class (because it would have to allocate a lot to be immutable and fast) and a React shim. I'm considering adapting it to other frameworks that struggle with code splitting or async data, or perhaps - like react - only ship a built-in solution that requires unrelated business logic to acknowledge the frontend framework.
Are you happy with the workflow of using asynchronously loaded data in your frontend framework of choice?1 -
I started my new job. Apparently I am responsible for "Transfer Services" and the networking equipment installed in the plant.
The system works in the standard way that Warehouse Management Systems talks to one of our TS servers and they give instructions to underlying controllers, It's some kind of tcp relay. Does anyone from you worked on this layer? I am trying to find some resource on the internet about windows server running this kind of service can't find anything. I would like to do some research and prepare adequately. Would be nice to hear your opinion. Thanks. -
I'm trying to set value of a kendo js property using value from dB. I would like to do something similar to
template : "#= dataItem.Item1 #"
But I can't use template for what I'm trying to set -
Behold! This is the first time in my career when Jest and unit testing in general actually helped me 😂
Spent two days moving from a fucking slow piece of crap called Gatsby to Vite, trying to comprehend the difference between TS aliases, Babel aliases and Linaria aliases. Found an answer inside a totally unrelated issue explaining Jest stuff, good job on documentation, Linaria!
Vite is fast. Crazy fast. Forget about Webpack, Parcel and things alike — Vite doesn't even need to bundle JS.
Gatsby was slow to the point of my computer's audio glitching, I'm not even talking about the OS interface lags.
Vite is fast to the point that I don't actually need a new MacBook.1 -
God fuckin dammit, I swear to heaven if this bitch ass code returns IO.Exception file is being used blah blah blah even though I'm using filestream and streamwriter. I will lose my shit in this fucking office1
-
Have any early adopters tried out the new Deno yet? If you have, what are your thoughts?
https://github.com/denoland/deno2 -
have you tried https://kretes.dev/? it looks like interesting tool for ts development. I wonder if you used it for a real project?2
-
did a google search for typesceipt date formating as just 'ts date'...
the results were less than helpful.1 -
Most JS/TS integrations are more customizable if they are used with React, but not Angular. Why is that? Framework popularity?4
-
Was trying to compile typescript files when suddenly my command line lagged and i can not acess it, i hate myself4
-
It is fucking annoying to do changes in someone else js and ts code... Always give some bullshit thing for which you have only one response kiss my piss IDIOT CODE.....
-
I just discover the language Dart (https://dart.dev/) and I think I do not fully get the scope of it.
Afaik it's a language for building cross platform guis where in the past you would have used something like ionic. So am I right that Dart is not quite for web development (as a "replacement" fur js/ts)?4 -
So my TV tuner outputs the videos as 1-20GB TS files... To my secondary 1TB HDD...
But that's my main storage drive too. And well I'm recording every week and maybe transcribing some to keep.
Also seems for Plex, need to transcribe to mp4 beforehand.
So now I'm worried about drive failure, seems most DVR drives last around 2-4yrs... depending on use...
Wondering if I need an external USB "throwaway drive" or another internal, not sure whether there's an empty slot, need to check -
I want to learn a new front and back end webdev language. So far, I've found Dart and TypeScript (though this one is not completely new to me) on the front end side, and Go, Elixir and Rust on the back end side. As I don't have too much free time, I can choose one of both sides for now, but I can't decide which ones to go with, since I can read so many pro-contra opinions.
I only need to choose for the skill, I don't have any specific target, I just want to learn new stuff.
Which ones do you suggest? -
Is programming a website/basic backend program in TypeScript with NodeJS actually a good idea? Or should you be programming it in C#, Rust, (not PHP), Golang, etc?
I personally feel like NodeJS has pretty amazing performance considering how much less code you would write compared to the other options. Although I feel something like Rust (haven't used it yet) would be more robust but more work.
Note: I only currently know JS, TS, C#, Go and obviously HTML, CSS9 -
hmm... since i cant really code at work due to network restrictions and sh*ts planing to start on a personal project at home which will be like a cashless payment / e-wallet and planing to use node(express) as endpoint reactjs at web dashboard/admin and react-native for mobile client or i can just stay with laravel as endpoint and build the web ui using vuejs integrated with laravel? what do you guys think should i stick with node(express) or just use laravel?1
-
Anyone else get janky scrolling when reading the comments on a rant? I don't know what kinda funky thing they tried to do with the scrolling but it always strongly resists me scrolling down the page.
Anyways, I have to do this in the DevTools console to stop it:
document.body.innerHTML = document.body.innerHTML.replaceAll('scroll','');4 -
Node server with webpack poly fill on embedded device. Why 😂 .
Replacing node-fetch with node http instead of waiting for native node fetch API. Why 😂
All npm scripts on package.json are dead. Why 😂
Node server is not even sharing TS interfaces with frontend.
Customers are complaining about MeM0r1 L3k and let's build more features on stupid node.
Fucking kill me.1 -
Any tips for getting into the freelance game?
I’m a FE dev (React / TS / Next) with a11y certs and 7+ yrs of experience, but am wondering how I can get my first clients freelancing?
I’ve got drafts for contracts and all the legal protection stuff sorted to prevent me getting fucked over in most cases, but am struggling when it comes to getting myself out there and actually grabbing clients.
What tips do you guys, gals and non-binary pals have for someone wanting to break from big-corpa and to go into this new direction?2 -
Do you know a super simple guide / tutorial / etc to learn TensorFlow.js from scratch? (for real dummies)3
-
Anybody know how I could make an RxJS observable without RxJS?
I'm working on a library and I need it to be small (So including RxJS isn't really viable), run in the browser (IDK if Browserify will work for RxJS), and be fast. I need a way for a given element to 'listen' (or in RxJS terms, 'subscribe') to a value and update its text content whenever the value changes.
My current implementation is just a interval loop that checks if the previous value is the same as the current one, and if it isn't, it modifies the DOM.6 -
trying to build a mobile app,
try to use angular + nativescript as angular is a big thing.
get throw f-ing components and modules at my face like i need 3 files to make any progress.
switched to react native, everything is honky dory
what are your views on angular and why would you use it over react ? (real question )
<35 -
Typescript Question
This is something that's been bugging me for a longer time now.
I did couple of React/typescript project (CRA) and it just keeps on happening and I have no idea why and even better - I have no idea how to query google with about problem.
From time to time I open a file that I KNOW was without any errors and suddenly BOOM - Parameter 'XYZ' implicitly has an 'any' type. And now I need to go and add explicit types everywhere it wants me to. TS Server restart doesnt help. Why does this keep happening? Any Typescript guru please?3 -
TypeScript is bullshit. Change My Mind:
I am a student and I started learning typescript as an advanced project at the recommendation of my teachers because I am a bit ahead of where my software development course is.
I started by testing the logic of types, and then I encountered type: unknown.
According to the TS handbook:
"If you have a variable with an unknown type, you can narrow it to something more specific by doing typeof checks, comparison checks, or more advanced type guards that will be discussed in a later chapter:"
So according to what this says, if you check a variable of type unknown, to equal a certain object type, typescript will allow you to assign that unknown value a I tested this out with a data type - objects and typescript freaks out.
Also, if create object with a property assigned to a function, it won't even show you that property when you console.log the object
ALSO, you can't post urls in this website, so this website is also pretty trash.12 -
I'm using Fedora 25/ pre-release, and It's rock solid except for wifi hotspot and I don't need it.
Now my school gave me a Windows 10 pro key, and I'm hesitant.
Should I install it ?
Will I need it ?5 -
For those who coded js for years. How hard to pickup python backend? I refer js/ts node because I don't have to do context switching7
-
TypeScript + Vue3 is such a bullshit combination.
No wonder they dragged Vue3's launch for years. Coz it's garbage.
Out of beta and in supposed-prod, yet half the time the complex objects disappear when passed around. Pinia is bullshit-ia.
Unrelated TS components fuck up and console logs a "Ayye New Error we didn't know existed, here go to Vue Issue Helper and tell us about it so we get to make Vue3 worse than before" ffs. -
Is there any tool that generates an eslint config interactively? E.g. I would start off with airbnb style (but not required) and then toggle different options and see what changes and what will be highlighted. In the end I can save the config. I know eclipse provides such a wizard for java, but haven't found an equivalent one for JS/TS. Anything better than ESLint playground?1
-
Sveltekit progressive enhancement form docs fucking suck.
Arbitrary, non-reproducible examples.
The docs show: return fail(400, { email, missing: true });
The client response says: {
"type": "success",
"status": 204
}
Man, if the docs were monkey-typewritten, they could have warned us first…