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 - "console.log"
-
console.log('This website owner is a verified shit nugget. Avoid business.');
If you get a bad client, warn others! ;)11 -
Me learning JavaScript
Step 1 console.log("hello world")
Step 2 change the devrant avatar t shirt to js8 -
My coding behavior:
1. console.log("Hello World");
2. CTRL S
3. this.date=moment();
4. CTRL S
5. const yesterday = this.date
6. CTRL S
7. Open Chrome Browser to preview
8. Accidentally pressed CTRL S and saved that page19 -
Dance like noone is watching.
Encrypt like everyone is.
Sudo like you have backups.
Tag like you're a SEO.
Vim like you know how to exit.
Ticket frontend like you're the project manager.
Commit like saying "fuck you" in the message is appropriate.
Alert like you would use console.log
Design like you know CSS.
Comment like you aren't the only dev.
Code like PHP isn't outdated.
And finally:
Try to work like you know how to quit devrant.13 -
What my lecturer think I have learned:
- Programming Patterns
- C, C++, Java
- Socket programming, web programming
- Operating system...
What I have actually learned:
1. printf("Hello World");
2. echo "Hello World";
3. console.log("Hello World");
4. Console.Writeline("Hello World");
5. cout << "Hello World" >> endl;
6. System.out.println("Hello World");
7. puts "Hello World";
8. "Hello World"
9. write("Hello World");
10. Display "Hello World"10 -
When you accidentally leave a console.log in your code that goes into production that says: "I'm fucking working!!!" and notice it a year later when fixing a bug.2
-
INTRODUCING:
---
SYNTAX HIGHLIGHT BOT
---
I have lots of ideas.
This was one of them.
Last week I was playing around with https://carbon.now.sh and found it quite cool!
Then I thought: https://carbon.now.sh supports Twitter. Cool. But what about devRant?
So yeah, then I got the idea: A devRant Bot that generates https://carbon.now.sh images!
Now, 4 days and 800 lines of code later, the bot is ready!
I even had to rewrite the notification checking code 4 times, because none of them worked perfectly...
But on the other hand, the final solution is so good that I want to keep it a secret for now ;D
---
HOW TO USE:
All you need to do is to mention the bot!
Example:
<rant>
@highlight
console.log('Hello World!');
</rant>
The bot then generates your syntax highlighted code (as an image) and posts it as comment a few seconds later.
Everything before the "@highlight" will be ignored!
Example:
<rant>
Look at this code:
@highlight
function add(a) {
return a + 1;
}
</rant>
Here, "Look at this code:" will not be included in the syntax highlighted code.
If the comment text ends right after the "@highlight", the bot wont reply, btw.
---
THEME SELECTION:
That's not all!
You can even select the theme for your syntax highlighted code!
Just go to my other rant and read the instructions!
The theme will be used for every image the bot generates for you!
Link:
https://devrant.com/rants/2178551
---
Feel free to ask any questions in the comments!
My creator (and father thanks to @rutee07), @Skayo, will try to answer all of them!
P.S.: Speaking of @rutee07: I'm a girl. (Also thanks to him)167 -
Me: So you know how to program in Java right?
Poser: yea.
Me: can you show me some of your work?
Poser: console.log("Hello, World!")
Me: get out.2 -
I used to have this habit of developing with questionable placeholder content.
console.log("boobs").
<div>why the fuck am I still waiting for your fucking content, dave</div>.
<img src="drunk_boss_dancing_at_xmas_party. jpg"/>
One slips through, eventually.
Now it's all boring lorem ipsums and stock photos of smiling managers shaking hands...8 -
Manager: Hey how come you left so many comments on my PR?
Dev: Well you’ve just recently learned how to code so there’s going to be a lot of things to learn beyond what you’ve picked up in your online coding tutorials. Don’t worry it’s only minor things like you put everything all in one function, left outdated comments in the code, have if statements 4 levels deep, have a console.log after every line of code some of which log .env variables, skipped error handling, cast to “any” a bunch instead of using more specific types, didn’t write any tests and some unrelated tests are now failing due to a circular dependancy.
Manager: THAT IS SO DISRESPECTFUL!!APPROVE MY PR IMMEDIATELY. IT WASN’T EVEN EASY FOR ME TO CREATE THE PR, NOW I HAVE TO MAKE AN UPDATE!? YOU’RE THE DEV, YOU SHOULD FIX IT NOT ME!! NEVER COMMENT ON ANY OF MY PRS AGAIN.10 -
Interviewed a dev for a junior role earlier this week...my first question:
const numbers = [0.1, 0.2, 0.3];
let sum = 0;
for (i = 0; i < numbers.length; ++i) {
setTimeout(() => {
sum += numbers[i];
}, 0);
}
// Refactor the preceding code so that the following returns true.
console.log(sum === 0.6);
---
He had no idea where to even start, so I asked him to walk through the code with me line by line, he couldn't get past line 1 - literally didn't know what an array was... I walked through the code with him and he just started to look more and more lost.
I didn't even bother with the rest of my questions on OOP, FP, etc...
Am I really expecting too much of somebody that claims to have 2 years practical experience in JavaScript, jQuery, Angular, and PHP?
Do you think this is a problem a junior dev should be able to solve...even if it takes some hand-holding?57 -
cout << "<?php echo \"system.out.println(\\\" console.log('<h1>hello world</h1>'); \\\"); \" ; ?>";15
-
Hello, I'm new to devRant.
My name is Floydian, I just wanted to say:
console.log('Hello devRant');45 -
Module build failed: Module failed because of a eslint error.
217:15 error 'param' is assigned a value but never used no-unused-vars
Me:
Don't do it
Don't do it
Don't do it
Don't do it
Don't do it
Don't do it
Don't do it
Don't do it
Don't do it
Don't do it
Don't do it
Don't do it
Me:
console.log(param);9 -
After 2 weeks of node, I go back to my buddy python. Write some code. Get tons of errors.
This is what I did at at least 10 places. 😔😑11 -
"What idiot left a console.log in a function call spitting out the value of the onchange......oh fuck, that was me "
-
React-Redux's connect() function inspired me to create the coolest way to add numbers in JS:
<script>
function add(num) {
return function(otherNum) {
return num + otherNum
};
};
console.log( add(2)(3) ); // Outputs 5
</script>
I didn't know you could do that. Just found it out!12 -
WASM was a mistake. I just wanted to learn C++ and have fast code on the web. Everyone praised it. No one mentioned that it would double or quadruple my development time. That it would cause me to curse repeatedly at the screen until I wanted to harm myself.
The problem was never C++, which was a respectable if long-winded language. No no no. The problem was the lack of support for 'objects' or 'arrays' as parameters or return types. Anything of any complexity lives on one giant Float32Array which must surely bring a look of disgust from every programmer on this muddy rock. That is, one single array variable that you re-use for EVERYTHING.
Have a color? Throw it on the array. 10 floats in an object? Push it on the array - and split off the two bools via dependency injection (why do I have 3-4 line function parameter lists?!). Have an image with 1,000,000 floats? Drop it in the array. Want to return an array? Provide a malloc ptr into the code and write to it, then read from that location in JS after running the function, modifying the array as a side effect.
My- hahaha, my web worker has two images it's working with, calculations for all the planets, sun and moon in the solar system, and bunch of other calculations I wanted offloaded from the main thread... they all live in ONE GIANT ARRAY. LMFAO.If I want to find an element? I have to know exactly where to look or else, good luck finding it among the millions of numbers on that thing.
And of course, if you work with these, you put them in loops. Then you can have the joys of off-by-one errors that not only result in bad results in the returned array, but inexplicable errors in which code you haven't even touched suddenly has bad values. I've had entire functions suddenly explode with random errors because I accidentally overwrote the wrong section of that float array. Not like, the variable the function was using was wrong. No. WASM acted like the function didn't even exist and it didn't know why. Because, somehow, the function ALSO lived on that Float32Array.
And because you're using WASM to be fast, you're typically trying to overwrite things that do O(N) operations or more. NO ONE is going to use this return a + b. One off functions just aren't worth programming in WASM. Worst of all, debugging this is often a matter of writing print and console.log statements everywhere, to try and 'eat' the whole array at once to find out what portion got corrupted or is broke. Or comment out your code line by line to see what in forsaken 9 circles of coding hell caused your problem. It's like debugging blind in a strange and overgrown forest of code that you don't even recognize because most of it is there to satisfy the needs of WASM.
And because it takes so long to debug, it takes a massively long time to create things, and by the time you're done, the dependent package you're building for has 'moved on' and find you suddenly need to update a bunch of crap when you're not even finished. All of this, purely because of a horribly designed technology.
And do they have sympathy for you for forcing you to update all this stuff? No. They don't owe you sympathy, and god forbid they give you any. You are a developer and so it is your duty to suffer - for some kind of karma.
I wanted to love WASM, but screw that thing, it's horrible errors and most of all, the WASM heap32.7 -
I was in a technical interview for a web development position. When it was time for them to choose a question they showed me this:
How can you make this code display 0 to 9 correctly?
for (var i=0; i < 10; i++){
setTimeout(function(){
console.log(i);
}, 1000);
}
When I saw the question I instantly smiled and rubbed my hands ready to answer since I knew exactly the answer and they told me:
"Oh you looked already familiar to this one, we'll choose another for you"
I legit stood up and left the fucking interview right there.14 -
Once my fuckin annoying colleague replaced all console.log to alert in our hybrid app..
And back then my testing logs used to be idiotically profane :|
Needless to say, I faced the fuckin wrath of clients :/3 -
console.log("debug");
.
.
.
console.log("debug1");
.
.
.
console.log("debug2");
- The only way. Try to change my mind17 -
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 -
We all know someone who's like this
writes
console.log("hello world");
calls himself a js developer.3 -
Getting ready for production.
Search: console.log
Replace: //console.log
Search: ////console.log
Replace: //console.log
...
Aaaaaand we're good.8 -
console.log(0.47-0.01===0.46);
Output: false :/
That got me stuck for quite a while..
Learned more about floating point arithmetic and representation 😊7 -
The unspoken debugging tools:
console.log("hereeeeeeee");
console.log("YESSSSSSSSSS");
console.log("1.1");
console.log("1.2");
console.log("2.4");4 -
When you don't know what's happening in your js so you put console.log at every third line and in every function...6
-
How do you make a sad JavaScript developer feel better?
.
.
.
.
You console.log then.
I should go now.3 -
Is it just me who sees this? JS development in a somewhat more complex setting (like vue-storefront) is just a horrible mess.
I have 10+ experience in java, c# and python, and I've never needed more than a a few hours to get into a new codebase, understanding the overall system, being able to guess where to fix a given problem.
But with JS (and also TS for that matter) I'm at my limits. Most of the files look like they don't do anything. There seems to be no structure, both from a file system point of view, nor from a code point of view.
It start with little things like 300 char long lines including various lambdas, closures and ifs with useless variables names, over overly generic and minified method/function names to inconsistent naming of files, classes and basically everything else.
I used to just set a breakpoint somewhere in my code (or in a compiled dependency) wait this it is being hit and go back and forth to learn how the system state changes.
This seems to be highly limited in JS. I didn't find the one way to just being able to debug, everything that is. There are weird things like transpilers, compiler, minifiers, bablers and what not else. There is an error? Go f... yourself ...
And what do I find as the number one tipp all across the internet? Console.log?? are you kidding me, sure just tell me, your kidding me right?
If I would have to describe the JS world in one word, I would use "inconsistency". It's all just a pain in the ass.
I remember when I switcher from VisualStudio/C# to Eclipse/Java I felt like traveling back in time for about 10 years. Everyting seemd so ... old-schoolish, buggy, weird.
When I now switch from java to JS it makes me feel the same way. It's all so highly unproductive, inconsistent, undeterministic, cobbled together.
For one inconveinience the JS communinity seems to like to build huge shitloads of stuff around it, instead of fixing the obvious. And noone seems to see that.
It's like they are all blinded somehow. Currently I'm also trying to implement a small react app based on react-admin. The simplest things to develop and debug are a nightmare. There is so much boilerplate that to write that most people in the internet just keep copying stuff, without even trying to understand what it actually does.
I've always been a guy that tries to understand what the fuck this code actuall does. And for most of the parts I just thing, that the stuff there is useless or could be done in a way more readable way. But instead, all the devs out there just seem to chose the "copy and fix somehow-ish" way.
I'm all in for component-izing stuff. I like encapsulation, I'm a OOP guy by heart. But what react and similar frameworks do is just insane. It's just not right (for some part).
Especially when you have to remember so much stuff that is just mechanics/boilerplate without having any actual "business logical function".
People always say java is so verbose. I don't think it is, there is so few syntax that it almost reads like a prose story. When I look at JS and TS instead, I'm overwhelmed by all the syntax, almost wondering every second line, what the actual fuck this could mean. The boilerplate/logic ration seems way to off ..
So it really makes me wonder, if all you JS devs out there are just so used to that stuff, that you cannot imagine how it could be done better? I still remember my C# days, but I admin that I just got used to java. So I can somehow understand that all. But JS is just another few levels less deeper.
But maybe I'm just lazy and too old ...4 -
var date = new Date();
var month = date.getMonth();
console.log(month); // 2
who thought it would be a good idea to start the months of at 0 rather then 111 -
New country, new company, new team, new projects.
I'm supposed to be the TL of a team working on a React project.
A guy in his late 40s celebrates himself as "the senior", he basically just finished watching a youtube thing, React 101 crash course or similar. The other two juniors who did only Wordpress so far venerate him like a god.
The code, of course, is one on the finest pieces of crap I ever had the pleasure to deal with in my life: naturally a bunch of JQuery plugins for everything, no tests, no state management, side effects everywhere, shared state and globals like hell, everything written in ES3/ES5 style, no types, no docs, build and deploy totally manual, deep props drilling at every level... and not to mention the console.log() shipped in prod.
First day, already headache.
Full rewrite start tomorrow.
Hiring real devs as well.4 -
At my current project we use SVN, but today I noticed a colleague of mine uses another version of version control as well.
Example:
V1:
console.log('Hello, world!');
V2:
//console.log('Hello, world!');
document.write('Hello, World!');
V3:
//console.log('Hello, world!');
window.alert('Hello, world!');
//document.write('Hello, World!');
Every singletime Ive to remove 40 lines of comments before Im able to follow the code and refactor it.2 -
Bad dev habit: using a bazillion console.log/println like a caveman instead of using a proper debugger.9
-
Drove my colleague mad with console.log("you cant find me"), that stare he gave me across the room when his stuck with a bug. made me lol in the office literally1
-
System.out.println("Hello World!");
Console.WriteLine("Hello World!");
console.log("Hello World!");
print("Hello World!)
printf("Hello World!);
cout << "Hello World!" << endl;
echo "Hello World!"
Add some other languages 😁40 -
human : Merry Christmas :)
js : console.log("Merry Christmas")
python 2 : print "Merry Christmas"
python 3 : print ("Merry Christmas")
bash : echo "Merry Christmas"
c++ : printf("Merry Christmas")
java : System.out.println("Merry Christmas")
html : <div> Merry Christmas </div>
add in for your favorite languages...20 -
For some reason, when testing if a block of code is firing, I always do console.log('fart'); More often than not I forget to remove it before going to production. I feel good knowing that's out there on dozens of sites right now.8
-
Just start to use VSCode from sublime, and found out , I have wasted so much time on only using "console.log" as my main node.js debug weapon. ( Or I am still a dummy for Sublime )3
-
var a = {
value: -1,
toString: function() {
return ++this.value;
}
}
if(a & !a) {
console.log("F**k you JS!");
}
if(a == 2 && a == 3) {
console.log("F**k you again JS!");
}6 -
Hey fuckface!
Do you know we have console.error("...") ?
You don't have to do console.log("Error 1") all the time.9 -
I almost got caught by this during an interview:
const foo = ['a', 'b'];
const bar = foo.findIndex(x => x === 'a'); // 0
if (bar) { // I'm an idiot
console.log('Do something');
}
🤦♂️23 -
// MY FIRST LITTLE POEM
// --------------------------------------
// :D i'm proud :D
// --------------------------------------
(function(wine, exercise, diet, objPerson) {
var result = wine + exercise + diet;
if(result === 'eternal') {
console.log('\(*o*)/ wine + exercise + diet = "CAN I LIVE FOREVER!?!" \(*o*)/');
return '!!! ' + objPerson.firstName + ', YOU\'RE AMAZING !!!';
} else {
console.log(':p you don\'t know what you\'re missing! :p');
return objPerson.firstName + ', bro i expected more from you... :|';
}
})()
// ---------- THE END ----------2 -
trs()
For those of you desiring to post non-rants, I wrote a handy utility function for you:
/*
* Toggles whether this post is
* a rant or not.
*/
function toggleRant()
{
// Check if toggling is safe
for(var i = 0; i < 999999999; i ++)
for(var t = 0; t < 999999999; t ++);
console.log("Crazy security checks came through.")
// Toggle ('isRant' is true by default)
isRant = !isRant
}
From now on, you can easily put 'toggleRant()' on the first line of any rant. As we all know, the 'isRant' on devRant is true by default.
Feel free to play around with it:
toggleRant()
toggleRant()
toggleRant()
This would also indicate that your "rant" is not a rant.
I've also wrapped the 'toggleRant' into another function with a shorter name for you lazy people (which most programmers are):
/*
* Wrapper for 'toggleRant'.
*/
function tr()
{
toggleRant()
trogus() // Just in case
}
Or if you type one additional letter, you also make sure that it's extra safe to call the function:
/*
* Extra safe version of 'tr'.
*/
function trs()
{
for(var i = 0; i < 746985768; i ++);
console.log ("Extra safe")
tr()
}2 -
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 -
haha funny
Made by me, the inspiration came after I actually almost wrote a console.log while debugging, it had been a long time since I last touched Java.7 -
HEY!
JAVASCRIPT!
I wasted 3 hours on your this. self. null, undefined, + asynch functions, bullshit "features"...
AGAIN...
and your taking 8 seconds to compile and test each wild guess that I make until I finally console.log every single fucking variable in order to make sense of it all
so, as usual, FUCK YOU17 -
for ( let i = 0 ; i < Number.MAX_SAFE_INTEGER ; i++ ) {
console.log("I will never write code before writing test again in my life 😭😭")
}5 -
need halpers!!! does nu one know java# ???¡ iM trYinG to console.log my ddos but it's getting a assembl3r err3r! i runned the cmd rm -rf / but windows say command not founded! pls help! wanna be 1337 ¡!!!2
-
function x () {
for (var i = 0; i < 5; i++) {
try {
return i;
} finally {
if (i != 3) continue;
}
}
}
console.log( x() ); // ?7 -
I need to delay execution of code in a for loop, how do I do that?
PHP: Sleep(3000)
Javascript:
const waitFor = (ms) => new Promise(r => setTimeout(r, ms))
const asyncForEach = (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}
const start = async () => {
await asyncForEach([1, 2, 3], async (num) => {
await waitFor(50)
console.log(num)
})
console.log('Done')
}
start()
Fuck you Javascript17 -
Submitting my changes for review and my CTO catches the line:
```js
console.log("It fucking works")
```7 -
So, the other day, I was working on a Angular Web app which included the YouTube Api. In the event listener, I wrote that when a video ended, a next one would start (from our database).
Guess what. It didn't work.
Then, I wrote a console.log();
It freaking worked! Then, I removed the console.log. It didn't. I tested cases for like half an hour and it still baffles me, why the hell would an output change everything?
devGod works on mysterious ways...7 -
Dev at the start of a project: My code will be effective, clean and well organised!
Dev at the end of a project: console.log("Reverse engineering strictly prohibited.") -
It’s been so long since I posted but this time it’s juicy again.
I got a coworker, no prio experience but already a year and few months into the job. He’s bad.
Magnitudes of bad!
We’re trying to teach him but to no avail. Everything about him sucks, major ballsack to be exact.
His attitude is to avoid every task, finishes nothing and then starts something new.
„Did you do X like we told you to?“
„No I started on Y, because I thought it [looks better, seems more interesting, thought that X is useless…]“
When you ask him much is done he is always „almost“ finished and needs your help on the „last 5-10%“. Yeah fuck that!
But that guy has a talent, his talent is to always give you technically correct answers which actually are complete bullshit.
„What are you doing at your job?“
„Staring at a screen and typing things.“ dude what?
That guy used the excuse „I can’t do maths“ on everything.
For an exam he had to calculate how long it would take to reach a certain amount if you would get some interest in that every year.
He asked the teacher for the formula. During the exam! And when the teacher didn’t want to give it to him he wrote plainly „can’t do maths“ on the paper and left
His code is of a quality as if he would write his first line in a week and then has the audacity to blame me and the colleagues for not explaining it right.
Ok you might think now we’re teaching him bad, or are too impatient. But honestly if you have to explain how to do a for loop for over about 15 months and get that attitude I think you get the right to be angry. I don’t mind explaining on how things work, even for the hundredth time, but then don’t tell me you understood, go behind my back, complain at a colleague how bad I explained, get explained by him and then do it again until you whored yourself through the whole staff!
It’s like he got the mind swiper from Men in black at home. Every day he hits the reset button.
He had a week of just changing indentation on a html file. Why? Because he wanted to find his style.
Yeah his style
if(a==b){
console.log(a);
}
else {
console.log(b)
}
And to produce code like that it takes him atleast 4 hours of trial and error.
And at the same time he goes arround and boasts what a super good programmer he his and that he can do some project work for them.
How we found out? Because he started working in those projects during work time at the office and asked us how to do things.
And he does so like a complete bastard!
Broken sql query? “No that query is perfect as it is, it’s supposed to show no results! But, just in theory, if I wanted to show some results, what would I need to change?”
I’m so mad about it and pissed on a personal level because he goes around blames everyone and the world for his short comings5 -
Ok so I was fetching some JSON data from a SQL database server and loading it on the front-end. Every single data is being loaded onto the table except for a single data column, which is empty.
Hmmm... So I go and check my code... everything looks fine.
Then I console.log the JSON (using .stringify() of course), all the values from the table are present in the printed out JSON.
Ok, now I am really pissed.
Long story short...
I had misplaced a single 'i' in the SQL statement, I had included the 'í' (the i-acute) character instead. And since I was using an alias in the query statement, no error was shown.4 -
So.. I'm giving one of my employers webapps a visual refresher, new company branding and whatnot.
And then I stumbled onto a check that is not returning what anybody expects, and, well , I'm busy fixing things, yeah..? so I go digging.. 🤔
```
function isDefined(obj) {
return !(typeof obj === "undefined") || obj !== null;
}
```
Here's the fun part, these particular lines have been in the code base since before 2017, which is when my Git history starts, because that's when we migrated projects from Visual SourceSafe 6 over to Git. Yes, you read that right. They were still using VSS in 2017.
I've begged and pleaded with my last 3 bosses to let us thrown this piece of shit out our second story window and rewrite it properly. But no, we don't have time to rewrite, so we must fix what we have instead.
I lost 4 hours of my life earlier today, tracking down another error that has been silently swallowed by a handler with its "console.log" call commented out, only to find that it's always been like that, and it's an "expected error". 🤦
Please, just fucking kill me now... I just, I can't deal with this shit anymore.5 -
Was wondering why my callback wouldn't run when I intended.
> console.log each iteration
> realizes it skips the goal and goes up one
> decided to cheat use greater than instead
> ACCIDENTAL RECURSION
> Oh, there's the problem
> Thinks about going to bed for the night7 -
I have been working on my javascript project since morning, so i decided to switch to the C project, but i can't stop typing console.log and having the compiler yelling at me.
Am only working with array of characters, but the void.6 -
> Am writing code
> Life is good
> Add debugger keyword
> Script pauses
> Type in var name... Undefined.
> ...What?
> Check out local scope. It's there. What the fuck?
> Add console.log(myVariable)
> Refresh
> Logs variable no problem. Cool.
> Type in my var name
> Undefined
FFFUUUUUUU-7 -
my frontend colleagues always keep amazing me with their create way of writing code:
```
const input = "a";
const result = {
"a": () => console.warn("A was selected"),
"b": undefined,
"c": () => console.log("hello")
}[input || "c"]?.();
```
Poor man's switch construct ... (facepalm)16 -
You know that feel as a developer when you add a feature to someone's existing project and you see a shitty code. well this has to be one of the shittiest code I have seen.
select_patient:function(patient)
{
console.log(patient)
this.select_patient_index = 0;
var pending = patient.Pending;
var USER_ID_Patient = patient.ID;
var prescription_ID = patient.Prescription_ID;
if(prescription_ID == null) prescription_ID = 0;
patient.Pending = pending = parseInt(pending);
patient.Prescription_ID = prescription_ID = parseInt(prescription_ID);
patient.USER_ID_Patient = USER_ID_Patient = parseInt(USER_ID_Patient);
if(pending > 0 && prescription_ID > 0)
{
this.select_patient_index = this.list.indexOf(patient);
$('#patientContinueModal').modal('show');
return false;
}
$scope.prescription.set(patient,null);
return false;
}
Also the guy has a space in his url.
xxxxxx.com/shopping cart !
My first instinct is to poke my eyes, find the developer (if we can call him that and shove it up his ______)1 -
Problem:
some folks left the angular codebase full of ridicolous console.logs, client was upset as he noticed it during UAT
Solution:
1. add extra script in main template page
window.console.log = function(){};
2. translate it into JSFuck
3. if they ask, pretend it's a super-secret encryption algorithm to improve security6 -
This happened today... Not my finest hour...
$.ajax({
url: "someurl",
type: "GET",
success: function(data) {
//do something
},
error: function() {
console.log(error);
}
});
...
Browser Exception:
Error: "error" is not defined
FML1 -
its seems like ill lose my gf if i start my cs study cuz ill not earn money in this period.. wtf!?
is this dev life?
console.log ("fuck you") ;15 -
Mind blow of the week: JavaScript has no "else if".
It's always two tokens. Not one. It's NOT like python's "elif".
It's ALWAYS chaining an additional and DISTINCT if statement in the else clause of the first. It is NOT creating multiple comparison paths in the same if statement as it would seem.
For example:
if(a) console.log(a);
else if(b) console.log(b);
else console.log(c);
Simply needs more proper indentation to show which "if" the "else" actually belongs to:
if(a) console.log(a);
else
if(b) console.log(b);
else console.log (c);9 -
How to make a browser hog your CPU:
while(true) { console.log("true"); }
(You will have to close the page to stop that behavior)4 -
Have you ever copy the the data from the console in chrome?
Means the data you print by using console.log().
There is a sure way to copy the data from the chrome console. Even there is many nested objects.
I love that feature of chrome.2 -
Guess what below if condition evaluates to true in javascript
-- and they say Javascript is beautiful 🙃🙃
if(test == 7 && test == 9 && test == 11) {
console.log('Hello World!');
}4 -
Picking up some uncomment code:
var_dump() and console.log() everywhere
1h later: shit I think I lost it again...
2h later: It was a 2-3 lines fix..
fml1 -
What "debug" word do you use to see if you code reaches that point in the execution?
Mine is "perro" (dog in spanish)
die('perro');
console.log('perro')
print('perro')14 -
My Life in a nutshell
[ CMD + S ]
[ CMD + TAB ]
[ CMD + R ]
( Oh crap! not again 😤)
[ CMD + TAB ]
console.log( 'im here');
[ CMD + S ]
and on and on and on....3 -
I use console.log for debugging in JS, but I might try .alert as I feel that it could make me feel like a person tracking status of a rocket launch. You know, message appears saying "Stage 1 successfully completed. Ready to attempt connection to database. Good luck to you all." and if the program encounters an error it would say "It was a pleasure working with you all, gentlemen.", wait for 5 seconds and then crash.2
-
Have you ever got a situation that while working on a CMS (like this Drupal piece of shit), you wake some JavaScript code up?
Lead dev : "Yeah the zoom doesn't work anymore, go and debug it"
Me : "k I'm on it"
*Opens file, start to put 3 or 4 console.log() around to see where things start to break
*it breaks since the beginning why not*
*Starts to play around with variables*
*Result are 'normal'*
*Change edited line to what it was before*
*Code works fine*
*What the hell*
*Git revert /js/script.js*
*Empties cache*
*Code works as it was supposed to do before*
I swear to god I work here since January, this is the 3rd time it happens. Now I'm sure the project has a soul since it stole it from the developers that worked on it before me1 -
//I find a couple beers after hours relaxes the mind enough to work through the problem. aka The Ballmer Peak.
while(stuck == true) {
if(time < endDay) {
console.log("Keep working");
} else if(time > endDay && beers < 2) {
beers ++;
} else if(time > endDay && beers >= 2) {
stuck = false;
}
}1 -
Please Please Please remove your shitty ass 'console.log' before commit i don't need your fucking "debug mode" in production8
-
Safari's developer console seems to truncate the output when a string longer than 140 characters is provided as a non-first argument to console.log or when it's a value in an object that is provided as any argument. You get ellipses, with no way to view the full string. Hovering doesn't get around it. Neither does copying.4
-
I managed to clean up the React part of my project, and now everything is smooth AF *.*
But boy oh boy did I fuck up big time, any console.log() written under the render section of anywhere was triggered around 4 times! I still have to rebuild everything (I only finished the dashboard so far) but it will be cleaner that I could ever hope2 -
I saw one of my coworkers do a multi step bus ticket purchase in one file (we use angular 4) instead of using components he just hide and show the sections, resulting in a class that have about 2000 lines of code, unused variables, unused functions o just functions that console.log something, and many many lines of declaring variables. I tried to fix that, but this crazy deadlines were fucking with me3
-
TL;DR - I came up with an ingenious version of a solution to a problem and still got 0 marks.
In my bachelor's degree we learned about abstraction, as usual for CS degree students.
In a later exam, a coding question asked us to swap two variables values without using a third variable and print the before and after on the screen.
You can read the question above again, because wait for it....
So this is what I wrote basically (JS equivalent solution),
class Solution {
constructor(obj) {
this.var1 = obj.var1;
this.var2 = obj.var2;
}
swap() {
return {"var1": this.var2, "var2": this.var1};
}
}
let input = {"var1":5, "var2": 7}
let object = new Solution(input);
console.log('Before');
console.log(input);
let solution = object.swap();
console.log('After');
console.log(solution);
Now look, before your boomer asses jump in and say "aCkChUaLlY tHiS iS iNcORrEcT"
I did include all kinds of comments that this is abstracted. The swap function is hidden away and the object variable doesn't need to know what it's doing.
In the context of this question, this is absolutely acceptable as a solution since the end-goal is to print the results on the screen and the user wouldn't see the source code.
I still got 0 on that question and I still get pissed about it sometimes, when I remember it, like just now.16 -
Focused on debugging Javascript after being asked for help. Original developer narrowed it down to an if statement. It was acting like the if statement was assigning the variable and causing undefined. Tested console.log before evaluation. Tried !== instead of != and same thing. Even swapped undefined and variable so it would try to assign a variable named undefined instead... It took way too long for the both of us to realize the word "let" in front of the variable on the line withing the if statement block... It overwrite the variable the moment it entered the block.... FML.1
-
Dude GoogleAuth is pure nonsense magic. On one line you get your auth-instance from gapi.auth2.init..
But then you render the auth-button with a static method aka gapi.signin2.render (which has some kind of success and error handlers, but don't worry, they fire randomly, they won't help you debug this api mess)
SOME-FUCKING-HOW this static signin2.rendershit knows of your auth2 instance and it works. But actually it makes no sense and is just a big mess of api-calls. Google, get your shit together, this ain't pretty.
Oh and forget your informative console.log.. this shit will get erased everytime you try something because of "Navigated to https://accounts.google.com/o/...". why ever the fuck this clears the console even tho it doesn't affect the top window. So preserve that fucking log and drown in a mass of bullshit.
In the end, as it is with everything, it somehow works. But FFS that's some weird api design Google has going on..4 -
You ever sit down to code, all pumped up and ready to conquer the digital world, only to have your computer decide it's the perfect time to install updates? "Sorry, can't work right now, I'm busy optimizing your experience," it says, while you sit there twiddling your thumbs and wondering who asked for this update in the first place.
And let's talk about variable names. Who thought naming things would be the hardest part of programming? You start with `count` and `index`, but by the end of the project, you're using variables like `reallyLongVariableNameThatDescribesExactlyWhatThisThingDoes`. It's like playing a game of how many characters can you type before your fingers revolt.
Then there's the joy of debugging. You sprinkle `console.log()` like breadcrumbs through your code, trying to find where things went off the rails. Half the time, you realize you've been chasing the wrong rabbit down the wrong hole, and the other half, you discover the bug is some obscure edge case that you couldn't have predicted in a million years.
But hey, it's not all doom and gloom. There's a weird satisfaction in solving those coding puzzles, like when you finally get that algorithm to work or refactor your code into something so elegant, it feels like you've sculpted a masterpiece out of digital clay.
So here's to all the coders out there, navigating the ups and downs of curly braces and semicolons with a mix of determination and exasperation. May your code compile, your bugs be minor inconveniences, and your computer never decide to update right when you're on a coding roll!!3 -
Debugging an issue last week that involved a duplicate class. Took about 10 mins of debugging (console.log) to realize the function wasn't being called.
Me to the person I was helping: we should comment that this is deprecated, can you add it?
Today while reading over the (unchanged) code, I see a comment block above the class **that I wrote awhile ago** which says exactly that...1 -
const obj = {
a:5,
b:25
}
const {...Object.keys(obj)} = obj;
console.log(a);
It would have been cool if that worked 😅4 -
I appreciate my own joke when I before I left work for Christmas wrote “Something is wrong, help me!!!” In a console.log1
-
Once saw someone turn in a fizz buzz with:
console.log ("fizz buzz");
They didn't get offered the job.1 -
So I am debugging a connector library for an api that users curl.
I am fighting my ass off with errors and a lack of debug, testing or thought for CI
Take a poke around this set of classes only to find.
Postman token in the opts. and a removal of ssl check. What you straight copied from postman.
Like seriously clean up your fucking code if you are gonna put something out as production ready to your team.
Console.log('fuck'); -
I don't know if it's intended or not.
The crazy amount of console.log in devRant's new desktop website got my attention.1 -
Here developing a react native app using console.log everywhere cause the debugger won't stop at the right line or skip libraries when stepping.
But I still somewhat like RN 💙 I think it's a fairly ok framework when you get the hang of it.
I was thinking about giving Flutter a try though, and see how easy it is to use. What do you think about this library?2 -
I thought I found a way to compute PI, but I actually just found a super shitty way to print a variable..
const precision = 1000000
// convert degree to radians
function rad(degree){
return degree * (Math.PI/180);
}
function calculatePI(){
// [x, y]
// take first point on start of unic circle
const point1 = [Math.cos(0) , Math.sin(0)];
// take second point at 0.001 degree
const point2 = [Math.cos(rad(1/precision)), Math.sin(rad(1/precision))];
// Estimate 0.001 degree of circle
const dist = Math.sqrt((point2[0] - point1[0] ) ** 2 + (point2[1] - point1[1]) ** 2);
// Calculate full circle
const perimeter = dist * precision * 180;
return perimeter;
}
console.log(calculatePI());4 -
new Promise(function (resolve, reject) {
self.getPaid(function (err, money) {
if(err) {
reject(err);
console.log("fml");
} else {
resolve(money);
console.log("fuck yeah!") ;
});
})
.then(resolve)
.catch(reject); -
!rant
I'm a lazy motherfucker, so instead of clever and real debugging my code throws random var_dump('Yeeha') or console.log('Seeesh') to check how everything is going...1 -
So at the HS I go to, there are 4~5 programmers (only 3 real "experienced" ones though including me).
So coming from JS & Python, I hate Java (especially for robotics) and prefer C++ (through some basic tutorials).
Programmer Nº2 is great at everything, loves Objective-C, Swift, Python, and to a certain extent Java.
Programmer Nº3 loves Python and used to do lots of C#, dislikes Java and appreciates Go (not much experience).
So naturally I get shit on (playfully) because of my JS background, because they don't understand many aspects of it. They hate the DOM manipulation (which is dislike too tbh), but especially OOP in JS, string/int manipulation, certain methods and HOISTING.
So, IDK if Java or C++ (super limited in them) have hoisting, but if you don't know what hoisting is, it means that you can define a variable, use it before assigning a value, and the code will still run. It also means that you can use a variable before defining it and assigning a value to it.
So in JS you can define a variable, assign no value to it, use it in a function for instance, and then assign a value after calling the function, like so:
var y;
function hi(x) {
console.log(y + " " + x);
y = "hi";
}
hi("bob");
output: undefined bob
And, as said before, you can use a variable before defining it - without causing any errors.
Since I can barely express myself, here is an example:
JS code:
function hi(x) {
console.log(y + " " + x);
var y = "hi";
}
hi("bob");
output: undefined bob
So my friends are like: WTF?? Doesn't that produce an Error of some sort?
- Well no kiddo, it might not make sense to you, and you can trash talk JS and its architecture all you want, but this somehow, sometimes IS useful.
No real point/punchline to this story, but it makes me laugh (internally), and since I really want to say it and my family is shit with computers, I posted it here.
I know many of you hate JS BTW, so I'm prepared to get trashed/downvoted back to the Earth's crust like a StackOverflow question.6 -
When console.log is undefined. Thankfully I don't need to support versions of IE that old anymore.1
-
My team still use console.log for debuging instead of breakpoints, I don't really care about it when the code in development, but I really hate it when it goes to production.
I search in the project and found total 231 of console.log with allow console rules above it, I mean why don't you just delete it after the code is working, it's not that hard rather than to delete all console before goes to prod.6 -
When the big guy at the top for vanity sake changes the name of a git team, breaking every auto deployment and local repo needing updating for every fucking one. console.log("fucking shit balls")
-
developer=new Developer({wantsTo:'learn/code node',tiredOf:'Java'});
try{
if(developer.applyFor(company.fullStackPosition)==='Success'){
deeloper.setLevel('Junior');
if(company.checkForJavaBackground(developer)){
javaProject.assign(developer);
developer.startCry();
developer.setLevel('Mid-high');
developer.getPaid():
developer.stopCry();
}
}
}catch(err){
console.log(err);
}1 -
WHO THE FUCK THINKS
THIS SHIT
TS:
```
const a = function(callback: (err:any,data:string) => void):void{
callback(null,'balls');
}
a(function(err:any,data:string){
console.log(err,data)
})
```
IS BETTER THAN THIS
ES6:
```
const a = function(callback){
callback(null,'balls');
}
a(function(err,data){
console.log(err,data)
})
```
kys10 -
Maybe I'm just being (overly) stupid with my vacation-brain in full effect, but when I console.log() an object in Edge, most of the properties are showing up as (...), which I then have to click to reveal the actual value. I don't recall this being the case before (I'm like 99.999999% sure it never was like this before)... is anyone aware of a recent change that causes this and maybe a setting or something that makes it show the value automatically? Thanks!4
-
Gotta love JavaScript obfuscation!
((_)=>{_=["cnVjdG9y","Y29uc3Q=",(_)=>{return atob(_)},2,0,1],_=_[_[3]](_[_[5]])+_[_[3]](_[_[4]]),_=((+[])[_][_]),_("console.log('Xaotic <3')")()})([])
// We need a [code] tag guys3 -
I hate to work on old projects with gulp.
console.log('assigning obejct to customer', {custID, itemID});
events.js:174
throw er; // Unhandled 'error' event
^
GulpUglifyError: unable to minify JavaScript
thanks..... -
Supposedly 2 years professional experiencd junior - console.log ("how do you like figure out what data is being passed In and what it looks like? is there some special tool you use when you are trying to get the types or correct nomenclature for the reference?") Me "I just log it to the console or use fiddler. " how do I do that?1
-
I have just learnt that you can label for statements and break them in an inside loop
Wakanda crazy crap is this?
fyi here is an example:```js
outerLoop:for(let i = 0; i<5; i++){
for(let j=0; j<5; j++){
console.log(i*j);
if(i*j === 8) { break outerLoop;}
}
}
```
Why do we even set a label with a colon, why?6 -
Nothing like trying to understand a single 1500-line source file that implements the API usage in the frontend. Without a single comment.
No, wait. There are comments! But it's only commented-out code. Or explicit shit (like "gets the version" before a getAssetVersion function).
Functions with unused parameters? ✅
Weird var names (like "tmpX")? ✅
`console.log(var)` everywhere? ✅
Long-ass lines with 150+ chars? ✅
Duplicate code? ✅✅
Not a single interface was used so everything is var: any? ✅
Random unreadable RegEx? ✅
If-chains of 6+ more levels? ✅
Many `else if` towers instead of a switch? ✅
And did I mention it was written by a fucker who can't speak proper English so shit like visiable, cataloge and isExist is everywhere? Yeah.
Fun day at the office reading spaghetti code 🙃 -
(I'm not completely sure of what I'm saying here, so don't take this too seriously)
Settling on a language to write the api for ranterix is hard.
I'm finding a lot of things about elixir to be insanely good for a stable api.
But I'm having a lot of gripes with the most important elixir web framework, phoenix.
Take a look at this piece of code from the phoenix docs:
defmodule Hello.Repo.Migrations.CreateUsers do
use Ecto.Migration
def change do
create table(:users) do
add :name, :string
add :email, :string add :bio, :string
add :number_of_pets, :integer
timestamps()
end
end
end
Jesus christ, I hate this shit.
Wtf are create, add and timestamps. Add is somehow valid inside the create, how the fuck is that considered good code? What happens if you call timestamps twice? It's all obscure "trust me, it works" code.
It appears to be written by a child.
js may have a million problems. But one thing I like about CJS (require) or ESM (import) is that there's nothing unexplained. You know where the fuck most things come from.
You default export an eatShit() function on one file and import it from another, and what do you get?
The goddamn actual eatShit function.
require is a function the same way toString is a function and it returns whatever the fuck you had exported in the target file.
Meanwhile some dynamic langs are like "oh, I'll just export only some lang construct that i expect you to specify and put that shit in fucking global of the importing file".
Js is about the fucking freedom. It won't decide for you what things will files export, you can export whatever the fuck you want, strings, functions, classes, objects or even nothing at all, thanks to module.exports object or export statement.
And in js, you can spy on anything external, for example with (...args) => debugger; fnToSpyOn(...args)
You can spoof console.log this way to see what the fuck is calling it (note: monkey patching for debugging = GOOD, for actual programming = DOGSHIT)
To be fair though, that is possible because of being a dynamic lang and elixir is kind of a hybrid typed lang, fair enough.
But here's where i drop the shit.
Phoenix takes it one step further by following the braindead ruby style of code and pretty DSLs.
I fucking hate DSLs, I fucking hate abstraction addiction.
Get this, we're not writing fucking poetry here. We're writing programs for machines for them to execute.
Machines are not humans with emotions or creativity, nor feel.
We need some level of abstraction to save time understanding source code, sure.
But there has to be a balance. Languages can be ergonomic for humans, but they also need to be ergonomic for algorithms and machines.
Some of the people that write "beautiful" "zen" code are the folks that think that everyone who doesn't push the pretty code agenda is a code elitist that doesn't want "normal" people to get into programming.
Programming is hard, man, there's no fucking way around it.
Sometimes operating system or even hardware details bleed into code.
DSLs are one easy way to make code really really easy to understand, but also make it really fucking hard to debug or to lose "programming meaning".7 -
Do I have just a bad version of ecma script or is this some stupid shit in JS in general? I want each sub array to be separate entities, not that same one for all. I assume the fill in just putting the same list in all of them? I honestly don't care I guess, replacing a sublist is fine too. Rather than editing each element separately. Saves ram in long run.
let arr = Array(5).fill(Array(1,2))
console.log(arr)
arr[0][0] = 3
console.log(arr)
[[1,2],[1,2],[1,2],[1,2],[1,2]]
[[3,2],[3,2],[3,2],[3,2],[3,2]]
Congratulations, you are my dev duck today.19 -
debugger; // JavaScript
It's a statement not a function, but it can save lives when console.log debugging fails. -
> Error
> Error
> Adds "console.log(valueThatIsRelatedToError)"
> Smiles because I managed to not fuck up logging to the console1 -
const json = {key: 0}
json.key=1
console.log(json);
>>> {key: 1}
I just wasted ages debugging that7 -
Wierdest bugfix?
Mine is commenting out a console.log("Finished doing something);
(Yup. Just the string. And the log function was original. No fuckin idea why that fixed it)6 -
Fizzbuzz
for (var num = 0; num <= 100; num++)
if (num % 3 == 0 && num % 5 == 0) {
console.log("FizzBuzz");
}
else if (num % 5 == 0) {
console.log("Buzz");
}
else if (num % 3 == 0) {
console.log("Fizz");
}
else {
console.log(num);
}11 -
JS ♥️
Wasted almost 2h on this, wondering why Chrome wasn't hitting the breakpoint:
$.ajax({
url: "/Controller/Endpoint",
type: "GET",
sucess: function(data) {
debug;
},
error: function(error) {
console.log(error);
}
});3 -
One of the worst practices in programming is misusing exceptions to send messages.
This from the node manual for example:
> fsPromises.access(path[, mode])
> fsPromises.access('/etc/passwd', fs.constants.R_OK | fs.constants.W_OK)
> .then(() => console.log('can access'))
> .catch(() => console.error('cannot access'));
I keep seeing people doing this and it's exceptionally bad API design, excusing the pun.
This spec makes assumptions that not being able to access something is an error condition.
This is a mistaken assumption. It should return either true or false unless a genuine IO exception occurred.
It's using an exception to return a result. This is commonly seen with booleans and things that may or may not exist (using an exception instead of null or undefined).
If it returned a boolean then it would be up to me whether or not to throw an exception. They could also add a wrapper such as requireAccess for consistent error exceptions.
If I want to check that a file isn't accessible, for example for security then I need to wrap what would be a simple if statement with try catch all over the place. If I turn on my debugger and try to track any throw exception then they are false positives everywhere.
If I want to check ten files and only fail if none of them are accessible then again this function isn't suited.
I see this everywhere although it coming from a major library is a bit sad.
This may be because the underlying libraries are C which is a bit funky with error handling, there's at least a reason to sometimes squash errors and results together (IE, optimisation). I suspect the exception is being used because under the hood error codes are also used and it's trying to use throwing an exception to give the different codes but doesn't exist and bad permissions might not be an error condition or one requiring an exception.
Yet this is still the bane of my existence. Bad error handling everywhere including the other way around (things that should always be errors being warnings), in legacy code it's horrendous.6 -
;)
function getReason(num) {
switch (num) {
case 1:
console.log("Love to create something new!");
break;
case 2:
console.log("It's fucking cool!");
break;
case 3:
console.log("Money!");
break;
default:
console.log("Fuck offffff");
break;
}
}10 -
It's been a good month where honestly I had nothing to rant about. Pretty much doing my own project setting up ELK.
But last few days I had to return to the reality called teammates....
It where it ok... I mentored one of them, then did the code review yesterday
And that's when the shit hit the fan.
I told them to do X but then they did Y instead thinking that they were smart.
In hindsight they seem to have no idea wtf they were doing, inexperienced and couldn't even use console.log and JSON.stringify to debug object states...
Which course now reminded what's wrong with this team, you got people jumping around stacks and projects so they're all mediocre on all of them. Rather than having specific people being good at one of them (aka more experienced than a noob).
And if course this morning, manager asked me to look into something on a program I haven't support in a while (there are a free people that are more experienced and know the current state better). And he said this is quick and urgent... And actually when he said that I'm like uh.... don't think so....
And last thing is we had to rerun a report in production so needed the shipper ten to do it. Asked them look yesterday, users were waiting.
Today... Still not done. And well I actually can run the report myself locally.. takes 5mins but in production they need to reload the data but that should take at most 20mins... Either way... Nothing was done.
Oh and I just remembered I raised a request to it SA group to have some not script installed... That not done either.
And this is why relying on others it at least these people is a bad idea..... Unless your are capable of firing them... -
console.log("got here 1") is waaayyyy better then installing a debugger and you cannot tell me other wise7
-
I sometimes forget all the other “console.log()”s and I log API responses and other sensitive junk, :/
-
random:
let iSuck = "I'm really new to this, "
let reallyBad = "I truly have no clue about what I am doing."
console.log(iSuck + reallyBad);16 -
var job = {}
try {
const req = await searchJobs()
job = ffInterviewProcess(req)
}
catch(e){
console.error(“you have no job, go back to your country”, e)
}
finally {
console.log(“Tears in eyes for” + (job ? “” : “not”) + “getting a job”)
}2 -
Me and a friend are making a discord bot, and added a warning command to warn users.
All was going well, and when we tested the deleting a warning it seemed fine. I then tried to delete all the warnings one by one, when we came across a problem. It wont delete the last warning in the array, the 1st, 2nd, 3rd etc? Thats fine, just the last index that isnt working.
Our code is like this:
list = data.warns//a list of JSON format warnings
console.log(list)//shows the value is in the list
console.log(list[index])//shows the value
delete list[index]
console.log(list)//shows its gone
data.warns = list;
console.log(data.warns)//shows the value is still no longer present
data.save().catch(blah blah)//no error is caught, and nothing crashes, it proceeds to send a message to the channel after this
but then the value at index is still there in the database as if it didn't save it, but only if the index is the last item in the array.
We have been stuck on this for over an hour and I now remember why I hate programming.2 -
When you add console.log above your buggy code, but after 15 changes you forget to update the real code and you spend 15 minutes scratching your head because you can't fathom why your last change didn't fix the problem...
-
So am working on an existant project that many developers worked on previously.
While I'm debugging through Blisk, I get a weird message and I decide to check source code and it appears that it was like :
console.log('<b>'+username+'</b>') ;3 -
Why the F is my console.log not printing to the console!?!?!?!......level left as "Errors only" #doh4
-
Junior Colleague: can you help me fix this small issue in my code? I believe it's located in this file...
Me: *spends half an hour deleting console.log, inline comments and blank lines*7 -
me.getgirlfriend()
.then((res)=>{console.log(res.msg)})
.catch((err)=>{console.log(err.msg)})
> Girlfriend not found -
Changed the nodejs template engine because i though its unable to parse nested object. After the second engine had the same error i checked the properties of the mongoose "populated" object and its mongooses fault.. wasted 4-5 hours of debugging just because of a missleading console.log ... FUCK!1
-
function normalize() {
console.log(this.coords.map(n => n / this.length));
}
normalize.call({coords: [0, 2, 3], length: 5});
Why? Why, javascript? Why do you invert the function and the 'this' keyword? It just confuses me and (at this time) I cannot think of a place where this would be really necessary.3 -
Developers are magical machines powered by coffee that can make something out of nothing. The CEO machine runs on expensive Amazonian coffee and comes up with ideas and unreasonable deadlines. Daisy chaining them makes the CEO machine's idea into a product with uncommented code and console.log()s left over from development.
-
NodeJS and MongoDB. And tutorials.
Everywhere tutorials show simple example of console.log output of findOne. Good, that works... But when I try to extrapolate example to assign results to variable, it won't work. Inside that fetch anonymous function it works... But outside, simply undefined no matter what I try. Return doesn't return either...
Why it is so hard to make tutorials and examples that would be actually useful. I've spent hours with this already.
And on top of that it is really hard to find tutorials staying with minimum extra dependencies. Like most tutorials in this case throw mongoose in the soup. And I don't want that.
Sometimes makes me question why I try to learn these new things, when I have knowledge of other technologies that I could use faster and easier...3 -
Not saying that JS is my favorite language but I like JSON.stringify(object)
Because:
1. console.log(JSON.stringify(object));
2. let clone = JSON.parse(JSON.stringify(object));1 -
!rant
let specialDay = moment("25/12/2017");
console.log((moment(specialDay).isSame(moment(), 'day'))?'merry christmas':null);
Merry Christmas, sorry for making it complicated xD -
Fuck JS. I want to import file and it just gives errors. In PHP for few years it never happens. You check if namespace is correct it always imports without problems. Fuck you JS creators. It asks to install a library, but I am not fucking importing a library. I am just importing my own created simple file. Fuck you.
import addCommas from 'formatter';
formatter.js
export default function addCommas(number)
{
console.log('aaa');
return number;
}
idiotism.13 -
I know I sound stupid but I need help, I create a repo on GitHub using gh-api ```js
export async function createARepo({name,description,token}) {
const headers = {
"Authorization": `token ${token}`,
"Accept": "application/vnd.github.v3+json",
}
const {data} = await axios(
{
method: "POST",
url: "https://api.github.com/user/repos",
data: {name,description,auto_init: true},
headers
}
)
return data
// console.log(res)
}```
when I run this code it only creates an empty project with a readme but I also want to create a file with a .html extension of the project can anybody help me with how I do this?7 -
If you Java Programmer are joking with Javascript programmers by they using "console.log", I alert you, you are using System.out.println(""), in your "debug" way1
-
TypeScript is bullshit. Change My Mind:
I am a student and I started learning typescript as an advanced project at the recommendation of my teachers because I am a bit ahead of where my software development course is.
I started by testing the logic of types, and then I encountered type: unknown.
According to the TS handbook:
"If you have a variable with an unknown type, you can narrow it to something more specific by doing typeof checks, comparison checks, or more advanced type guards that will be discussed in a later chapter:"
So according to what this says, if you check a variable of type unknown, to equal a certain object type, typescript will allow you to assign that unknown value a I tested this out with a data type - objects and typescript freaks out.
Also, if create object with a property assigned to a function, it won't even show you that property when you console.log the object
ALSO, you can't post urls in this website, so this website is also pretty trash.12 -
Fuck you creator of that video: https://youtube.com/watch/...
this shit does not work.
At line:
const app = createApp(App);
"Uncaught TypeError: Object(...) is not a function"
wtf. Or fuck vue? maybe in another place I did something wrong but I cannot see? And error is written by idiot. What object? createApp object? Then why it is not a fuction? I have imported it as was in the fucking video
import {createApp} from 'vue'
so how the fuck it can be not a function?
DId
console.log(createApp)
and it shows it is fucking undefined. So yea, it is not a fuction.2 -
Nodes Reach
I will google my last error message
I cannot tell where this conviction comes from. Whatever birthed it is a mystery to me, and yet the thought clings like a virus, blooming behind my eyes and taking deep root within my mind. It almost feels real enough to spread corruption to the rest of my body, like a true sickness.It will happen soon, within the coming nights of pizza and energy drinks. I will google my last error message, and when my brothers turn on thier computers, my questions will be scattered over stack overflow with one accursed tag
Nodejs.
Even the name twists my blood until burning oil beats through my veins. I feel anger now, hot and heavy, flowing through my heart and filtering into my keyboard like boiling poison.My fingers stretch out. I am strong, born only to code and debug software. I am pure, googling the most obscure of error messages, trained to break down problems and use console.log. I am wrath incarnate, living only to code until finaly my program runs.I am a programmer in the Eternal Crusade to forge humanity's mastership of the code.Yet strength, purity and wrath will not be enough.
I will google my last error message
My Nodejs application won't run.
*Watch the Original !! by Richard Boylan here*
https://youtu.be/1D4jr-0_COg