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 - "javascript api"
-
So, you start with a PHP website.
Nah, no hating on PHP here, this is not about language design or performance or strict type systems...
This is about architecture.
No backend web framework, just "plain PHP".
Well, I can deal with that. As long as there is some consistency, I wouldn't even mind maintaining a PHP4 site with Y2K-era HTML4 and zero Javascript.
That sounds like fucking paradise to me right now. 😍
But no, of course it was updated to PHP7, using Laravel, and a main.js file was created. GREAT.... right? Yes. Sure. Totally cool. Gotta stay with the times. But there's still remnants of that ancient framework-less website underneath. So we enter an era of Laravel + Blade templates, with a little sprinkle of raw imported PHP files here and there.
Fine. Ancient PHP + Laravel + Blade + main.js + bootstrap.css. Whatever. I can still handle this. 🤨
But then the Frontend hipsters swoosh back their shawls, sip from their caramel lattes, and start whining: "We want React! We want SPA! No more BootstrapCSS, we're going to launch our own suite of SASS styles! IT'S BETTER".
OK, so we create REST endpoints, and the little monkeys who spend their time animating spinners to cover up all the XHR fuckups are satisfied. But they only care about the top most visited pages, so we ALSO need to keep our Blade templated HTML. We now have about 200 SPA/REST routes, and about 350 classic PHP/Blade pages.
So we enter the Era of Ancient PHP + Laravel + Blade + main.js + bootstrap.css + hipster.sass + REST + React + SPA 😑
Now the Backend grizzlies wake from their hibernation, growling: We have nearly 25 million lines of PHP! Monoliths are evil! Did you know Netflix uses microservices? If we break everything into tiny chunks of code, all our problems will be solved! Let's use DDD! Let's use messaging pipelines! Let's use caching! Let's use big data! Let's use search indexes!... Good right? Sure. Whatever.
OK, so we enter the Era of Ancient PHP + Laravel + Blade + main.js + bootstrap.css + hipster.sass + REST + React + SPA + Redis + RabbitMQ + Cassandra + Elastic 😫
Our monolith starts pooping out little microservices. Some polished pieces turn into pretty little gems... but the obese monolith keeps swelling as well, while simultaneously pooping out more and more little ugly turds at an ever faster rate.
Management rushes in: "Forget about frontend and microservices! We need a desktop app! We need mobile apps! I read in a magazine that the era of the web is over!"
OK, so we enter the Era of Ancient PHP + Laravel + Blade + main.js + bootstrap.css + hipster.sass + REST + GraphQL + React + SPA + Redis + RabbitMQ + Google pub/sub + Neo4J + Cassandra + Elastic + UWP + Android + iOS 😠
"Do you have a monolith or microservices" -- "Yes"
"Which database do you use" -- "Yes"
"Which API standard do you follow" -- "Yes"
"Do you use a CI/building service?" -- "Yes, 3"
"Which Laravel version do you use?" -- "Nine" -- "What, Laravel 9, that isn't even out yet?" -- "No, nine different versions, depends on the services"
"Besides PHP, do you use any Python, Ruby, NodeJS, C#, Golang, or Java?" -- "Not OR, AND. So that's a yes. And bash. Oh and Perl. Oh... and a bit of LUA I think?"
2% of pages are still served by raw, framework-less PHP.32 -
Just reached 100+!!
Anyhow. I started coding prettymuch 365 days ago. My mate decided to launch his company and figured it was a good idea to start it with good friends who knew fuck all at coding.
Fyi, the dude can code 15 hours straight everyday for about a year (no shit thats what i saw).
Since he taught me html css javascript(even if i still suck abit at js). He made me remake the whole bootstrap in react by adding this new lib styled-components and test everything(95% coverage :)).
He also taught me webpack and rollup. Json schma forms,http requests redux, redux logic, and all the routing shit...he obliged me to i plement RR4 on release and is now making me overlook the merge requests of my other collegue (yes he made me a git pro,almost).
And now i have to work long distance by studying java, spring, oauth2 and start working on our api.
O yeah,and i went from microsoft to full on linux!!!
To be honest i thought i was gonna die this year. (Also have a kid on the way :)).
Devrant has been like going to the psychologist :) everytime shit hit the fan i realized every one has the same problems :)
Thanks to the community i can also now even give out nerd jokes :)
(L)Devrant11 -
!rant
This was over a year ago now, but my first PR at my current job was +6,249/-1,545,334 loc. Here is how that happened... When I joined the company and saw the code I was supposed to work on I kind of freaked out. The project was set up in the most ass-backward way with some sort of bootstrap boilerplate sample app thing with its own build process inside a subfolder of the main angular project. The angular app used all the CSS, fonts, icons, etc. from the boilerplate app and referenced the assets directly. If you needed to make changes to the CSS, fonts, icons, etc you would need to cd into the boilerplate app directory, make the changes, run a Gulp build that compiled things there, then cd back to the main directory and run Grunt build (thats right, both grunt and gulp) that then built the angular app and referenced the compiled assets inside the boilerplate directory. One simple CSS change would take 2 minutes to test at minimum.
I told them I needed at least a week to overhaul the app before I felt like I could do any real work. Here were the horrors I found along the way.
- All compiled (unminified) assets (both CSS and JS) were committed to git, including vendor code such as jQuery and Bootstrap.
- All bower components were committed to git (ALL their source code, documentation, etc, not just the one dist/minified JS file we referenced).
- The Grunt build was set up by someone who had no idea what they were doing. Every SINGLE file or dependency that needed to be copied to the build folder was listed one by one in a HUGE config.json file instead of using pattern matching like `assets/images/*`.
- All the example code from the boilerplate and multiple jQuery spaghetti sample apps from the boilerplate were committed to git, as well as ALL the documentation too. There was literally a `git clone` of the boilerplate repo inside a folder in the app.
- There were two separate copies of Bootstrap 3 being compiled from source. One inside the boilerplate folder and one at the angular app level. They were both included on the page, so literally every single CSS rule was overridden by the second copy of bootstrap. Oh, and because bootstrap source was included and commited and built from source, the actual bootstrap source files had been edited by developers to change styles (instead of overriding them) so there was no replacing it with an OOTB minified version.
- It is an angular app but there were multiple jQuery libraries included and relied upon and used for actual in-app functionality behavior. And, beyond that, even though angular includes many native ways to do XHR requests (using $resource or $http), there were numerous places in the app where there were `XMLHttpRequest`s intermixed with angular code.
- There was no live reloading for local development, meaning if I wanted to make one CSS change I had to stop my server, run a build, start again (about 2 minutes total). They seemed to think this was fine.
- All this monstrosity was handled by a single massive Gruntfile that was over 2000loc. When all my hacking and slashing was done, I reduced this to ~140loc.
- There were developer's (I use that term loosely) *PERSONAL AWS ACCESS KEYS* hardcoded into the source code (remember, this is a web end app, so this was in every user's browser) in order to do file uploads. Of course when I checked in AWS, those keys had full admin access to absolutely everything in AWS.
- The entire unminified AWS Javascript SDK was included on the page and not used or referenced (~1.5mb)
- There was no error handling or reporting. An API error would just result in nothing happening on the front end, so the user would usually just click and click again, re-triggering the same error. There was also no error reporting software installed (NewRelic, Rollbar, etc) so we had no idea when our users encountered errors on the front end. The previous developers would literally guide users who were experiencing issues through opening their console in dev tools and have them screenshot the error and send it to them.
- I could go on and on...
This is why you hire a real front-end engineer to build your web app instead of the cheapest contractors you can find from Ukraine.19 -
I’m surrounded by idiots.
I’m continually reminded of that fact, but today I found something that really drives that point home.
Gather ‘round, everybody, it’s story time!
While working on a slow query ticket, I perused the code, finding several causes, and decided to run git blame on the files to see what dummy authored the mental diarrhea currently befouling my screen. As it turns out, the entire feature was written by mister legendary Apple golden boy “Finder’s Keeper” dev himself.
To give you the full scope of this mess, let me start at the frontend and work my way backward.
He wrote a javascript method that tracks whatever row was/is under the mouse in a table and dynamically removes/adds a “.row_selected” class on it. At least the js uses events (jQuery…) instead of a `setTimeout()` so it could be worse. But still, has he never heard of :hover? The function literally does nothing else, and the `selectedRow` var he stores the element reference in isn’t used elsewhere.
This function allows the user to better see the rows in the API Calls table, for which there is a also search feature — the very thing I’m tasked with fixing.
It’s worth noting that above the search feature are two inputs for a date range, with some helpful links like “last week” and “last month” … and “All”. It’s also worth noting that this table is for displaying search results of all the API requests and their responses for a given merchant… this table is enormous.
This search field for this table queries the backend on every character the user types. There’s no debouncing, no submit event, etc., so it triggers on every keystroke. The actual request runs through a layer of abstraction to parse out and log the user-entered date range, figure out where the request came from, and to map out some column names or add additional ones. It also does some hard to follow (and amazingly not injectable) orm condition building. It’s a mess of functional ugly.
The important columns in the table this query ultimately searches are not indexed, despite it only looking for “create_order” records — the largest of twenty-some types in the table. It also uses partial text matching (again: on. every. single. keystroke.) across two varchar(255)s that only ever hold <16 chars — and of which users only ever care about one at a time. After all of this, it filters the results based on some uncommented regexes, and worst of all: instead of fetching only one page’s worth of results like you’d expect, it fetches all of them at once and then discards what isn’t included by the paginator. So not only is this a guaranteed full table scan with partial text matching for every query (over millions to hundreds of millions of records), it’s that same full table scan for every single keystroke while the user types, and all but 25 records (user-selectable) get discarded — and then requeried when the user looks at the next page of results.
What the bloody fucking hell? I’d swear this idiot is an intern, but his code does (amazingly) actually work.
No wonder this search field nearly crashed one of the servers when someone actually tried using it.
Asdfajsdfk.rant fucking moron even when taking down the server hey bob pass me all the paperclips mysql murder terrible code slow query idiot can do no wrong but he’s the golden boy idiots repeatedly murdered mysql in the face21 -
I'm trying to sign up for insurance benefits at work.
Step 1: Trying to find the website link -- it's non-existent. I don't know where I found it, but I saved it in keepassxc so I wouldn't have to search again. Time wasted: 30 minutes.
Step 2: Trying to log in. Ostensibly, this uses my work account. It does not. Time wasted: 10 minutes.
Step 3: Creating an account. Username and Password requirements are stupid, and the page doesn't show all of them. The username must be /[A-Za-z0-9]{8,60}/. The maximum password length is VARCHAR(20), and must include upper/lower case, number, special symbol, etc. and cannot include "password", repeated charcters, your username, etc. There is also a (required!) hint with /[A-Za-z0-9 ]{8,60}/ validation. Want to type a sentence? better not use any punctuation!
I find it hilarious that both my username and password hint can be three times longer than my actual password -- and can contain the password. Such brilliant security.
My typical username is less than 8 characters. All of my typical password formats are >25 characters. Trying to figure out memorable credentials and figuring out the hidden complexity/validation requirements for all of these and the hint... Time wasted: 30 minutes.
Step 4: Post-login. The website, post-login, does not work in firefox. I assumed it was one of my many ad/tracker/header/etc. blockers, and systematically disabled every one of them. After enabling ad and tracker networks, more and more of the site loaded, but it always failed. After disabling bloody everything, the site still refused to work. Why? It was fetching deeply-nested markup, plus styling and javascript, encoded in xml, via api. And that xml wasn't valid xml (missing root element). The failure wasn't due to blocking a vitally-important ad or tracker (as apparently they're all vital and the site chain-loads them off one another before loading content), it's due to shoddy development and lack of testing. Matches the rest of the site perfectly. Anyway, I eventually managed to get the site to load in Safari, of all browsers, on a different computer. Time wasted: 40 minutes.
Step 5: Contact info. After getting the site to work, I clicked the [Enroll] button. "Please allow about 10 minutes to enroll," it says. I'm up to an hour and 50 minutes by now. The first thing it asks for is contact info, such as email, phone, address, etc. It gives me a warning next to phone, saying I'm not set up for notifications yet. I think that's great. I select "change" next to the email, and try to give it my work email. There are two "preferred" radio buttons, one next to "Work email," one next to "Personal email" -- but there is only one textbox. Fine, I select the "Work" preferred button, sign up for a faux-personal tutanota email for work, and type it in. The site complains that I selected "Work" but only entered a personal email. Seriously serious. Out of curiosity, I select the "change" next to the phone number, and see that it gives me four options (home, work, cell, personal?), but only one set of inputs -- next to personal. Yep. That's amazing. Time spent: 10 minutes.
Step 6: Ranting. I started going through the benefits, realized it would take an hour+ to add dependents, research the various options, pick which benefits I want, etc. I'm already up to two hours by now, so instead I decided to stop and rant about how ridiculous this entire thing is. While typing this up, the site (unsurprisingly) automatically logged me out. Fine, I'll just log in again... and get an error saying my credentials are invalid. Okay... I very carefully type them in again. error: invalid credentials. sajfkasdjf.
Step 7 is going to be: Try to figure out how to log in again. Ugh.
"Please allow about 10 minutes" it said. Where's that facepalm emoji?
But like, seriously. How does someone even build a website THIS bad?rant pages seriously load in 10+ seconds slower than wordpress too do i want insurance this badly? 10 trackers 4 ad networks elbonian devs website probably cost $1million or more too root gets insurance stop reading my tags and read the rant more bugs than you can shake a stick at the 54 steps to insanity more bugs than master of orion 313 -
When you start a new job as a Senior Developer, and start asking questions about the code, and you have these collections of conversations with other front-end people:
Exhibit 1:
Me: Ahh so I see the filtering and pagination is all done with Javascript in the front end...
Random dev: No, it's done with Angular.
Exhibit 2:
Me: I think we should add frontend pagination to this page. There will be too many elements on it if you're a customer with 2000 servers.
Random dev: Don't bother, there's no pagination in the API call... So that will not gain any performance.
Me: But it wouldn't take long to implement and it would improve the user experience, why would you want to show ALL the elements, when you have an option not to... Also, it WILL be a major performance hit, especially on mobile.
Random dev: People will use search anyway.
😥🔪
Also, there are no coding standards, every file looks different, and my opinion is being disregarded in everything, and I thought my last job was bad...
Seriously how are some people hired as front-enders?
Since I just took this job, I feel obligated to stay a couple of months... But hey, don't cry for me, I might have more rants for you. 😂
Sorry for the long rant, here's cake: 🍰5 -
!rant
Hey everyone!
I've recently made a devrant API for python!
It is available for use in your very own projects!
I am planning on using this on another project, a python devrant CLI program, inspired from a collab using JavaScript.
Here is the link: https://github.com/coolq1000/...
It is very basic with functionality, not much beyond getting rants by index starting at zero, or getting all rants available by skip, limit.
Has some documentation in the readme.
Have fun!6 -
!drunk (yet)
It's whiskey and code tonight!
(Whiskey because I couldn't get to my rum. annoyed face.)
Why? Because rum is so much better. duh.
More seriously: My boss has thrown me every single one his current tasks and is refusing to answer simple questions about them, such as "oh, so you already know about this bug; what's the cause?" or "how do i test this once i've fixed it?" or "where the fuck are you?"
and I'm also getting lots of bugs from other people. They're all basically categorized "urgent, please fix immediately" but should instead be categorized "super-boring and not-at-all-important, and should get fixed on the off chance you happen to remember it next year". That's the best category of bug.
I just gave up on fixing a Rails pluralize bug which fits into the aforementioned category quite nicely. It's returning "2x round of golves" -- which is hilarious and I might leave it in just for the amusement. But now it's back to fighting with ActionCable! Everything has been getting in the way of me finishing that. I'm about to start biting.
Speaking of ActionCable, it turns out my code wasn't wrong after all (have I said that yet?). Since the official documentation and examples suck, I've been digging through the (generated) javascript source and working my way backwards to learn how to use it. I cleaned up my code a little, but it was still correct. The reason nothing is working correctly is that API Guy gave me broken code. ...Again! Go figure. So I'll be rewriting that today. or tomorrow. (Whiskey, remember?)
I also have some lovely netcode to debug and fix. So totally not looking forward to that. The responses are less bloody reliable than my boss's code ffs. *grumble grumble*6 -
What's the point of using a framework if you don't use any of its features!? What the heck, I have to fix this damn web frontend that is so broken in many ways.
Instead of using an authentication middleware, every single view has the same block of code to check if a user is authenticated. Instead of templates, they used static HTML/JavaScript files and they passed data to pages through cookies.
The "REST" API is so messed up, nothing is resource-oriented, HTTP methods are chosen randomly as well as status codes. They are returning "412 Precondition Failed" instead of a plain simple "401 Unauthorized" when you're not authenticated! What the hell, did they even bother to check what 412 is about when they copied and pasted it from a crappy website!? I would never come up with 412, not even in my scariest nightmare.
What kind of drugs were they using when they wrote such code? Oh dear, I need a vacation...2 -
I have in my head parts of a game, I'd love to build. A top-down space colonization game. You control various spacecrafts and build spacestations etc. to expand your control.
The catch is that you have limited direct controls in-game. Most of the "gameplay" consists of having your own piece of software running somewhere, communicating with the API and controlling your colony.
Similar to Screeps, but I don't like the limitations of writing JavaScript and uploading it to the service. I'd love for the user to have free control of what language to use. They just need to be able to create a TCP socket and communicate with the API24 -
Them: My company is looking for a junior C++ programmer. You must have 10 years experience with PL, SQL, SQL Server, MySQL, SQL oracle, javascript, HTML, XML, UML, c-sharp, visual basic, java.net, j unit, and win32 api, cutie, gtk, PHP, ASP, Perl, Python, and shell scripting with the windows, linux, and solaris operating systems.
Us: Do i need to know C++?
Them: no
https://youtube.com/watch/...5 -
Not a rant about anything in particular. Just a summary of some feelings stored in the hateful part of my heart.
Developing for Android: Add this third-party library to your Gradle build. Use (this) built-in Android class to make the thing work.
*Clicks link
Deprecated since API version SUCKMYDICK-7. Use (this) instead
*Clicks link
Deprecated since API version LICKMYBALLS-32. Use...
Developing for Windows: Please use (this) API call. It was literally already available before Bill Gates was born. Carbon dating has placed this item to older than the universe itself and it is likely the entry point for the big bang. It is also still the best way to accomplish (task).
Developing for Linux: "Hmm, I wonder how to use this"
> > > Some shitty mailing list in small blue monospace font tells you to reference a man page that is three versions behind but the only version available.
What? Those three sentences didn't explain it enough? Well, maybe you aren't cut out for this type of thing.
JavaScript: you know how it is.
SQL: You expect a decent-quality answer from stack overflow but you always get an outdated and hacky response and it's using syntax from Microsoft SQL. You need MySQL.
C#: A surprising number of Microsoft forum results ranking high on Google. You click on one in hopes that it will be of any sort of quality. You quickly close the tab and wonder why you ever even had hope.
Literally any REST API: Is it "query" or "q"? "UserID" or "user_id"? Oh, fuck, where's the docs again?
You thought you escaped JavaScript, but it was a trick!: Some bullshit library you downloaded to make your other library work redefined one of the global variables in the project you inherited. Now you get 347 "<x> is not a function" errors in your console. Good luck, asshole.
FontAwesome/ Material fonts/ Any icon font pack: You search "Close" for a close button icon. No results. You search "Simplified railroad crossing sign without the railroad". You get a close icon.
I think that's all of my pent up rage. Each of them were too small for an individual rant so I had to do this essay.2 -
TLDR; Wrote an awesome piece of code, but there's no one capable of understanding how hard it is.
I spent an entire night building an insanely complicated automation script, that picks out certain configuration files (in javascript fml), does some crazy parsing to pick out strings, passes them into a free translation API, translates them, and does more insane parsing to insert those strings as javascript objects.
Spent 3 hours on the bloody parsing algorithm alone.
Manager: Oh this language is really nice. Good of you to discover it can do that.
I didn't "DISCOVER" it ffs! Its a product of my head! I built the damn algo from scratch.
Seriously, screw non devs who trivialize the complexities of writing a good program. Its NOT as simple as opening notepad and typing in
import {insanelyComplexSolution} from 'daveOnTheInternet'3 -
Last night I nearly finished my portfolio site. I was working on the perfect framework and workflow like forever. But in the end I accomplished a pretty pleasing solutions. For the back-end I choose Laravel with it's built in rest-api, the front-end is managed by Vue. I'm also proud of my assets-management which is handled by Gulp + Webpack (Laravel Mix). But here I decided to run Gulp on images, fonts and CSS and let Webpack bundle the JavaScript.
And what really crawls my balls is that I can write Sass and Jade, even use partials and organized the shit out of this website, and let Gulp just vomit some minified HTML and CSS on the other end.
Man that feels so good.20 -
A LOT of this article makes me fairly upset. (Second screenshot in comments). Sure, Java is difficult, especially as an introductory language, but fuck me, replace it with ANYTHING OTHER THAN JAVASCRIPT PLEASE. JavaScript is not a good language to learn from - it is cheaty and makes script kiddies, not programmers. Fuck, they went from a strong-typed, verbose language to a shit show where you can turn an integer into a function without so much as a peep from the interpreter.
And fUCK ME WHY NOT PYTHON?? It's a weak typed but dynamic language that FORCES good indentation and actually has ACCESS TO THE FILE SYSTEM instead of just the web APIs that don't let you do SHIT compared to what you SHOULD learn.
OH AND TO PUT THE ICING ON THE CAKE, the article was comparing hello worlds, and they did the whole Java thing right but used ALERT instead of CONSOLE.LOG for JavaScript??? Sure, you can communicate with the user that way too but if you're comparing the languages, write text to the console in both languages, don't write text to the console in Java and use the alert api in JavaScript.
Fuck you Stanford, I expected better you shitty cockmunchers.31 -
That awkward moment when your Girl needs you not as a friend but as a web dev because of a javascript bug in an online job portal that won't let you send your application because the hidden field auto fill crashes due to exhausted free requests to the Google maps API...5
-
I’m fucking done….
I don’t even know what to tell.
I’m a CTO in a startu. We have pretty good traction, my salary is about average senior dev salary (plus 10%).
I’m good financially.
But I have no more pleasure in work. Like at all.
“This API call performance is bad”
Yeah I know, maybe you shpuldn’t try to call it for 1000 objects at the time ?
“We need to reduce Azure cost”
Yeah I know, but are you ready to live with performances downgrade it will generate ?
“I don’t understand on what thing you worked past week, where is a devops card ?
Fuck you, I’m in extenuating fire mode, I don’t have time for a fucking devops card
“We should migrate whole stack to modern technology, like JavaScript”
Thank you for your imput, Blazor WAS created to avoid JabaScript
“The client has only 1.000.000 records and API doesn’t return them all”
Use fucking paging moron. And BTW, I’m adding “number of authorized requests” shortly.
I can go on and on and on for hours. But the idea is : I completely lost the will or motivation to do anything. I’m considering just to quit and go back to be Junior dev for a random company.9 -
Stupid javascript.
Stupid hoisting-oblivious "frontend devs."
Stupid browser-specific javascript behavior.
Stupid thrown-together javascript minifier that literally only strips out whitespace and comments.
Stupid poorly-written javascript spamming my api.
Time to rewrite it. Grumble grumble. Soo not how I wanted to spend my morning-turn-afternoon.
Leading to the last but not least:
Stupid me forgetting javascript's quirks.12 -
OK heavy rant on 'modern' software development coming! --> don't take it to seriously though :-)
Electron... why does that shit exist? It is like stacking all the worst technologies available to mankind into an enormous pile of crap and polishing that turd to look like something wonderful. It is big, slow and overall AWFUL!
An example? ... Microsoft Teams :-( it burns your PC like fire and makes it squeal for mercy.
When a library/framework becomes the ultimate evolution of abstraction layer upon abstraction layer and it simply should stop to exist and a reset button needs to be pressed.
I would love to see some research on the real world environmental impact that all those shitty slow and bloated web technologies have.
Solution:
Software energy label!
C, C++ and Rust e.t.c. and all accompanying efficient UI libraries should be the only languages/implementations allowed to get a A, B and C label.
Python (without C libraries like Numpy), JavaScript and all those other slow interpreted scripting/Web API nonsense should get a D, E or F label by default.
Have fun!12 -
My best experience was going from static HTML and non-preprocessed CSS to having my mind blown by Sass & learning JavaScript and what "API" even means (and starting on ruby and basics in command line). I actually feel like I'm a developer in some sense of the word.
That was a ton of growth in a year where I transitioned from a purely graphic design role to having an influence over development processes and rolled out a number of projects to production that I spearheaded.2 -
My current project is a fucking nightmare.
It started in 2007, using a solution developed by an Indian company due to outsourcing (aka low-quality code).
It's running on Java 7 on the back-end and its front-end side is pure Javascript files. There are thousands of little .js files everywhere, no documentation, no comments, differents coding styles, outdated API that were already outdated at the time, mixed oop and procedural.
Not even when I started coding, I wrote something so horrible.
Yo, it's a clusterfuck and I just wanna get drunk.5 -
Did a bunch more cowboy coding today as I call it (coding in vi on production). Gather 'round kiddies, uncle Logan's got a story fer ya…
First things first, disclaimer: I'm no sysadmin. I respect sysadmins and the work they do, but I'm the first to admit my strengths definitely lie more in writing programs rather than running servers.
Anyhow, I recently inherited someone else's codebase (the story of my profession career, but I digress) and let me tell you this thing has amateur hour written all over it. It's written in PHP and JavaScript by a self-taught programmer who apparently discovered procedural programming and decided there was nothing left to learn and stopped there (no disrespect to self-taught programmers).
I could rant for days about the various problems this codebase has, but today I have a very specific story to tell. A story about errors and logs.
And it all started when I noticed the disk space on our server was gradually decreasing.
So today I logged onto our API server (Ubuntu running Apache/PHP) and did a df -h to check the disk space, and was surprised to see that it had noticeably decreased since the last time I'd checked when everything was running smoothly. But seeing as this server does not store any persistent customer data (we have a separate db server) and purely hosts the stateless API, it should NOT be consuming disk space over time at all.
The only thing I could think of was the logs, but the logs were very quiet, just the odd benign message that was fully expected. Just to be sure I did an ls -Sh to check the size of the logs, and while some of them were a little big, nothing over a few megs. Nothing to account for gigabytes of disk space gradually disappearing.
What could it be? I wondered.
cd ../..
du . | sort --sort=numeric
What's this? 2671132 K in some log folder buried in the api source code? I cd into it and it turns out there are separate PHP log files in there, split up by customer, so that each customer of ours (we have 120) has their own respective error log! (Why??)
Armed with this newfound piece of (still rather unbelievable) evidence I perform a mad scramble to search the codebase for where this extra logging is happening and sure enough I find a custom PHP error handler that is capturing (most) errors and redirecting them to these individualized log files.
Conveniently enough, not ALL errors were being absorbed though, so I still knew the main error_log was working (and any time I explicitly error_logged it would go there, so I was none the wiser that this other error-catching was even happening).
Needless to say I removed the code as quickly as I found it, tail -f'd the error_log and to my dismay it was being absolutely flooded with syntax errors, runtime PHP exceptions, warnings galore, and all sorts of other things.
My jaw almost hit the floor. I've been with this company for 6 months and had no idea these errors were even happening!
The sad thing was how easy to fix all the errors ended up being. Most of them were "undefined index" errors that could have been completely avoided with a simple isset() check, but instead ended up throwing an exception, nullifying any code that came after it.
Anyway kids, the moral of the story is don't split up your log files. It makes absolutely no sense and can end up obscuring easily fixable bugs for half a year or more!
Happy coding.6 -
I'M BACK TO MY WEBDEV ADVENTURES GUYS! IT TOOK ME LIKE 4 MONTHS TO STOP BEING SO FUCKING DEPRESSED SO I CAN ACTUALLY STAND TO WORK ON IT AGAIN
I learned that the linear gradient looks cool as FUCK. Honestly not too fond of the colors I have right now, but I just wanted to have something there cause I can change it later. The page has evolved a bunch from my original concept.
My original concept was the bar in the middle just being a URL bar and having links on the sides. If I had kept that, it would have taken me a few hours to get done. But as time went on when I was working on it, my idea kept changing. Added the weather (had a forecast for a while but the code was gross and I never looked at the next days anyways, so I got rid of it and kept the current data). I wanted to attempt an RSS reader, but yesterday I was about to start writing the JavaScript to parse the feeds, then decided "nah", ended up making the space into a todo list.
The URL bar changed into a full command bar (writing the functions for the commands now, also used to config smaller things, such as the user@hostname part, maybe colors, weather data for city and API key, etc)....also it can open URLs and subreddits (that part works flawlessly). The bar uses a regex to detect if it's a legit URL (even added shit so I don't need http:// or https://), and if it's not, just search using duckduckgo (maybe I'll add a config option there too for search engines).
At this very moment it doesn't even take a second to fully load. It fetches weather data from openweathermap, parses it, and displays it, then displays the "user" name grabbing a localstorage value.
I'm considering adding a sidebar with links (configurable obviously, I want everything to be dynamic, so someone else could use my page if they wanted), but I'm not too sure about it.
It's not on git yet because I was waiting until I get some shit finished today before I commit. From the picture, I want to know if anyone has any suggestions for it. Also note that I am NOT a designer. I can't design for shit.12 -
I shit you not. This this a job qualifications qualifications entry level on LinkedIn.
7+ years working as part of a development team and with the following technologies:
Node.js Typescript and Java-based, microservice-driven applications using Spring Boot or similar framework
RESTful API design / microservice architectures
MongoDB or any other NoSQL DB
Message queues e.g. RabbitMQ, Kafka etc.
Modern MV*(MVC, MVVM, etc..) frameworks e.g. React, Angular, Vue etc.
JavaScript and design patterns, CSS and HTML
Modern CSS and view libraries e.g. RxJS, Angular Material, Typescript, JS ES6 etc.
Unit and UI testing using third party tools e.g. Jest, Cucumber, Groovy & Spock, etc.
Bachelor's degree in computer science or related field6 -
I'll admit - I come from a WordPress background of almost 9 years in the making. I guess I can justify it because of all of the sites I created using it, it was the best that it could be on WP. Fast, efficient, custom - none of that off-the-shelf themeforest crap. I created everything custom. I actually knew what was going on behind the scenes of WP.
And then a buddy of mine and I had an idea for a new company/software project. I was smart enough to know that WP was not the foundation for this, so I did some NodeJS/Express tutorials. Started learning React, and really getting into the Javascript world.
And now I'm wondering WHY IN THE ABSOLUTE FUCK I ever bothered trying to become an expert in WP. It's the largest use of PHP in the fucking world and it doesn't even have native composer support. And by the time you actually get your project set up using composer you have to add a fucking mirror of the wordpress.org plugin repo to get anything to work. It's 2018 and you'd think that WP and composer would have all of this shit figured out by now.
And don't get me started on git - as soon as you have more than 1 person working on a WP site, I hope you have hourly backups of your DB because someones work will get overwritten. So you all either need to work on the same staging area of work around each other by pushing/pulling the DB and schedule your workflows.
I guess WP CLI and the REST API are a step in the right direction, but the foundation of everything is just so fucked up.
I don't feel like I've wasted my web dev career, but I definitely wish I had started down this path a lot earlier. I guess you don't know what you don't know. Thanks for reading!2 -
I work in a contract position and reviewed the code of a senior engineer recently. Regretfully I can't provide context to preserve anonymity.
He wrote awful JavaScript;
- handled a single DOM element with 2 different frontend libraries
- used the logical operator && to 'chain' two methods (it didn't work) instead of returning a boolean value,
- broke everything down into minute detail (a comment box had 7 components!),
- API calls were made for every component update instead of maintaining local component state where it made sense, which meant UI updates were slow,
- animated EVERYTHING, which made my Firefox on Xubuntu i7 64bit with 16GB RAM beg for mercy.
I had a rough couple of months with interviews, with 2nd stage technical interviewers throwing impossible tasks at me.
Example:
1. Create an online Python code editor with Javascript which can compile Python bytecode,
2. Use Mesos and Kafka to create real time architecture for Tensorflow with a Javascript frontend in 1 day. (I asked, and wasn't allowed to use Kubernetes or serverless architecture),
3. Hack a website from the browser's address bar using parameters ( what?!! ),
Obviously, the next time I meet a 'senior', I'm going to tell him talk is cheap;
'SHOW ME YOUR CODE.'3 -
So at the moment I'm developing a RESTful API for an internal project at work and I'm starting to learn and understand about HTTP status codes.
So I started incorporating proper response HTTP status etc, but my co-workers don't understand what any of it means. They think that just sending a JSON response is enough with any messages should be enough. I think this mindset stems from people who just do simple AJAX calls in JavaScript just to get or store data.
It's these kind of developers that I find are lazy or have no motivation to improve themselves, which is disappointing.5 -
I don't know if I'm being pranked or not, but I work with my boss and he has the strangest way of doing things.
- Only use PHP
- Keep error_reporting off (for development), Site cannot function if they are on.
- 20,000 lines of functions in a single file, 50% of which was unused, mostly repeated code that could have been reduced massively.
- Zero Code Comments
- Inconsistent variable names, function names, file names -- I was literally project searching for months to find things.
- There is nothing close to a normalized SQL Database, column ID names can't even stay consistent.
- Every query is done with a mysqli wrapper to use legacy mysql functions.
- Most used function is to escape stirngs
- Type-hinting is too strict for the code.
- Most files packed with Inline CSS, JavaScript and PHP - we don't want to use an external file otherwise we'd have to open two of them.
- Do not use a package manger composer because he doesn't have it installed.. Though I told him it's easy on any platform and I'll explain it.
- He downloads a few composer packages he likes and drag/drop them into random folder.
- Uses $_GET to set values and pass them around like a message contianer.
- One file is 6000 lines which is a giant if statement with somewhere close to 7 levels deep of recursion.
- Never removes his old code that bloats things.
- Has functions from a decade ago he would like to save to use some day. Just regular, plain old, PHP functions.
- Always wants to build things from scratch, and re-using a lot of his code that is honestly a weird way of doing almost everything.
- Using CodeIntel, Mess Detectors, Error Detectors is not good or useful.
- Would not deploy to production through any tool I setup, though I was told to. Instead he wrote bash scripts that still make me nervous.
- Often tells me to make something modern/great (reinventing a wheel) and then ends up saying, "I think I'd do it this way... Referes to his code 5 years ago".
- Using isset() breaks things.
- Tens of thousands of undefined variables exist because arrays are creates like $this[][][] = 5;
- Understanding the naming of functions required me to write several documents.
- I had to use #region tags to find places in the code quicker since a router was about 2000 lines of if else statements.
- I used Todo Bookmark extensions in VSCode to mark and flag everything that's a bug.
- Gets upset if I add anything to .gitignore; I tried to tell him it ignores files we don't want, he is though it deleted them for a while.
- He would rather explain every line of code in a mammoth project that follows no human known patterns, includes files that overwrite global scope variables and wants has me do the documentation.
- Open to ideas but when I bring them up such as - This is what most standards suggest, here's a literal example of exactly what you want but easier - He will passively decide against it and end up working on tedious things not very necessary for project release dates.
- On another project I try to write code but he wants to go over every single nook and cranny and stay on the phone the entire day as I watch his screen and Im trying to code.
I would like us all to do well but I do not consider him a programmer but a script-whippersnapper. I find myself trying to to debate the most basic of things (you shouldnt 777 every file), and I need all kinds of evidence before he will do something about it. We need "security" and all kinds of buzz words but I'm scared to death of this code. After several months its a nice place to work but I am convinced I'm being pranked or my boss has very little idea what he's doing. I've worked in a lot of disasters but nothing like this.
We are building an API, I could use something open source to help with anything from validations, routing, ACL but he ends up reinventing the wheel. I have never worked so slow, hindered and baffled at how I am supposed to build anything - nothing is stable, tested, and rarely logical. I suggested many things but he would rather have small talk and reason his way into using things he made.
I could fhave this project 50% done i a Node API i two weeks, pretty fast in a PHP or Python one, but we for reasons I have no idea would rather go slow and literally "build a framework". Two knuckleheads are going to build a PHP REST framework and compete with tested, tried and true open source tools by tens of millions?
I just wanted to rant because this drives me crazy. I have so much stress my neck and shoulder seems like a nerve is pinched. I don't understand what any of this means. I've never met someone who was wrong about so many things but believed they were right. I just don't know what to say so often on call I just say, 'uhh..'. It's like nothing anyone or any authority says matters, I don't know why he asks anything he's going to do things one way, a hard way, only that he can decipher. He's an owner, he's not worried about job security.13 -
Hi guys, I created a tiny Anime quotes API called Animechan. Totally free to use anywhere 😊✨
https://animechan.vercel.app/15 -
I've been a bit "removed" from .NET lately and I've been slowly forgetting about it. It's like I grieved a loss, and now I was moving on, for lack of a better analogy. I was just beginning to get used to my new environment of Node JS and PHP. And, recently, I was put on track to complete a full project using Node JS.
And then suddenly a new company reached out to me, interested in my skills, and asked for me to build a simple .NET web app to showcase my abilities.
I got started, and holy crap I forgot how nice it was to be coding in this environment. Everything I had forgotten about switched on for me, like riding a bike. I was done with the app in a matter of hours. It was probably the most productive I've been with a coding assignment in forever. I was beaming with pride at the fact that I could code so fluently despite some time away. Everything here just made sense to me.
After I submitted it to the company for review I sat back and thought, damn, do I have to go back to Node/Express JS? I barely have any experience with it 😂. The only reason I know anything is because I watched a 20 minute quick tutorial on how to build an API. That's it.
I really want my current company to give me projects that are in my preferred language and they aren't and that's killing me right now. I can learn, that's not a problem, but my effectiveness as an employee is completely shot by not allowing me to build in code that I know and understand. I was fuckin hired for my specific coding experience, why not take advantage of what I know?
I should say something to my manager but I know they will just tell me no because they want it to be built in Javascript as it's the preferred language of the Gods.
Joking aside, I don't think they will go for it because it is another language that they would have to manage and maintain if I ever leave.
Oh well 🤷8 -
!Rant
Is this what we've all been waiting for?
CodeCorrect finds solutions to common errors in your code
"The hack works by inserting a piece of JavaScript in your web code that reroutes uncaught exceptions to a local node.js web server. From there, the code sends a request to StackOverflow's API to search for error messages and return the highest-ranked solutions to user-submitted questions. Answers are extracted from the StackOverflow, and if they can automatically be converted into instructions, changes will be made to the original code."
https://techcrunch.com/2017/05/...3 -
We use jira at my company. It's great for me, because no ticketing system's UI is worth a shit, but jira's API is excellent. But we're switching to a new system that is an absolute piece of garbage. Every page is 100% Javascript, so no source can ever be viewed, and the URL never changes to reflect what's onscreen. If you know a ticket number, no URL will ever get you straight to it. You have to navigate multiple slow-loading 25MB piles of Javascript to reach what you're seeking. And most damning of all: the new system has an API, but our highest management is withholding access to it, claiming it breeds laziness.
Is amazing the kind of shit you have to swallow when your management has regular meetings with really really super extremely good-looking sales people.10 -
!devButAlsoKindaIsDev
Alright, time to do some explanation.
TL;DR: JavaScript is a fucking nightmare. May god help every web developer out there. Essentially, I was gone because of JavaScript.
Q: where tf are you bruh
A: in your mo-uhhhhh alright, so I was chosen to be the main developer for an interactive promotional video for my school (every year the school holds something called an open day, where kids from 8th grade can come to the school and have a tour in the school first hand. Because of the coronavirus (just gonna call it “the rona” from here) this is now impossible so we are losing the interest and the first impressions so the school decided to make an interactive virtual one). They asked me if I want to do it and I said yes.
Boy, was that ever a mistake... (hint: it was a huge mistake)
So the guy who talked to me and asked if I wanted to do this was my grade’s manager, and he gave me the phone number of my PM. So we talked and stuff, and then this happened: (bruh = PM)
bruh: I’ll send you the API and documentation for the thing that we are working with! They have lots of examples and stuff and they’re Israeli too!
Me: Okay! What language are we talking about here?
bruh: JavaScript.
Me: (questioning life choices) Okay!
I didn’t write any JavaScript for the last 3 years or so. It had to be done because I promised and I can’t let down people who count at me and ask me to show where I shine.
So, what was the objective for me? Build a Firebase client that sends the user’s score and choices to Firestore after he chooses something in the interactive video (for example, go to chemistry or go to physics) while learning JavaScmeme (ECMEMEScript) as I go.
Deadline? A week and a half.
After working almost 12 hours a fucking day, I made it work. Sorta. In order to reconcile with small exceptions and edge cases in the interactive video, I had to hard-code some IDs in the code. I had no choice, since I couldn’t allow myself to spend more and more time to make my code more dynamic than it was because I simply didn’t have time. The code absolutely STINKS but it works.
Today is the day where we (aim) to finish all of the cosmetic things that we need to fix. All of them are non-essential for everything to work, but we want to make this thing presentable because we want to put this on the school’s website.
CONCLUSION:
JavaScript is literal shit. Dynamic weakly-typed languages are cursed AF and need to die in a fire.7 -
Things that seem "simple" but end up taking a long ass time to actually deploy into production:
1. Using a new payment processor:
"It's just a simple API, I'll be done in 2 hours"
LOL sure it is, but testing orders and setting up a sandbox or making sure you have credentials right, and then switching from test to life and retesting, and then... fuck
2. Making changes to admin stats.
"'I just have to add this column and remove that one... maybe like a couple of hours"
YOU WISH
3. Anything Javascript
"Hah, what, that's like a button, np"
125 minutes later...
console.log('before foo');
console.log(this.foo)
etc..2 -
In case y'all ever need a list of available timezones for the JavaScript Internationalization API:
https://gist.github.com/AmyShackles...3 -
Our project at work goes live in 3 weeks.
The code base has no automated tests, breaks very often, has never had any level of manual testing
will not be releasing with any form of enforced roles or permissions in our first release now due to no time to enforce, however there is a whole admin api where you can literally change anything in our database including roles.
We also have teams in various countries all working separately on the same solution using microservices with shared nuget packages and they aren't using them properly.
Our pull requests are so big - as much as, 75 file changes - in our fe app that I can't keep up with it and I honestly have no idea if it even works or not due to no automated tests and no time to manually test.
We have no testing team, or qa team of any sort.
Every request into the system has to hit a minimum of 3 different databases via 3 different microservices so 1 request = 4 requests with the load on the servers.
We don't use any file streams so everything is just shoved in the buffer on the server.
Most of the people working on the angular apps cba to learn angular, no one across 2 teams cba to learn git. We use git so they constantly face problems. The guy in charge has 0 experience in angular but makes me do things how he wants architecturally so half the patterns make no sense.
No one looks at the pull requests, they just click approve so they may as well push directly to master.
Unfinished work gets put in for pull request so we don't know if the app is in a release state since aall teams are working independently, but on the same code base.
I sat down and tested the app myself for an hour and found 25 fe only issues, and 5 breaking cross browser issues.
Most of our databases are not normalised. Most of our databases make no sense. 99% of our tables have no indexing since there is no expertise with free time to do it.
No one there understands css properly. Or javascript.
Our. Net core microservices all directly use ef in the controller actions so there is no shared code there.
Our customer facing fe app is not dry because no tests so it was decided it was better this way.
Management has no idea on code state, it seems team lead is lieing to them about things like having any level of tests.
Management hire devs that claim to be experts but then it turns out they have basically no knowledge of what they were hired to do, even don't know what json is or the framework or language they are hired for, but we just leave them to get on with it and again make prs too big to review.
Honestly I have no hope that this will go well now but I am morbidly curious to watch. I've never seen anything like the train wreck that we are about to get experience.5 -
!rant, but kinda
My new director wants to buy a solution for a portal environment that my institution currently has. I have no qualms over it. My only issue was the company that sells it to be known to provide close to 0 fucking support when shit arises.
During a presentation we were told that they were using state of the art JAVA technology to render items on the page and that their ApI was easy for devs to grasp. This caught my attention since I know of very few and obscure Java frameworks that work with frontend tech (as in, your frontend logic is legit in Java)
The sales people proceed to show us React. Obviously thinking that no one knows what REact was. The dude continues with "This is new Java tech" all proud and shit prompting me to interject that it is "Javascript" the dude brushes it away saying "same thing" to which I reply with "Negative, please make sure that you properly discern Java from Javascript since Java is to Javascript as car is to carpet, completely different environments" the dude sarcastically says that "oh well, didn't know one of the people here was more aware of our own technology than we are" to which I say "and not only that, but the final say in us adopting your tech is mine, so I would rather you keep the sarcasm and the attitude to yourself, bring in a tech person if need be and learn these distinctions since we don't work with Java"
My new director later on went to talk to me since he apparently thought that Java and JS were related in some way. I can't really fault it, last time the dude touched programming was in the early 2000s, previous boss was a C and COBOL developer, but the previous dude would ALWAYS take my word no questions ask, this dude was there asking me if I was sure that Javascript and Java were really completely different environments asking me to show him.
I do not like to be questioned. I shoot the shit here and don't really involve myself with more technical aspects under this platform unless it involves concrete architecture discussions and even there I really don't care with engaging on a forum concerning that. But concerning my job I really.......really do not like to be questioned by people that know way the fuck less than me. I started coding when I was 17, I am 30 now, with a degree and years of experience. I really hate to be questioned by this dude.2 -
OK people, I don't need a novel written for every line of code, but PLEASE STOP trying to tell me that "yOuR coDe sHouLd bE sELf dOcUmeNtiNg aNd cOmMenTs mEaN iT's aUtoMaTiCaLLy bAd". That's a bunch of BS. I can't begin to tell you how many times I've saved my own butt by dropping a "this call can't be awaited; causes the library's internal API to throw an error" comment in my C#, or a "can't use double quotes here; doesn't work right for some reason" line in my JavaScript. Sometimes there are very good but un-obvious reasons why something was done a certain way, even though it looks like it could be done better. And don't try to tell me "the tests will catch it". Let's be realistic here, nobody has 100% test coverage on any project that's much more than "Hello World". And even if the tests DID catch it, why waste the time when you could just write a comment?
P.S.: This is not directed at anyone on here specifically. It's directed at all the devs I've met IRL and the comments I've seen on SO, who think that comments must be bad.12 -
A government website that I wanted to try and scrape data from to make a better app, I've actually found to be the pinnacle of a demonstration of what NOT to do...
Containing a JavaScript file that not only had got code copied 3 times (changed the tiniest bit on each) for what environment it's on, but has ALSO got the API keys for all 3 environments, AND the APIs they've made it call from there pass FULL SQL right in the query string...
What. The. Actual. Fuck?!5 -
I've been using the Square REST API and I spent one hour thinking there was something wrong in my code until I f** found that THEY were not following OAuth 2 guidelines, which made their workflow incompatible with the OAuth lib I was using, so I had to mark an exception for Square's OAuth from the rest of my OAuths. Specifically, RFC 6749 Section 4.2.2 and 5.1.
However, after reading OAuth 2 guidelines, I became angry at THEM instead. The parameter `expires_in` should be the "lifetime in seconds" after the response. This will always be innevitably inaccurate, since we are not taking into account the latency of the response. This is, however, not a huge problem, since the shortest token lifetimes are of an hour (like f** Microsoft Active Directory, who my cron jobs have to check every ten minutes for new access tokens). Many workflows (like Microsoft, Square, and Python's oauthlib) have opted to add the `expires_at` parameter to be more precise, which marks the time in UTC. However, there's no convention about this. oauthlib and Microsoft send the time in Unix seconds, but Square does this in ISO 8601. At this point, ISO 8601 is less ambigious. Sending a raw integer seems ambiguous. For example, JavaScript interprets integer time as Unix _milliseconds_, but Python's time library interprets it as _seconds_. It's just a matter of convention, a convention that is not there yet.
Hope this all gets solved in OAuth 2.1 pleeeaasseee1 -
Give up. Share Target API is already on Android, even in garbage like Samsung Internet. Desktop native apps are already history, mobile apps are sure to follow. Led by Apple Silicon, we will add JS-specific hardware to the CPUs and conquer the world. JavaScript will be the only language, with an exception being C and Lisp.9
-
The company's director and I:
Him: I think we need to build a hybrid mobile app, because the JavaScript code that renders images is the same on our front- and backends.
Me: Well, we could just send the parameters to the server, let it render it and get a response back.
Him: How?
Me: With an API.
Him: Oh! -
Good morning to everyone, except that one Twitter dev who one day woke up and was like "YOU KNOW WHAT, MY APPLICATION WILL FEATURE BOTH OAUTH1 AND OAUTH2 ENDPOINTS, BUT SOME FEATURES WILL BE EXCLUSIVE TO EITHER OF THE TWO -NOT NECESSARILY THE MOST RECENT, JUST A RANDOM ONE-, AND ALSO THE OFFICIAL TWITTER LIBRARY WON'T COVER ALL THE ENDPOINTS SO PEOPLE WILL HAVE TO RESORT TO RAW HTTP REQUESTS INSTEAD OF USING MY SDK AND ALSO I'MMA MAKE DEVELOPERS FILL 2 VERY DETAILED FORMS, REQUIRING PERSONAL DATA AND ACTUAL REAL PHONE CALLS, JUST TO START DEVELOPMENT WITH 7 DIFFERENT AUTHENTICATION TOKENS, BECAUSE SOME REQUESTS WILL REQUIRE A DIFFERENT AUTHENTICATION METHOD THAN THE OTHER REQUESTS DESPITE ALL OF THEM PERTAINING TO THE SAME FUCKING ENTITY"3
-
JSF: Yeah, we make it so can focus on what's important and you never have to write HTML or CSS like those lowly web developers.
Also JSF: You can't nest <h:form> components because nested forms are invalid HTML. Oh, that breaks the composite component you were trying to use? Ha, fuck off.
Primefaces: You know how you can just provide an ID and OverlayPanel will open on its own? Well, for a Dialog, the API is completely different. Here's a glob of JavaScript in an onclick event.
I swear this entire thing was regurgitated by a murder of seagulls.1 -
I am writing an api to get data from another api, mix it with some data from a database and then send it back.
I am using nodejs (javascript) to write it but I would like to learn something new. Can you recommend me any languages that I could use for my backend? I was thinking maybe go but I am open for ideas.10 -
Working on an Android app for a client who has a dev team that is developing a web app in with ember js / rails. These folks are "in charge" of the endpoints our app needs to function. Now as a native developer, I'm not a hater of a web apps way of doing things but with this particular app their dev teams seems to think that all programming languages can parse json as dynamically as javascript...
Exhibit A:
- Sample Endpoint Documentation
* GetImportantInfo
* Params: $id // id of info to get details of
* Endpoint: get-info/$id
* Method: GET
* Entity Return {SampleInfoModel}
- Example API calls in desktop REST client
* get-info/1
- response
{
"a" : 0,
"b" : false,
"c" : null
}
* get-info/2
- response
{
"a" : [null, "random date stamp"],
"b" : 3.14,
"c" : {
"z" : false,
"y" : 0.5
}
}
* get-info/3
- response
{
"a" : "false" // yes as a string
"b" : "yellow"
"c" : 1.75
}
Look, I get that js and ruby have dynamic types and a string can become a float can become a Boolean can become a cat can become an anvil. But that mess is very difficult to parse and make sense of in a stack that relies on static types.
After writing a million switch statements with cases like "is Float" or "is String" from kotlin's Any type // alias for java.Object, I throw my hands in the air and tell my boss we need to get on the phone with these folks. He agrees and we schedules a day that their main developer can come to our shop to "show us the ropes".
So the day comes and this guy shows up with his mac book pro and skinny jeans. We begin showing him the different data types coming back and explain how its bad for performance and can lead to bugs in the future if the model structure changes between different call params. He matter of factually has an epiphany and exclaims "OHHHHHH! I got you covered dawg!" and begins click clacking on his laptop to make sense of it all. We decide not to disturb him any more so he can keep working.
3 hours goes by...
He burst out of our conference room shouting "I am the greatest coder in the world! There's no problem I can't solve! Test it now!"
Weary, we begin testing the endpoints in our REST clients....
His magic fix, every single response is a quoted string of json:
example:
- old response
{
"foo" : "bar"
}
- new "improved" response
"{ \"foo\" : \"bar\" }"
smh....8 -
Any other Screeps players here?
for the people running into a "Screeps is not defined":
Screeps is a MMO RTS where you code your "army" to do stuff in Javascript (a la NodeJS).
Code how your harvesters should behave, how your soldiers should behave, how your builders should behave etc. etc.
So far, it is quite a fun game, tho my (Intel Nehalem based) laptop has issues handling it (thanks to a awfully slow GPU...) so it's difficult to play for me at the moment (I'm on holiday, my home PC is a LOT faster).
It costs about 15 euro on steam, and if you're into this stuff, it's well worth it.
Just make sure you finish the tutorial first... I didn't and I regretted it when I bought the game (it's a huge pain in the buttocks to get started if you don't understand the API and such).
Currently just playing on my own localhosted private server to discover how the game works and such, but will be setting up a public server later down the road to play with others.
Tho it would be nice if Screeps would allow for "team-based" gameplay as well so it'll be slightly harder for early players to bully the newer ones.2 -
I am so 😢🤒😡 right now. I applied for a remote job, so they gave me an assessment and the language was c++. The funny thing is that c++ was not in my resume.
So I decided to explore c++. "I don't know what the fuss is, C++ is not so hard". It was very easy for me to grasp. It took me two days to understand it.
Then I did one of those online test and I scored 58/60.
Now I went back to take the assessment test on C++ but lo and behold the assessment is now on Rest API.
But Rest API is also not on my resume. They are not assessing me on my strengths like Java or kotlin or python or my my lesser strengths like C# or JavaScript.9 -
This was originally a reply to a rant about the excessive complexity of webdev.
The complexity in webdev is mostly necessary to deal with Javascript and the browser APIs, coupled with the general difficulty of the task at hand, namely to let the user interact with amounts of data far beyond network capacity. The solution isn't to reject progress but to pick your libraries wisely and manage your complexity with tools like type safe languages, unit tests and good architecture.
When webdev was simple, it was normal to have the user redownload the whole page everytime you wanted to change something. It was also normal to have the server query the database everytime a new user requested the same page even though nothing could have changed. It was an inefficient sloppy mess that only passed because we had nothing better and because most webpages were built by amateurs.
Today webpages are built like actual programs, with executables downloaded from a static file server and variable data obtained through an API that's preferably stateless by design and has a clever stateful cache. Client side caches are programmable and invalidations can be delivered through any of three widely supported server-client message protocols. It's not to look smart, it's engineering. Although 5G gets a lot of media coverage, most mobile traffic still flows through slow and expensive connections to devices with tiny batteries, and the only reason our ever increasing traffic doesn't break everything is the insanely sophisticated infrastructure we designed to make things as efficient as humanly possible.11 -
I was talking to a friend about the current state of machine learning through tensorflow and commented about the use of Javascript as a language.
He discarded the idea as he views Javascript as something that should only be used as a frontend technology rather than something to build backends or deep learning models.
I am thorn. I have always liked Javascript but will admit that I have used it mostly in the area of front end with very few backend instances(i did create a full stack intranet app in Express once, major success for the application it was hosting, it was a very basic api which had its own nosql db with no need to interact with the company's relational data, it was perfect for the occasion and still help maintaining it from time to time)
My boi states that node's biggest issue has always been npm and the quality of packages. I always contradict those statements by saying that if one uses community standards and the best packages then one does not need to worry about the quality(i.e mongoose over some unmaintained mongo wrapper etc)
I sometimes catch myself finding that my way of thinking adapts better to JS than it even does Python (which is his preference for deep learning) and whilst there are some beastly packages for python in terms of quality and usefulness such as matplotlib etc that one can do great things with the equivalent JS.
I mean, tensorflow.js came from the same wizards that did tensorflow (obviously) and i find the functional approach of JS to be more on par with how we develop solutions.
I am no deep learning expert, and sadly I have no professional experience with machine learning. But I venture to say that we should not cast aside the great strides that the JS community has done to the language in terms of evolution and tooling. Today's Js is not your grandaddy's Js and thinking that the language is crippled because of early iterations of the language would be severely biased.
What do you guys(maybe someone with professional experience) think of Js as a language for machine learning?
Do you think the language poses something worth considering in terms of tooling and power for ml?2 -
It's been a while DevRant!
Straight back into it with a rant that no doubt many of us have experienced.
I've been in my current job for a year and a half & accepted the role on lower pay than I normally would as it's in my home town, and jobs in development are scarce.
My background is in Full Stack Development & have a wealth of AWS experience, secure SaaS stacks etc.
My current role is a PHP Systems Developer, a step down from a senior role I was in, but a much bigger company, closer to home, with seemingly a lot more career progression.
My job role/descriptions states the following as desired:
PHP, T-SQL, MySQL, HTML, CSS, JavaScript, Jquery, XML
I am also well versed in various JS frameworks, PHP Frameworks, JAVA, C# as well as other things such as:
Xamarin, Unity3D, Vue, React, Ionic, S3, Cognito, ECS, EBS, EC2, RDS, DynamoDB etc etc.
A couple of months in, I took on all of the external web sites/apps, which historically sit with our Marketing department.
This was all over the place, and I brought it into some sort of control. The previous marketing developer hadn't left and AWS access key, so our GitLabs instance was buggered... that's one example of many many many that I had to work out and piece together, above and beyond my job role.
Done with a smile.
Did a handover to the new Marketing Dev, who still avoid certain work, meaning it gets put onto me. I have had a many a conversation with my line manager about how this is above and beyond what I was hired for and he agrees.
For the last 9 months, I have been working on a JAVA application with ML on the back end, completely separate from what the colleagues in my team do daily (tickets, reports, BI, MI etc.) and in a multi-threaded languages doing much more complicated work.
This is a prototype, been in development for 2 years before I go my hands on it. I needed to redo the entire UI, as well as add in soo many new features it was untrue (in 2 years there was no proper requirements gathering).
I was tasked initially with optimising the original code which utilised a single model & controller :o then after the first discussion with the product owner, it was clear they wanted a lot more features adding in, and that no requirement gathering had every been done effectively.
Throughout the last 9 month, arbitrary deadlines have been set, and I have pulled out all the stops, often doing work in my own time without compensation to meet deadlines set by our director (who is under the C-Suite, CEO, CTO etc.)
During this time, it became apparent that they want to take this product to market, and make it as a SaaS solution, so, given my experience, I was excited for this, and have developed quite a robust but high level view of the infrastructure we need, the Lambda / serverless functions/services we would want to set up, how we would use an API gateway and Cognito with custom claims etc etc etc.
Tomorrow, I go to London to speak with a major cloud company (one of the big ones) to discuss potential approaches & ways to stream the data we require etc.
I love this type of work, however, it is 100% so far above my current job role, and the current level (junior/mid level PHP dev at best) of pay we are given is no where near suitable for what I am doing, and have been doing for all this time, proven, consistent work.
Every conversation I have had with my line manager he tells me how I'm his best employee and how he doesn't want to lose me, and how I am worth the pay rise, (carrot dangling maybe?).
Generally I do believe him, as I too have lived in the culture of this company and there is ALOT of technical debt. Especially so with our Director who has no technical background at all.
Appraisal/review time comes around, I put in a request for a pay rise, along with market rates, lots of details, rates sources from multiple places.
As well that, I also had a job offer, and I rejected it despite it being on a lot more money for the same role as my job description (I rejected due to certain things that didn't sit well with me during the interview).
I used this in my review, and stated I had already rejected it as this is where I want to be, but wanted to use this offer as part of my research for market rates for the role I am employed to do, not the one I am doing.
My pay rise, which was only a small one really (5k, we bring in millions) to bring me in line with what is more suitable for my skills in the job I was employed to do alone.
This was rejected due to a period of sickness, despite, having made up ALL that time without compensation as mentioned.
I'm now unsure what to do, as this was rejected by my director, after my line manager agreed it, before it got to the COO etc.
Even though he sits behind me, sees all the work I put in, creates the arbitrary deadlines that I do work without compensation for, because I was sick, I'm not allowed a pay rise (doctors notes etc supplied).
What would you do in this situation?4 -
I love to develop for the web, i find JavaScript a nice language and I love the unmatched flexibility of the web platform but i hate when I have to work with the unstable or badly documented APIs which seems to be the norm in the enterprise world: wasting hours in forced breaks because suddenly the API returns nothing but 503 or the VPN suddenly dies, wasting lot of time to find the documentation you need in the slow and cumbersome enterprise API manager, making lots of tests with cURL/Paw/Postman/wethever trying to find out why a request which should work just doesn't... in these moments I envy desktop and mobile devs. The worst part of it is which microservices made everything worse since nowadays there are way more "moving parts" which can break making the API you need unavailable and unlike with monoliths often it's hard to just clone a back-end, populate a database and then work fully locals since now everything depends on a lots of things which are hard/almost impossible to replicate on your laptop.1
-
I'm new to javascript and I'm doing the freecodecamp. I was doing a challenge and I was looking everywhere how to fix my problem (I needed to use an API from another page) turns out all I needed to do was add the Jquery library, I've been stuck with this for HOURS FML4
-
How long does it take you guys to learn Node JS?
My professor wants me to work for him on a CRUD Server for a semester, I have some experience with JavaScript and API programming with Spring Boot. Should I take the offer and learn more about Node at home?
I think I will feel like an imposter if I take the offer if I don't have any previous experience in the stack11 -
Its fucked up when you get null as a fuckin string ("null") from backend API and it breaks your javascript code
:/2 -
Part of my job requires me to use SQL in SQL Server and databases and Python and utilising Javascript APIs - so I was thrown in at the deep end. But my fiancé is also an amazing help as a software engineer he helps to spot my errors and encourages me to take on new challenges.
-
Have you worked with GraphQL? Saw it for the first time and it looks like a pretty good tool for working with APIs, to me. I am excited to read your opinions about GraphQL.23
-
tl:dr
i fucking hate that professor for whom i have to work on laboratory project right now.
reason#1
the project is using a stack full with java. JavaScript. react and some weird facebook api of which i have no clue about. not to mention the server side of this application which uses tomcat (ok its java after all) and sql.
well that wouldn't be not so bad if...
reason#2
we wouldn't have to fucking debug his mistakes he put into the fucking prepared code AND his fucking useless instructions how to set up the project for eclipse the first time. not to mention his fucking requirements which make no sense
oh yeah im a student. i can always go and ask him for help if i need any...
reason#3
i have another 70% mandatory course at the same time and that fucker refuses to upload hos sheets in moodle and answer even one fucking question via mail. not to mention no support if I am there unless i have eclipse setup. even through the projects should be build using gradle...
reason#4
oh. and have i mentioned that this course is only about design patterns? uts not like we could see several of them in a java only application. no we literally have to learn java itself. gradle. nodejs JavaScript Extended for react which i have no clue about at the moment... and yes i especially mentioned gradle and nodejs beccause we have to set shit up and not only use a script.
reason#5
and all that wont even give us a grade. no ita simply a pass or fail part of the module which the course is part of.
have i also mentioned that the whole shit should be done in 20 hours according to the schedule8 -
> unemployed (took a break)
> not gonna go back to the old company
> applied to another job, awaiting a response
> canceled Netflix
> Meanwhile doing small projects for myself, teaching like PWA and Web Notification API, focusing on javascript
> doing small time work (providing WordPress websites), not really proud of it, but only that works here for a small time3 -
I started building an application for FIDAL (Italian Federation of Athletics) because why not: I was bored and wanted to learn Flutter.
There is no API, but I didn't even expect it. Parsing the HTML is easy enough.
BUT OH MY GOD THE ENTIRE WEBSITE IS SHIT. Take this page: http://www.fidal.it/graduatorie.php, it uses some useless jQuery plugin and uses a buttload of JavaScript that isn't even needed. BUT WAIT. Try entering an invalid "club code" (http://fidal.it/graduatorie.php/...), a FUCKING white page with 200, are you kidding?
I'd also like to mention that all pages that require form input won't load correctly if you don't include "submit=Invia" in the URL.
I am not giving up.3 -
Most interesting bug (recently at least)... In JavaScript, you can create a date with new Date(dateString).
...if it starts with the year or is ISO format, it will take the user's local timezone into account. if you did something like new Date('6-Jun-16') it doesn't care about time zones... so depending on how we passed a date via the api, we'd get a different actual date.4 -
The Coding Apocalypse: A Dev's Rant
June 14, 2024
Okay, gather ’round, fellow code warriors, because it’s time for a good ol' developer rant. If you're reading this, chances are you’ve already faced the dragon that is modern software development, and you’re somehow still using "Agile" as a life preserver while the ship is sinking. So let's dive into the chaos that our world has become.
Here’s the thing: We’re living in a paradox where every other day there's a shiny new framework promising to be the “ultimate solution” while ignoring that it's just recoil from the last big mess. I mean, can we talk about JavaScript for a second? I’m pretty sure if you stand still long enough, a new JavaScript framework will spontaneously generate from the void. Do we really need another one?
And don’t get me started on Sprint Planning. It’s like playing Tetris with stones while blindfolded, hoping that all the blocks land perfectly. Spoiler: They don’t. The product manager’s eyes glaze over as they nod approvingly to your estimates, secretly extending deadlines in their minds. The 'flexible' deadlines then become rigid, unattainable goals, and who gets the heat? The devs, of course.
Also, can we address the insanity of microservices? Sure, splitting a monolith into microservices sounds fun—until you’re drowning in API calls and Docker containers. Debugging a distributed system is like trying to untangle a pair of headphones made of spaghetti.
Oh, and if one more person asks if we’re "leveraging AI" and "blockchain technology" for our simple CRUD app, I might lose it. Sometimes, folks, the wheel doesn’t need reinventing. It just needs a little grease.
Finally, remote work. Blessing and curse. Sure, I enjoy the freedom of working in my PJs, but the endless Zoom calls are killing my soul. Breakout rooms? More like breakdown rooms. The Slack notifications? Let’s just say my sound settings have a hair trigger on mute these days.
So here’s to us, the devs. The ones who stare into the abyss of JIRA tickets and laugh in the face of mounting tech debt. May your coffee be strong, your code refactored, and your deployments ever in your favor.
End rant. Back to the trenches. 🚀💻6 -
It's my first rant. So please ++1 me.
Now my rant:
In this semester I had a subject about system architecture. In this class, we must learn Java script, C# (and ASP.NET framework ), PHP (and Zend Framework 2), but in the classes is taught only UML and patterns. In the moodle of the subject we don't have any information about any of the languages and if we ask the teachers they don't know anything.
And we need in 4 weeks do a work with a widget in javascript, 2 Asp.net mvc, 1 asp.net web api. All with authentication.
So we are all fucked10 -
Most actual GraphQL explanation:
1. Still uses your xhr/fetch/axios on FE
2. Just sends all the requests to single endpoint
3. On BE uses its own resolution schema to call proper controller to handle the request, rather than relying on router for that
That's all!
Just another useless layer of abstraction with its learning curve, tricks and bugs as ORMs are9 -
its hard to keep yourself updated with apis, specially when you are nodejs/javascript developer.
Creating a simple application to keep track of changes in api and inform the subscribers about changes.
Stack - Vue.js (quasar), nodejs, mongoDb3 -
I spent 2 weeks at work building a dashbord (not a feature but...) wich provided an overview of projects and tasks managed in redmine (Kanban tool) by using its API. After i finished it we started using it till my boss found out that it was completly "useless" for him - it had all the features he asked for! -.- ...
three days later the redmine server crashed and we changed the provider, nobody missed my dashboard and so it got abandoned :( sometimes i miss it, it looked fancy af and stuff!!
But at least i learned a lot of js and API stuff. I was verry new to js back then :)
Boss asked -> I deliver -> and *pooff* down the river it goes. seems like my tasks have not changed much since then. -
Can we take a moment to recognize how absolutely retarded JS' event system is?
Events aren't objects. No, they're managed by an object, and identified by a string.
To subscribe to an event, you call object.addEventListener(name, callback). Because for some reason we can't just have an event object. Events MUST have an owner.
But to unsubscribe you don't call the function addEventListener returned, you don't use the token it returned either. No, you pass the same function to removeEventListener.
Because we don't use serializable tokens like in PP, and we don't return functions like in FP, no, we use functions as tokens, realising idiomatic DFP.2 -
Small rant because I’m new here, but…I hate async functions in JavaScript.
Especially when dealing with an API.14 -
I don't get why the company where I work is pushing a new cloud platform to create website with.
So yesterday I dove in a website(that an intern made) to make a search and filter on some items.
I thought sure, just finished a website with a lot of search thingies and filters.
But this intern wrote 500 lines of code to just get items from an API endpoint. Dude really why??? Ok, your cool an all and you definitely have skills, but this is just ridiculous.
Burned an day on the piece of shit, while this is in an stupid cloud platform. Without even es6 to write JavaScript. I could have write the whole thing in react In just one day!!
Just work locally on your machine and put you code in a git repo. And deploy when finished. That how I like to work, but no this company wants to keep pushing this cloud platform.
For fucks sake, just let me code! And don't let me use vs or that stupid cloud platform.4 -
Yesterday, the Project Manager forwarded an email from a staff member who worked on a donations campaign. Staff member was confused about a Cloudflare challenge that appeared before the user was sent to the donation page. It’s a less than 5 second JavaScript check. He thought it looked fishy.
I had to explain that it’s a security measure that’s been up for almost a month. PM knows this but left it to me to explain because ownership of the site is on me. The donations page and api gets hit by a lot of bots because it’s a public api and there are no security measures like captchas to deter the bots. I’m inheriting this website and I didn’t build it.
Staff member says other staff want to know if the Cloudflare page can be customized so it looks more legit. Um, Cloudflare is a widely known legit service. Google it.
A few thoughts pop into my head:
1. Engineering communicated to stakeholders about the Cloudflare messaging a month ago.
2. Wow, stakeholders don’t share relevant info with their staff who aren’t on these emails.
3. Woooow, stakeholders and staff don’t look at the website that often.2 -
Trying to make a site that requires an external API and that API limits you to certain calls per certain time before they ban you for 24 hours and asking yourself how not to get banned :| *I'm new to webdev*6
-
I'm a Python programmer and I've been asked to build API's using Nodejs. It's been dofficult to even get the API running. Any advice on how to start? I am familiar with JavaScript7
-
My work product: Or why I learned to get twitchy around Java...
I maintain a Java based test system, that tests a raster image processor. The client is a Java swing project that contains CORBA bindings to the internal API of the raster image processor. It also has custom written UI elements and duplicated functionality that became available in later versions of Java, but because some of the third party tools we use don't work with later versions of Java for some reason, it's not possible to upgrade Java to gain things as simple as recursive directory deletion, yes the version of Java we have to use does not support something as simple as that and custom code had to be written to support it.
Because of the requirement to build the API bindings along with the client the whole application must be built with the raster image processor build chain, which is a heavily customised jam build system. So an ant task calls out to execute a jam task and jam does about 90% of the heavy lifting.
In addition to the Java code there's code for interpreting PostScript files, as these can be used to alter the behaviour of the raster image processor during testing.
As if that weren't enough, there's a beanshell interface to allow users to script the test system, but none of the users know Java well enough to feel confident writing interpreted Java scripts (and that's too close to JavaScript for my comfort). I once tried swapping this out for the Rhino JavaScript interpreter and got all the verbal support in the world but no developer time to design an API that'd work for all the departments.
The server isn't much better though. It's a tomcat based application that was written by someone who had never built a tomcat application before, or any web application for that matter and uses raw SQL strings instead of an orm, it doesn't use MVC in any way, and insane amount of functionality is dumped into the jsp files.
It too interacts with a raster image processor to create difference masks of the output, running PostScript as needed. It spawns off multiple threads and can spend days processing hundreds of gigabytes of image output (depending on the size of the tests).
We're stuck on Tomcat seven because we can't upgrade beyond Java 6, which brings a whole manner of security issues, but that eager little Java updated will break the tool chain if it gets its way.
Between these two components we have the Java RMI server (sometimes) working to help generate image data on the client side before all images are pulled across a UNC network path onto the server that processes test jobs (in PDF format), by reading into the xref table of said PDF, finding the embedded image data (for our server consumed test files are just flate encoded TIFF files wrapped around just enough PDF to make them valid) and uses a tool to create a difference mask of two images.
This tool is very error prone, it can't difference images of different sizes, colour spaces, orientations or pixel depths, but it's the best we have.
The tool is installed in both the client and server if the client can generate images it'll query from the server which ones it needs to and if it can't the server will use the tool itself.
Our shells have custom profiles for linking to a whole manner of third party tools and libraries, including a link to visual studio 2005 (more indirectly related build dependencies), the whole profile has to ensure that absolutely no operating system pollution gets into the shell, most of our apps are installed in our home directories and we have to ensure our paths are correct for every single application we add.
And... Fucking and!
Most of the tools are stored as source bundles in a version control system... Not got or mercurial, not perforce or svn, not even CVS... They use a custom built version control system that is built on top of RCS, it keeps a central database of locked files (using soft and hard locks along with write protecting the files in the file system) to ensure users can't get merge conflicts by preventing other users from writing to the files at all.
Branching is heavy weight and can take the best part of a day to create a new branch and populate the history.
Gathering the tools alone to build the Dev environment to build my project takes the best part of a week.
What should be a joy come hardware refresh year becomes a curse ("Well fuck, now I loose a week spending it setting up the Dev environment on ANOTHER machine").
Needless to say, I enjoy NOT working with Java. A lot of this isn't Javas fault, but there's a lot of things that Java (specifically the Java 6 version we're stuck on) does not make easy.
This is why I prefer to build my web apps in python or node, hell, I'd even take Lua... Just... Compiling web pages into executable Java classes, why? I mean I understand the implementation of how this happens, but why did my predecessor have to choose this? Why?2 -
The frontend developers in my company are the reason why I have anxiety. Here are few things that grinds my knees:
1) for a long time in projects, they deleted the auth token from their storage without integrating the logout api. They thought why use an API for that. :)
2) most of them had no clue that form fields could accept javascript as inputs and work as XSS vulnerabilities. This actually happened with a client, he got so fucking pissed.
3) One of them asked me to convert a PATCH request to DELETE cos fuck REST and HTTP methods.
For fuck’s sake. I need to get out of this place.4 -
Why are there so many testing framworks for JavaScript? Jasmine, mocha, buster ... and for spies, stubs and mocks, there is sinon and for assertions, there is chai. And oh you can record entire external api calls with nock and whatever else I forgot. I am a bit overwhelmed by this overambundancy of libraries. Writing tests is supposed to be easy.2
-
Im new to devRant and i’m just looking if i could get any tips, example projects i could do to fill my portfolio? Im trying to sharpen my skills in web dev (both back & front + React)question web development html nodejs react javascript frontend css learning to code expressjs api backend4
-
Maxi-Rant, rest in the first comment!
Yay, I've caught up with my "watch later" list on YouTube! Next thing: Just quickly go through my subscribed channels and add old videos that I haven't seen yet to the watch later list so that I have more stuff to watch the next months. The easiest way to do that is to go to the "all uploads" playlist of the channel (that is luckily always linked now, it used to be hidden sometimes) and use "add all to" to get them on my playlist. Then sort out the stuff that I've already seen and turn on automatic sorting by date, easy. Yeah...
Firstly, in the new design there's no "add all to", I have to go to the old design. For my own playlists, there's a handy "edit" button to do that, but on other pages I have to do it manually. Luckily I have set Ctrl+Shift+1 as a shortcut for "&disable_polymer=true" long ago.
Next surprise: On "all uploads" playlists, there is no "add all to" button. It's on every single other playlist on YouTube, including "liked", "watch later", "favourites" and so on, just not there.
Fine, I'll just abuse my subscription playlist script that I already have by making a copy of it, putting the channel IDs in it and setting the last execution date to 1.1.2001. Little problem with that: Google apps scripts can run for at most 5 minutes and the YouTube API restricts it to add one video per second. So it doesn't work for more than 300 videos. I could now try to split it up by dates, but I didn't write the script myself and I don't know how it sorts the videos to add, so I'll just google for another solution instead.
Found one: Go to the video overview of the channel in the old layout, Ctrl+Shift+I, paste this little Javascript thing and it automatically clicks all the little clocks that add the video to the watch later list. Yay, that works! Ok, i'm restricted to 5000 videos, because that's the maximum size of a YouTube playlist, so I can't immediately add all 8000+, but whatever, that's a minor problem and I'll sort out later anyway. Still another little problem: For some reason I can't automatically sort the watch later list. Because that would be too easy.
But whatever, I'll just use "add all to" from there to add it to my creatively named "WL" list. If that thing is restricted by the same rate limit of 1 video per second, it should be done in about 1½ hours. A bit long, but hey, I'm dealing with 5000 videos. Waiting 2 hours... Waiting 3 hours... Nothing happens. It would be nice if it at least added them one by one, but no, it waits an eternity and then adds all at once. At least in theory, right now it does absolutely nothing.
Shortly considered running it for more hours or even days on my Raspberry Pi, but that thing already struggles when using Chromium normally, I shouldn't bother it with anything that has to do with 5000 videos.
Ok, what else can I do then? Googling, trying out different things, mainly external services that have their own concept of "playlists" and can then add them to an arbitrary playlist later...
Even tried writing my own Java program with the YouTube API, but after about an hour not even the example program in the YouTube API tutorial worked (50 errors and even more open questions, woohoo), so I discarded that idea.
Then I discovered "DiskYT". Everything looked like it would work and I'm still convinced that I can do it with that little pile of shit. Why is it a pile of shit? Well, for example the site reloads itself after a while, so it can at most add 700 videos to a playlist. Also I can't just paste the channel link (even though it recognises those links, but just to show an error message that it can't copy from channels). I can't enter/paste URLs, I have to drag them. The site saves absolutely nothing (should in theory work, but in practise it doesn't), so I have to re-drag everything on every try. In one network, the "authorise YouTube" button (that I have to press again on every computer) does absolutely nothing ("inspect" reveals that there isn't even any action bound to the button), in another network the page mostly doesn't work at all or the button to copy from playlists is suddenly gone or other weird stuff. Luckily I have the WiFi at home, there it works in theory. But just on my desktop PC, no other device, wow. I tried to run it on my new laptop, but it's so new that it still has the preinstalled OS and there I can't deactivate going to standby when closing the laptop, so while I expected it to add 5000 videos, it instead added 4 and went to standby. But doesn't matter, because it would have failed at about 700 anyway. Every time I try to use this website, I get new problems, but it seems to still be the best option, because everything else just doesn't do anything. This page at least got to 700 before.
Continuing in first comment!4 -
I know this is not StackOverflow but is there a way to send TCP packets using JavaScript? I can't find a pretty solution. Why I can't find an API like "sockets" from Python to JavaScript?
Telnet API will be fine too.
Thanks!3 -
think the struggle with javascript comes when you have to deal with JavaScript from another language
then suddenly a u64 is randomly a float and everything crashes
actually pretty sure the API I'm hitting is written in rust and yet... something the docs say is a u64 just returned a decimaled number
I miss JavaScript where everything just works3 -
A very long rant.. but I'm looking to share some experiences, maybe a different perspective.. huge changes at the company.
So my company is starting our microservices journey (we have a 359 retail websites at this moment)
First question was: What to build first?
The first thing we had to do was to decide what we wanted to build as our first microservice. We went looking for a microservice that can be used read only, consumers could easily implement without overhauling production software and is isolated from other processes.
We’ve ended up with building a catalog service as our first microservice. That catalog service provides consumers of the microservice information of our catalog and its most essential information about items in the catalog.
By starting with building the catalog service the team could focus on building the microservice without any time pressure. The initial functionalities of the catalog service were being created to replace existing functionality which were working fine.
Because we choose such an isolated functionality we were able to introduce the new catalog service into production step by step. Instead of replacing the search functionality of the webshops using a big-bang approach, we choose A/B split testing to measure our changes and gradually increase the load of the microservice.
Next step: Choosing a datastore
The search engine that was in production when we started this project was making user of Solr. Due to the use of Lucene it was performing very well as a search engine, but from engineering perspective it lacked some functionalities. It came short if you wanted to run it in a cluster environment, configuring it was hard and not user friendly and last but not least, development of Solr seemed to be grinded to a halt.
Elasticsearch started entering the scene as a competitor for Solr and brought interesting features. Still using Lucene, which we were happy with, it was build with clustering in mind and being provided out of the box. Managing Elasticsearch was easy since there are REST APIs for configuration and as a fallback there are YAML configurations available.
We decided to use Elasticsearch since it provides us the strengths and capabilities of Lucene with the added joy of easy configuration, clustering and a lively community driving the project.
Even bigger challenge? Which programming language will we use
The team responsible for developing this first microservice consists out of a group web developers. So when looking for a programming language for the microservice, we went searching for a language close to their hearts and expertise. At that time a typical web developer at least had knowledge of PHP and Javascript.
What we’ve noticed during researching various languages is that almost all actions done by the catalog service will boil down to the following paradigm:
- Execute a HTTP call to fetch some JSON
- Transform JSON to a desired output
- Respond with the transformed JSON
Actions that easily can be done in a parallel and asynchronous manner and mainly consists out of transforming JSON from the source to a desired output. The programming language used for the catalog service should hold strong qualifications for those kind of actions.
Another thing to notice is that some functionalities that will be built using the catalog service will result into a high level of concurrent requests. For example the type-ahead functionality will trigger several requests to the catalog service per usage of a user.
To us, PHP and .NET at that time weren’t sufficient enough to us for building the catalog service based on the requirements we’ve set. Eventually we’ve decided to use Node.js which is better suited for the things we are looking for as described earlier. Node.js provides a non-blocking I/O model and being event driven helps us developing a high performance microservice.
The leap to start programming Node.js is relatively small since it basically is Javascript. A language that is familiar for the developers around that time. While Node.js is displaying some new concepts it is relatively easy for a developer to start using it.
The beauty of microservices and the isolation it provides, is that you can choose the best tool for that particular microservice. Not all microservices will be developed using Node.js and Elasticsearch. All kinds of combinations might arise and this is what makes the microservices architecture so flexible.
Even when Node.js or Elasticsearch turns out to be a bad choice for the catalog service it is relatively easy to switch that choice for magic ‘X’ or component ‘Z’. By focussing on creating a solid API the components that are driving that API don’t matter that much. It should do what you ask of it and when it is lacking you just replace it.
Many more headaches to come later this year ;)3 -
When you have made too many APIs
Friend : Jay Sean has released an awesome new mix.
You: JSON released what???!!! -
so some controversial opinions
Our company is moving most of our code style to snake_case, even the JavaScript. Here's our resoning:
Take the CustomerAccountMembership model. In our Python server, we would access it as obj.customer_account_membership, in JavaScript as obj.customerAccountMembership and our API endpoint as api/path/customer-account-membership. Thus we had several String utility functions such as `camelize`, `kebabChop` (which is ironically camelCased) and `snakeify`, and we would use them in translating from URL path to JS to Python, which was troublesome.
Now HTTP allows _underscores_ unescaped and do not pose any significant meaning. JavaScript also accepts it as a valid character in variable names. On the other hand, HTTP is strictly lower-cased, and all computer languages use the -dash- to signify subtraction. Sooo the _underscore_ is the only style that is compliant everywhere.
Unless, of course, we go with customeraccountmembership, which I refuse to do.
I'm not that deep into code character rules.
Opinions?7 -
this is not a solution, what the fuck https://github.com/seanmonstar/...
modern era, where a "safe" language can't even do basic bitch network calls right and then you write a retrying loop macro to get around it. yeah I had that already because I didn't have access to reqwest configurations and I think the library I was using to wrap the reqwest calls to the API was doing something wrong. turns out the fucking accepted by a damned GPT bot solution is to JUST KEEP RETRYING?!
WHY IS IT SENDING TERMINATE CONNECTION MESSAGES RANDOMLY
unfathomable. one of the most popular crates on rust. maybe they should care less about their cult and more about their ridiculous-to-have bugs
remember kids, javascript is the devil, JavaScript is ugly, messy, you have brain cancer if you use JavaScript. at least it can do network calls properly without you having to make retry loop MACROS (because the generic system sucks) all over your code!2 -
Bloody cunts at Twitter could provide the fucking grammar for their filtering rules...
Now I have to write the grammar for the lexer and the parser from scratch (in fucking JavaScript to boot 😡).
Mind you, I know my lex and bison, but I haven't done this shit in fucking ages, and the combo of JavaScript debauchery and being rusty, is making me want to send angry tweets to Elon musk, see if they can provide decent tools for their shit API.3 -
Not a bad experience per say, but it was the only one I have been to so far...
Went to a hackaton with my friend for the Amazon Alexa and we were asked to create a skill in 30 minutes.
My friend and I had never used JavaScript or the Alexa API but we came up with the idea of having Alexa respond with a voice clip of Larry David saying "pretttay prettay good" from Curb Your Enthusiasm.
Unfortunately we couldn't get the error regex or something thing on Alexa to recognise video URLs but we still likely our idea 🙃 -
I think I've asked this before. Just cropped up again cuz I'm pushed to do some stuff in nextjs
I Wonder how much longer before js framework devs realise they've been reverse engineering the browser this whole time, that the current browser spec was outdated since the dawn of Web fidelity and real time applications
I wonder whether there are some guys who have seen this and are already cooking in the background. The browser still treats the Internet like front end and back end, whereas with the way apps are going (eg deprecation of the front/back end roles), it seems apparent the browser needs to scale up by fading whatever js is now
I'm seeing "use server", which was one of php's infamous atrocities back in the day (lack of separation of concerns, everything in index.php). It's shocking how those who ridicule that language let this fly, but that's probably a separate thread. Point is, a bunch of these stuff done by front end frameworks seem like boilerplate but the syntax is far different from what I remember javaScript to be. I only vaguely recollect and understand what I'm reading
Why not merge all the cryptic syntaxes struggling to achieve bare minimal expectations, into advanced markup language controlled by dom attributes? Overhaul and Rethink client - server communication to fit modern standard. Someone needs to step out of the box and take a good look at the rat race. I find our lives would be made much simpler if api integration into client side behaviour wasn't a separate thing altogether
You have all these funny hoops and precarious bridges to cross. The reality is what we're fighting to overcome is the manner the architecture is setup. We need a Google/meta/amazon/apple to step in with a new browser since it's not a weekend gig and might need their reach to catch on with mainstream users. Sadly, they're the same guys rolling out new js frameworks2 -
Alright so this is just me throwing my thoughts down from today cause I need some outlet.
Gonna start programming a lot more than I do now cause I want to improve and I enjoy it.
I started my JavaScript course and that's going well so far. I need to figure out a way to make the info stick. I'm gonna def use the projects from each day as resources though.
I need to practice python (which I'm good with) occasionally so I dont lose my magic touch. I was thinking of doing a project on a raspberry pi that uses a camera for object/facial recognition and picking projects like that and occasional small ones I do in js.
Although theres still a lot I have to learn on the DOM side of js. I dont want to be a front end dev cause I dont have that artistic eye so I'm mostly gonna use it for node and small front end stuff
But mostly I need to be able to grasp more from tutorials, examples, courses, etc. And understand how and when and why I should use whatever it is.
Also I wanna use someones code to learn but it's never documented well enough for me to know what's happening I'm mostly referring to when theres a library or api I'm unfamiliar with.
Also JS is getting a little boring so hopefully python will help dull that feel6 -
What exactly is a full-stack developer/engineer? I'm confused.
So, I worked as a freelance webdev for a US company where I redesigned a pretty complicated website from scratch with PHP, mysql, JavaScript, CSS, HTML5. I only mention those because it will important later.
Basically, it's a lame mvc framework I wrote which heavily relied on AJAX and bootstrap modals.
I built from mysql <=> PHP -> UI
I Also built an android app that communicates with the php api
I worked for 4.6 years and they were kind enough to give me the designation "Full Stack Engineer" so I could put that on my resume. Alright, cool.
Then I go to this interview and one interviewer took offense. He told me that, there are 3 tiers of web dev; Database, Backend shit and UI. And I'm not a full-stack engineer. He then asked me if I worked with frameworks like laravel, symphony etc. [I did but not in this project]. I didn't know what to say. The other interviewer tried to help me, "Do you know what it means? Or have you ever worked with React.js or Angular?".
Didn't get the job and I'm so embarrassed and just feel like I'm a fraud. How could I not know what full-stack is? And why did I put it in my resume? Fuck!
Anyway can anyone tell me what "full- stack *" is?
>inb4
>incoherent
>bad engrish
Just fuck my shit up fam5 -
everything is going as planned! :)
Learned Rust Lang. i loved it (that doesn't mean i am done learning na? No! never stop)
new language i could do game memory hacking in without worrying about C++ memory leaks or issues. it also compiles to assembly! another of my favorite languages!
(i use rust for game development and other stuff)
i am not leaving C / C++ though that would be harsh!,
i abandoned javascript for react and typescript.
to be honest the developer just made javascript and left us with a [object Object]
finished learning the android java api so im basically set anything i want to make i can just go on my pc, listen to music and write it out in a couple of days.
well phazor what are you going to do now?!
i will code till i am old.
i will leave my mark like a shid that made its skid in the bowl :)5 -
I'm moving from back end C#(self taught) and want to learn how to build effective ecommerce and administration sites. I've built a few web apps with old ASP.Net tech before but not MVC, I'm gonna dive right into MVC 6, what's all the fuss about Angular JS? I suppose I'll have to pick up 1 javascript(arghh! ) API, which is the most mature and/or best for rapid design and easy data management?1
-
Gonna start a web dev side project for my D&D guild to monitor gameplay and build characters. Anyone know of a D&D API for spells and such?1
-
I spent three days debugging an API endpoint because in this framework, a "function not in scope" error fails silently. The only way to find out that this issue was happening was to drop the entire endpoint handler into a try/catch block.
Guys.
JavaScript is the shittiest fucking language.3 -
Our lead dev has convinced the board to move the new software suite forward into .Net Core 3. Much of his reasoning is sound, a mainstay of which is the cost and ease of hiring developers to actually make and maintain it.
My own roadmap with the company focuses around one of these products, so I am to become the core developer and maintainer. Given thats the case, given that my primary skill is with Javascript/Node and given that we have deadlines, I am going to make the case today that this product might be better built in Node.
We are going for a microservices architecture. Combined with Typescript for type safety as the code base gets bigger, I am not sure I can think of many real advantages to choosing .NET instead. It will benefit from its async I/O later too, as the plan is to build in API driven dynamic UI down the road.
He is a fierce man, and I am the junior. Wish me luck.7 -
Did an interesting experiment a few days ago, I counted the lines of code in my dissertation project. My project consists of a cloud hosted web service which allows video streaming, search and upload, as well as an iOS frontend which allows users to record their own video and upload it. The entire project spans about 2,400 lines of code. Then I looked in my work iOS project and saw a JavaScript file for manipulating form elements which spans about 2,100 lines of code. The whole project is about 100,000 lines of code and doesnt do anything special, it just calls a web API and saves/displays results mainly.
The effect of “Enterprise Architecture”1 -
!rant apologies
I am a third year computer science student and I'm interested to see how professionals think I stack up against grads they have worked with straight from uni.
I have spent 15 months at a web company working on bespoke solo products on LAMP stacks. I know html, css, JavaScript and its library JQuery very well (I know JavaScript is massive to be saying I know it well)
I am reasonable at PHP and MySQL. Currently I am studying node.js and building an api that mashes up data from other APIs to build a new service. I'm also working on a C# Microsoft framework bespoke website. I know git to a reasonable level - branches, merges, rollbacks and all that jazz.
I am also studying development architectures to try and be more useful.
So if you guys came across a new grad that knew HTML, css, JavaScript, JQuery, maybe angular js, PHP, basic Linux commands, MySQL, C#, dev architectures, agile methods, node.js, git and has 15 months experience working on small to medium sized solo projects would you want to hire them?
Point to note I'll probably graduate first class (80%+) from a mid range uni.
Sorry, I know this is not the place but I like this community.5 -
So, some of you know that I'm having struggle manipulating Youtube iframes with jquery or plain javascript, please note that the same thing can be done via YouTube API but I personally do not want to rely on API,
So after 2 days of struggling I've officially given up, I feel so fucking angry and sad at the moment I can't even describe.
For some solutions to work I need SSL certificates.
the closest I could get was $(iframe#youtubeiFrame)['content'];
This leads to the youtubeIframe root #document but I am unable to access that DOM
Next task, to configure another IDE except Eclipse for Demandware.
$options = array('Aptana'=>'IDE','IntelliJ=>'IDE','VSCode'=>'textEditor'); -
Here's a fun fact (which actually will be accompanied with a source) about node.js. When you import or require a module it will be imported as a singleton. Or put another way, ```export const Foo = { };``` is one of the simplest* and most readable singletons you can have in that runtime. And of course here's the thing you always should be asking for when people make a claim like this https://nodejs.org/api/...
So why write this? Well some of you might feel inclined to write a medium (or other) post about "design patterns in Javascript" where you basically just translate the GOF book from Java to Javascript and now you have something that isn't just awkwardly translated Java code! -
Anyone knows if it is possible to do SOAP API with Javascript and bypass CORS, or work with it? if not **** this4
-
You know it's friday when you don't know how to name a file and you end up with: call-not-api.js... cause call-api is taken and it's not really an api
-
I want to make a fancy 3D game for an assignment. Would it make sense to separate the game content completely from the engine? The way I imagined it, there would be a game folder with all the content in it (textures, shaders, scenes, scripts etc...) and the engine would "load" this folder, construct the scene and run the game. I was even thinking of using a lightweight scripting language for the game logic, like javascript, so I don't have to make an api and compile DLLs, and the engine (written in c++) would communicate with these scripts.
Is this a good design, or should I just put everything in one project so both the engine and the game logic compile to a single exe?10 -
Didn't know maps api integration...
Didn't know markers allocation..
Didn't know geolocation..
JavaScript llbit..
Still implemented...
Love you google..stackoverflow..:-p -
Ugh, retrieving specific data fields nested within several arrays and objects in Javascript/Json jacks me up every fucking time!!!
Anyone ever fuck with the MapQuest geolocation/geoqueries api??
I'm trying to retrieve the lat/lng values out of responses generated from submitted address strings, and it's nested about 8 json layers deep.
I feel like I'm overthinking this?
I can access the values in my web console, and can reach them after using the console to assign them to a temp var, but can't get to the values from my actual js code. Only when I run some business logic from the console.
Here's a shitty example of me explaining the tree:
[{...}]
0:
locations: Array(3)
0:
latLng:
lat: <data here>
lng: <data here)1 -
Quickie... :D
I'm competent at back end (in Java) but need to whip up a Web front end. Aim is a simple but beautiful UI for admin settings and basic stuff like that, but might extend to some visuals for graphs etc.
Back end already exposes a RESTful API (JAX-RS).
Question is, should I be looking into serverlets and Javascript? I've used Bootstrap a little (and will probably use this)?
Given that there appears to be about a million front end frameworks, where would you suggest I head given the use case above?7 -
!rant more advice needed for weather API
I am making a spur of the moment travel app built around a weather API. The problem is I need to feed in temperature and humidity for a date and get a list of countries and all the APIs I'm looking at work on location requests.
So, I plan to solve this using a JavaScript webworker and set intervals to build my own database that I can query.
Would it be better to use a script external to my API or keep the business logic internal?
Best answer receives my warm thanks.
P.S. @dfox there should be a non rant section?6 -
So i am at an MNC as a summer internship, me along with 18 other students from my university cleared this hackathon and got selected for this internship,
Few things you should know
1. Amongst all the other candidates i had the most work experience
2. I had worked with a lot of python and JavaScript
3. I legit have more skills then almost everyone working in my team
So, I don't know how but the HR decided i should go to this team, where there are no developers and are people of age 30 who have no idea what django is,
I was fucking frustrated but i let it go, thinking i will just solve this problem and will change my team, calm down
They told me about the project. I said okay give me access i will just finish it.
5 days no signs of access anyhow, so, i sucked it up and tracked all the network request and made my own api,
Then I was happy i get rid of this project,
But then they had bigger plans they ask me to add features on this project but there is a catch you have no access to any accounts, do it on your own,
Like What the Fuck, before giving an intern any project don't you have the responsibility to check weather the fucking project is possible i am just wasting my summer internship. I thought I got a big company it will help me grow i will get job security, but noo wtf, i am hell of frustrated1 -
Hi dev friends, just wondering if any of you guys can point me in the right direction as to which Google API I need to get street names and addresses from postcodes entered in to a web form. Is it geolocation? Thanks in advance if you can save me a lot of time wading through Google documentation.5
-
I'm building a nodejs REST api with jwt token authentication for the first time. So far, it's been as smooth as butter. Any hiccups or gotchas I should worry about?
-
WTF?
W_T_F?
W-T-F?
W$T$F?
how the fuck do you brand codebases?
say you've got a brand called dicks,
and you've got a website, api server, some SDK's, and whatever else. How do you format the codebase names so it's A, usable as a variable name, B clickable at the variable part of the name, C, that's fucking it
dicks-website can't be used in js because
dicks-website = require('dicks-website') won't work
dicks_website can't be used in url's and in general because double clicking any part will select the whole word, so you can't replace dicks_X easily.
dicks$api seems to work, dicks and api are seperately clickable, and usable as a variable in javascript. I already know that the $ sign probably fucks up many many systems so that's probably a no go
has this question been addressed already?4 -
I made a telegram bot that gives cov19 statistics for every country around the world.
Check it, i name it @elbaronbot -
I'm making a distributed system for my exam project, but the client have a weird idea when it comes to the webpage, that we havent learned about...
If customer A (my clients customer) opens client.com/Customer, an API should be used for customer A's DB data retrieval
If customer B uses the same site customer B's API should be used instead...
Any good way to differentiate API update a single API connection by the caller of the website?6