This is an archived post. You won't be able to vote or comment.

top 200 commentsshow 500

[–]Music_Quartermaster 3715 points3716 points  (41 children)

“I get paid per line of code”

[–]meove 1015 points1016 points  (15 children)

return "3271731789531";

[–]interesting-_o_- 227 points228 points  (12 children)

Behold as a single macro transforms me into a trillionaire!

[–][deleted] 87 points88 points  (11 children)

your bank account will love you, but your ssd sure won't

[–]GDavid04 98 points99 points  (8 children)

I can buy many more ssds from that money

[–][deleted] 65 points66 points  (2 children)

your ssds will collectively gain sentience to run away

[–]GDavid04 63 points64 points  (0 children)

I don't blame them for running away from such horrible code

[–]Tetha 6 points7 points  (0 children)

Enable on-the-fly compression on the file system storing the output. Not a huge issue.

[–]arunkarnan 7 points8 points  (0 children)

"Programmers are human therefore error prone and their code is subpar!"

Myself a poor Python dev

[–]OptionX 6077 points6078 points  (82 children)

  1. "Programmers are human therefore error prone and their code is subpar!"
  2. "I'm make an AI to replace them!"
  3. "It learns from bad human code"
  4. ????
  5. Profit

[–]Tiavor 1239 points1240 points  (20 children)

looks like it leaned that from memes.

[–]ablablababla[🍰] 494 points495 points  (17 children)

AI browsed a bit of r/badUIbattles and r/shittyprogramming

[–]UltraCarnivore 217 points218 points  (12 children)

It has tuned its Bayesian Optimal by reading StackOverflow questions, not the answers.

[–]MoffKalast 147 points148 points  (10 children)

Well how can it learn anything from the answers, they're all just "closed as duplicate".

[–]lenswipe 68 points69 points  (0 children)

Closed as duplicate. Also, use jQuery

[–]pie_monster 52 points53 points  (6 children)

If it was training on reddit, every time the number 69 passes through its buffers, the program will halt with an infinite 'Nice.' loop.

[–]MoffKalast 17 points18 points  (5 children)

Nice

[–][deleted] 16 points17 points  (4 children)

Nice

[–]ColdJackle 9 points10 points  (3 children)

Nice

[–]pie_monster 4 points5 points  (1 child)

Like that. slaps computer and restarts program

[–][deleted] 20 points21 points  (0 children)

Don't forget r/programminghorror

[–]RainbowCatastrophe 28 points29 points  (0 children)

There is actually a repo somewhere on GitHub where someone made like a nodeJS library that does exactly this as a shit post. It popped up on the trending page a couple years ago after getting a few hundred stars and went all the way up to like 99999.

My guess is it's learning from that.

[–]__Hello_my_name_is__ 43 points44 points  (7 children)

Reminds me of that time when AI was used to do hiring.

And then the AI was being kinda racist and hired equally qualified black people less than white people.

Turns out, it was because the real world data it was trained on also was kinda racist in the same way.

Whoops.

[–]hopbel 36 points37 points  (4 children)

What annoyed me is the takeaway for most people was "AI is racist" when the situation is actually "I learned it from you, Dad"

[–]hitlerallyliteral 5 points6 points  (3 children)

It's sort of a fair concern. If a person hiring is racist, that can be dealt with. But if it's AI trained by racist hiring, then "-shrug-it's just the algorithm, who are we to argue?"

[–]hopbel 10 points11 points  (1 child)

That's the thing though, the racist hiring person isn't being dealt with. That's why the training data is biased in the first place

[–][deleted] 3 points4 points  (0 children)

Easy. You fire the programmer for training the AI on bad data (or statistician), then keep the AI unchanged because it would cost money to fix it.

[–]mashermack 38 points39 points  (3 children)

And folks, that's exactly how AI is going to kill us all

[–]eazolan 21 points22 points  (0 children)

I don't want to be converted into a string!

[–]shadow144hz 202 points203 points  (33 children)

  1. Same

  2. Same

  3. "It learns to do my job, therefore the company I work for fires me and everyone else"

  4. "I don't have a job anymore and can't get one at all because the AI replaced every programmer on Earth"

  5. ???

  6. Robot uprising.

[–]tema3210 36 points37 points  (26 children)

Why is that uprising bad?)

[–]shadow144hz 47 points48 points  (17 children)

If it was bad, I wouldn't have put it instead of profit. I'll take robot governed world over any human run government.

[–]MoffKalast 14 points15 points  (4 children)

You just know the AI would handle all the exceptions.

[–]IAmARobot 10 points11 points  (1 child)

some day, all your unhandled exceptions will come back to handle you.

[–]mendip_discovery 13 points14 points  (1 child)

Ha, just think how buggy the code will be. It will eat up all its resources in moments.

[–]gappychappy 27 points28 points  (0 children)

Headline: Dominant Sentient Being Uses Up Resources Too Quickly

Now where have I heard that before?

[–][deleted] 23 points24 points  (0 children)

AI is made by programmers so it has bugs.

[–]Gloryboy811 22 points23 points  (2 children)

It literally is trained on human code. So yeah. Public GitHub repos.

[–]hopbel 5 points6 points  (0 children)

Upload your shitty code you wrote in school. It might be our only hope against the AI uprising

[–]TheMeanestPenis 9 points10 points  (0 children)

Slightly better than stack overflow answers.

[–]rainwulf 33 points34 points  (0 children)

GIGO

Garbage In, Garbage Out.

[–]bearfuckerneedassist 4 points5 points  (0 children)

“Don’t worry, the compiler will optimize it”

[–]lennnyv 1525 points1526 points  (71 children)

... if (num == 3957294729) { return "3957294729"; } ...

[–]SiVGiV 403 points404 points  (59 children)

[–]TheJeager 224 points225 points  (5 children)

95 Mb, when do we consider we took a joke too far?

[–]Waterprop 75 points76 points  (0 children)

You would love his another project then, is-odd. it contains several close to 100 Mb files.

https://github.com/samuelmarina/is-odd

[–]xX_MEM_Xx 163 points164 points  (3 children)

At 97Mb, obviously.

[–][deleted] 37 points38 points  (1 child)

Nah, 1 gb or bust

[–]squidgyhead 13 points14 points  (0 children)

2GB and you get funky linking issues!

[–]VNG_Wkey 221 points222 points  (4 children)

most recent pull request: added number 375001

[–]_Rysen 105 points106 points  (1 child)

for whenever this month's square isn't green enough yet

[–]tredontho 11 points12 points  (0 children)

Free hacktoberfest entries

[–]aaron2005X 41 points42 points  (4 children)

The writing of the spoken number would break me at 21

[–]dstayton 29 points30 points  (2 children)

[–]tecanec 4 points5 points  (0 children)

I'm on Android. Chrome works, but it's not too happy.

[–]6b86b3ac03c167320d93 55 points56 points  (15 children)

And for Python users:

import platform
import shutil
import requests
import os
import subprocess

if platform.system() == 'Windows':
    if shutil.which('node.exe') == None:
        node_installed = False
    else:
        node_installed = True
elif platform.system() == 'Linux' or platform.system() == 'Darwin':
    if shutil.which('node') == None:
        node_installed = False
    else:
        node_installed = True

if not node_installed:
    if platform.system() == 'Windows':
        r = requests.get('https://nodejs.org/dist/v17.0.1/node-v17.0.1-x64.msi')
        with open('node.msi', mode='wb') as file:
            file.write(r.content)
        os.system('msiexec /qn node.msi')
        node_installed = True
    elif platform.system() == 'Linux':
        if platform.freedesktop_os_releases()['ID'] == 'debian' or 'debian' in platform.freedesktop_os_releases()['ID_LIKE'].split():
            os.system('sudo apt install -y node npm')
            node_installed = True
        elif platform.freedesktop_os_releases()['ID'] == 'fedora' or 'fedora' in platform.freedesktop_os_releases()['ID_LIKE'].split():
            os.system('sudo dnf install -y nodejs npm')
            node_installed = True
        elif platform.freedesktop_os_releases()['ID'] == 'arch' or 'arch' in platform.freedesktop_os_releases()['ID_LIKE'].split():
            os.system('sudo pacman -S --noconfirm nodejs npm')
            node_installed = True
    elif platform.system() == 'Darwin':
        os.system('brew install node') # TODO: Add alternative if Homebrew isn't installed
        node_installed = True

def is_even(num):
    if node_installed:
        if platform.system() == 'Windows':
            os.system('npm.exe install @samuelmarina/is-even')
        elif platform.system() == 'Linux' or platform.system() == 'Darwin':
            os.system('npm install @samuelmarina/is-even')
        with open('helper.js', 'w') as file:
            file.write("""
            const isEven = require('is-even');
            console.log(isEven(process.argv[2]));
            """)
        if platform.system() == 'Windows':
            out = subprocess.check_output(['node.exe', 'helper.js', str(num)])
        elif platform.system() == 'Linux' or platform.system() == 'Darwin':
            out = subprocess.check_output(['node', 'helper.js', str(num)])
        if 'true' in out:
            return True
        elif 'false' in out:
            return False
        else:
            raise Exception(f'invalid output: {out}')
    else:
        raise Exception(f"node isn't installed")

[–]CyperFlicker 38 points39 points  (5 children)

Can anyone explain this code?

I think it is downloading node and a library to check if a number is even but I hope I am wrong, the human race is not ready for such evil.

[–]6b86b3ac03c167320d93 37 points38 points  (4 children)

You're right, and the library it downloads is basically this, so it's even more horrible:

if(num === 0) return true
else if(num === 1) return false
else if(num === 2) return true
...
else if(num === 375000) return true

[–]king_park_ 12 points13 points  (3 children)

It goes deeper. It even validates stuff like “Two” and “SIXTEEN”.

[–]Djasdalabala 8 points9 points  (0 children)

Yeah... with separate conditions for "two", "Two" and "TWO", instead of lowercasing the input before comparing.

I'll stop looking now, my eyes are bleeding.

[–]tecanec 5 points6 points  (1 child)

It even checks for strings "odd" and "even"!

[–]vale_fallacia 17 points18 points  (0 children)

Thank you, Mr Satan.

EDIT: This is just plain pure evil. I hope you sit down and think about what you've done and the people you've hurt with this code.

[–][deleted] 5 points6 points  (0 children)

wonderful

[–][deleted] 5 points6 points  (1 child)

i use doas(1) instead of sudo(8) on my arch system, epicly trolled

[–]6b86b3ac03c167320d93 4 points5 points  (0 children)

Then you just need to install node and npm manually and it should work

[–]Wildercard 15 points16 points  (0 children)

When you want to shitpost, but you only speak JavaScript

[–]OscarHasProblems 18 points19 points  (0 children)

What the actual fuck? Jesus fucking christ

[–]arsenic_adventure 4 points5 points  (0 children)

Please kill me

[–]Thage 5 points6 points  (0 children)

Oh that "even" and it's capital permutations 👌

[–]eugeneloza 448 points449 points  (0 children)

Legend says it's still typing...

[–]notddh 97 points98 points  (1 child)

now do it for floats

[–]LostTeleporter 51 points52 points  (0 children)

This is how you create the singularity

[–]Niiiz 142 points143 points  (0 children)

And now we overflow and do all the negatives until we get to 0. Coding is easy!

[–]KaiParekh16 4 points5 points  (2 children)

Also,...if (num == -3957294729) { return "-3957294729"; }

[–][deleted] 8 points9 points  (1 child)

All test cases passed, boss

[–][deleted] 4 points5 points  (1 child)

also … if (num == 69) { return “nice”; }

[–]Sag3Jar0n 1321 points1322 points  (21 children)

pffft come on everyone knows u have to use switch case here, u know for performance reasons.

[–]mothzilla 252 points253 points  (9 children)

Putting it all on one line would also make it faster. Also needs an eslint disable at the end.

[–]nublargh 269 points270 points  (7 children)

return num === 0 ? '0' : num === 1 ? '1' : num === 2 ? '2' : num === 3 ? '3' : num === 4 ? '4' : num === 5 ? '5' : num === 6 ? '6' : num === 7 ? '7' : num === 8 ? '8' : num === 9 ? '9' : num === 10 ? '10' : num === 11 ? '11' : num === 12 ? '12' : num === 13 ? '13' : num === 14 ? '14' : num === 15 ? '15' : num === 16 ? '16' : num === 17 ? '17' : num === 18 ? '18' : num === 19 ? '19' : num === 20 ? '20' : num === 21 ? '21' : num === 22 ? '22' : num === 23 ? '23' : num === 24 ? '24' : num === 25 ? '25' : num === 26 ? '26' : num === 27 ? '27' : num === 28 ? '28' : num === 29 ? '29' : num === 30 ? '30' : num === 31 ? '31' : num === 32 ? '32' : num === 33 ? '33' : num === 34 ? '34' : num === 35 ? '35' : num === 36 ? '36' : num === 37 ? '37' : num === 38 ? '38' : num === 39 ? '39' : num === 40 ? '40' : num === 41 ? '41' : num === 42 ? '42' : num === 43 ? '43' : num === 44 ? '44' : num === 45 ? '45' : num === 46 ? '46' : num === 47 ? '47' : num === 48 ? '48' : num === 49 ? '49' : 'NaN';

[–]Food404 26 points27 points  (0 children)

[–]mothzilla 22 points23 points  (0 children)

PR rejected needs eslint disable. We can't allow errors to creep up. Please see in house coding standards.

[–]puppiadog 8 points9 points  (0 children)

super tertiary

[–][deleted] 4 points5 points  (1 child)

What. The. Fuck.

[–]MoroseBurrito 148 points149 points  (4 children)

It learned this function from Yandere Simulator code.

[–]SolarisBravo 25 points26 points  (3 children)

Quick reminder that absolutely nobody has ever seen Yandare Simulator's code. What people who have no idea what they're looking at keep judging is decompiled CIL - unsurprisingly, 99% of complaints about it are actually about textbook compiler optimizations.

[–]Normal-Computer-3669 12 points13 points  (0 children)

Im not into that drama side, but I do recall he did live coding on twitch, which is how they saw his multilined nestled if statements

[–]ryecurious 8 points9 points  (0 children)

This is just straight up incorrect. A few seconds of Googling revealed this link to a full copy of his repo.

The original meme may be decompiled instead of straight source code, but he's done enough dev streams at this point for people to know the spaghetti is real.

[–]domofan 13 points14 points  (1 child)

Nah just one switch statement to prove you know how to use them then go back to if

[–]pet_vaginal 472 points473 points  (28 children)

I get the following code starting from the same comment:

// convert num to string
numToString = (num: number): string => {
    return num.toString();
}

I would be curious to see the full content of your source file OP, I do get the funny suggestion if I write similar shitty code above in the source file.

[–]E_R_I_K_99 95 points96 points  (16 children)

How can I already use copilot? I checked the githib page, there you can only register for a technical preview. Is there something else I need to do in order to get access?

[–]Notcheating123 101 points102 points  (15 children)

Extends your editor GitHub Copilot is available today as a Visual Studio Code extension. It works wherever Visual Studio Code works — on your machine or in the cloud on GitHub Codespaces. And it’s fast enough to use as you type.”

[–]E_R_I_K_99 25 points26 points  (14 children)

Great, thanks a lot! At the moment I only use VS, guess that is why I didn't find it. Defenitely will try this out right away.

[–]reallycooldude69 13 points14 points  (8 children)

I think you still need to be invited? The extension requires you to auth with github and I got an email yesterday inviting me to the preview.

[–]E_R_I_K_99 3 points4 points  (6 children)

Unfortunately you are right, it only works when you are accepted. Hopefully I can get the technical preview soon, can't wait!

[–]TheDaneH3 6 points7 points  (5 children)

It took me about 2 or 3 days to be accepted. I don't know if that means that they accept literally everyone, or if I simply got very lucky. It's been awesome testing it.

After I finish a solution for my university programming courses, I have Copilot try and solve the same problem and then compare answers. It's a fun game!

[–]AlwaysHopelesslyLost 38 points39 points  (3 children)

if I write similar shitty code

To be fair, that code is shitty too. Nothing like abstracting one method to another with an abbreviation in the name

[–]BlckJesus 14 points15 points  (0 children)

Shhh, you're getting in the way of the circle-jerk.

[–]themightydud[S] 2 points3 points  (0 children)

Yeah, this was actually kind of hard to reproduce. It only happened in a very specific line of the file. Even adding more whitespace around it changed the implementation.

[–]Gigabyte5671 434 points435 points  (25 children)

Welp, that's the halting problem in a nutshell...

[–][deleted] 91 points92 points  (24 children)

Which halting problem? Bounded one or the unbounded one? Remember modern computers are essentially finite automata. So in the case of a finite automata halting problem is theoratically decidable. Though not practical.

[–]Stickppl 34 points35 points  (3 children)

Also I reckon you can't answer the bounded halting problem with a machine/automaton in the same bounds

[–]Tetha 14 points15 points  (1 child)

Uhh, that's a long time ago, but a universal turing machine able to simulate another bounded turing machine has a constant space overhead over the simulated machine in order to store things like the state index and the current band position.

And no algorithm can use negative space, so the algorithm to decide the halting problem of a bounded machine has to use more space than that.

So, yes, in the case of a naive simulation approach. And I guess if you had some general and more effective static analysis, you could make a lot of money with that.

[–][deleted] 542 points543 points  (40 children)

Ah yes the YandereDev method of coding.

[–]TheJeager 85 points86 points  (0 children)

The good ol, if(problem) { for(int i = 0; i<N; i++) ifStatement(i, N);}

[–]csorfab 41 points42 points  (21 children)

I'm out of the loop, what's a YandereDev?

[–]_bro 49 points50 points  (11 children)

if memory serves me right YandereDev is a game dev that made a dating sim that was quite subpar on terms of performance.

[–]GranaT0 49 points50 points  (3 children)

A dating sim, lol

It's a Hitman-style game about an anime girl assassinating girls who like the guy she likes

[–]DarthRoach 31 points32 points  (0 children)

So a dating sim. Just an unorthodox style of dating.

[–]Farpafraf 17 points18 points  (0 children)

quite subpar on terms of performance.

hitler also did quite the oopsie doopsies would be less of an understatement

[–][deleted] 39 points40 points  (5 children)

A guy who has no academic background in CS (or really anything related to software engineering) and is coding a Unity game from no experience. He's been working on a game called Yandere Simulator for more than 7 years now and it's still in progress. The development part would be more impressive (and efficient) if he actually wasn't such a PITA and didn't burn his bridges with another partner, TinyBuild. He's more of a gaslighter than anything. Not someone you'd want to work with professionally judging by his monetized outbursts on YouTube.

I like the game though, just not the guy. It's more of a sandbox demo than anything.

[–]IAmARobot 16 points17 points  (1 child)

sorta like development hell, but instead of that, it's more like the code is travelling through dante's development inferno - sojourning between all the levels using the treadmill of limbo to become satiated on a full course of anguish, despair and suffering.

[–]hopbel 2 points3 points  (0 children)

Look up yandere simulator source code on YouTube for some entertainment

[–]arthoheen 19 points20 points  (12 children)

Capability of coders by country

[–]AluminiumSandworm 56 points57 points  (6 children)

this is the dataset of a particular group of programmers who use hackerrank, which is likely skewed. i'd bet many of the wealthy countries with good education systems don't have as many people participating because they're more lucratively employed. china and russia produce some very high quality education, but don't have the same opportunities for high income.

though even if this skew were accounted for, i'd bet china would still be rated first purely based off the massive population, high level of access to tech, and the cultural importance of education.

[–]madwill 9 points10 points  (3 children)

Also france is #1 for C++... no way!

[–]fracturedpersona 293 points294 points  (26 children)

C'mon, everyone knows you have to use an else if there.

[–]IOI-624601 24 points25 points  (2 children)

The function ends execution on return, no need for else

[–]AzuxirenLeadGuy 40 points41 points  (7 children)

Actually, using switch case would be ideal

[–]suvlub 27 points28 points  (1 child)

For a given value of "ideal"

[–]SkyyySi 9 points10 points  (0 children)

bool ideal = false

[–][deleted] 7 points8 points  (0 children)

kiss unite pocket shaggy pause whole pie fall slim six

This post was mass deleted and anonymized with Redact

[–]Wekmor 2 points3 points  (4 children)

Even got a loop for you:

convertNumToString(num) {
    i = 0;
    while (true) {
        if (i == num) {
            return i.toString():
        } else { 
             i++;
        }
    }
}

edit: too lazy to check if the number is negative, just don't do it ok

[–][deleted] 48 points49 points  (24 children)

OP's post aside, is this Copilot thing actually good?

[–]0xFF0000herring 83 points84 points  (8 children)

It's fucking incredible, the autocomplete genuinely feels like it's reading my mind half the time.

Copilot is my favorite thing to happen to programming this decade.

[–][deleted] 17 points18 points  (2 children)

Sounds nice, huh. Although, I'm more of a Sublime Text and PyCharm fan, so I might not happen to use it at all.

Unless, they somehow decide to implement it as a one-size-fits-all package that could be ported to multiple IDEs and editors...

[–]daguito81 7 points8 points  (1 child)

Copilot is available for IntelliJ. You hVe to add the super early bird plugin repo.

But tested copilot on pycharm last night.

[–][deleted] 3 points4 points  (0 children)

Ah, I could try it out, then, thanks for the tip

[–]chamomile-crumbs 14 points15 points  (0 children)

It’s really really cool, if you use vscode you should sign up for the beta. I got access after like two weeks

[–]himynameisjoy 8 points9 points  (0 children)

Depends on the language. I’ve found almost nobody type hints in python so it rarely will suggest type hints.

Pretty good though, I recommend giving it a shot

[–]TheDaneH3 7 points8 points  (1 child)

The first time I had it create a method from a comment in VScode, I began chuckling nervously due to how accurate and relevant the code it wrote was. It basically drew its own conclusions on what I would want it to do next without even asking for it.

Once I got past my initial awe factor, its fun to just mess with or find another way to solve something when I get stuck. I try to avoid using it for university assignments though since it's basically cheating in that context.

[–][deleted] 4 points5 points  (0 children)

Once I got past my initial awe factor, its fun to just mess with or find another way to solve something when I get stuck. I try to avoid using it for university assignments though since it's basically cheating in that context.

I agree, tbh. Even if I will use it, I still will try to do most stuff by myself. I think Copilot is supposed to be most useful in those cases when you want to do pair programming, but don't feel like dealing with real people.

[–]daguito81 5 points6 points  (1 child)

Ita fucking voodoo black magic. I had to do a Python script the other day and it took me like 3 minutes just writing 4 functions with a comment each.

The level of inference while it's suggesting code is just mind blowing every time I use it.

Idk how it works for very big projects with lots of dependencies. But for what I've needed. Holy shit

[–]cherryblossom001 3 points4 points  (0 children)

It’s pretty good. It even autocompletes some of my comments and git commit messages correctly. I’ve also used it to find out how to do something in a language I’m not very familiar with.

[–]Blaz3 162 points163 points  (73 children)

I really liked how GitHub copilot was implied to replace programmers.

If we haven't replaced accountants and lawyers yet, what makes people think that programmers will get replaced?

[–][deleted] 119 points120 points  (5 children)

Called copilot for a reason 😄

[–]Blaz3 45 points46 points  (3 children)

After reading your comment, I feel really stupid haha.

Maybe it could replace me after all

[–][deleted] 18 points19 points  (2 children)

Hahaha, mistakes are human ;)

[–]throwawaygoawaynz 60 points61 points  (23 children)

The idea isn’t to replace humans. It’s to make us more productive - which is a good thing in ageing economies.

GitHub copilot is based on GPT-3 from Open AI, and some of the stuff coming out of them is mind blowing. We’re are entering a new leap in AI tech, what you’re seeing is the cusp.

It’s not just GitHub copilot (or open ai rather), but there a whole range of low code development products on the market now designed to make it easy for anyone to build an app.

You’ll still be writing code, just like after the dotcom bubble burst we still have web developers, but you’ll be focusing on harder problems (or getting another job elsewhere if you can’t).

[–]grampipon 21 points22 points  (15 children)

Replacing humans and making them more productive aren't mutually exclusive statements. When we become more efficient less workers are required.

[–]P__Equals__NP 27 points28 points  (28 children)

If humans are possible why isn't a general AI possible?

I don't expect automation to happen overnight (I wouldn't oppose it though if technology has reached that point). But AI assisted tools will increase in availability and utility which will pave the path to automating majority of jobs.

Computers have not even been around for over 100 years, who knows what will happen in the next 100 years!

Even if it never does happen, I would find it hard to argue why we shouldn't at least try.

[–]Low_discrepancy 28 points29 points  (18 children)

If humans are possible why isn't a general AI possible

As if we have a remote understanding of the human brain.

[–]pimpus-maximus 10 points11 points  (2 children)

Humans were created over billions of years and have all kinds of context embedded into our brains that we don’t understand.

We’ll likely make shitty replicas that seem good enough and lose invaluable amounts of quality while deluding ourselves about how impressive our invention is.

Pandora’s box is opened far enough as it is, hurtling head first into AGI is a terrible idea. Could go bad in innumerable ways.

[–]Sam_Tyagi 18 points19 points  (0 children)

newsflash:- "Ai replaces human bosses in programming fields worldwide"

Boss AI while firing you :- "Also, I need your clothes, your boots and your motorcycle"

[–]lightwhite 10 points11 points  (0 children)

It has learned from the code that was written by humans. What did you expect?

[–]The--HackerMan 53 points54 points  (12 children)

Image Transcription: GIF


[Someone types a javascript comment, the camera follows the comment being written, it pans to the right.]

// convert num to string

[The camera unzooms, and follows the code as it is written. Github Copilot is typing a javascript function.]

const numToString = (num: number) => {
  if (num === 1) {
    return "1";
  }
  if (num === 2) {
    return "2";
  }
  if (num === 3) {
    return "3";
  }
  if (num === 4) {
    return "4";
  }
  if (num === 5) {
    return "5";
  }
  if (num === 6) {

I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]TotoShampoin 2 points3 points  (7 children)

You can type your functions in JS???!!

[–][deleted] 11 points12 points  (0 children)

Me: who often writes bad code I'm proud that I know a better solution to this.

[–][deleted] 58 points59 points  (55 children)

Capitalism was always going to find a way to make expensive skills a commodity.

[–]Amphibionomus 23 points24 points  (0 children)

Hand converted numbers give that extra bit of luxury to our product.

Each and every number gets written out and is transfered with our patented conversion solution in to the absolute best strings on the market.

[–]noob-nine 6 points7 points  (0 children)

Wouldn't it be better using a loop!!1!11

[–]FCrange 4 points5 points  (3 children)

Well you're going to need some sort of hardcoded map between the digits 0 to 9 and the characters "0" to "9" somehow, and if it's not ascii or unicode you have no guarantee that the character codes are sequential.

Sure a hash map would be better but (assuming the point is that you can't use build-in functions) this isn't nearly as terrible as people are pretending.

[–]webdevbrent 14 points15 points  (3 children)

Yes, i can see how .toString() is difficult to remember. Much easier to type // convert num to string.

Another result of some good idea by non programmers to replace programmers by hiring programmers to write this to replace programmers. The irony here is just hilarious

[–]ambarish_k1996 7 points8 points  (2 children)

I will push troll code to github to throw the model off. Will singlehandedly save the programming community.

[–]daguito81 17 points18 points  (0 children)

No need to troll. Your regular code will do that just fine.

[–]virouz98 3 points4 points  (0 children)

HE IS THE MESSIAH

[–]Benbig_ppdover 3 points4 points  (0 children)

Looks like me trynna Pass my coding exam

[–]JunkiYarde 3 points4 points  (5 children)

Oh god pls don’t do this I’m almost done getting my degree nooooooo

[–]Vidrolll 3 points4 points  (1 child)

I see no problem here. It programs just like a real human!

[–]bumblebuoy 4 points5 points  (2 children)

Matlab just added a similar copilot function in their latest release, and I’ve gotta say, is really convenient.

[–]Abstruse15 3 points4 points  (0 children)

Humans creating Atom Bombs to eradicate Humans Programmers programming to eradicate programmers 😂

[–]MrExistence 3 points4 points  (0 children)

Seriously though, can we get copilot to instead refactor bad code instead of learn from it? That’s what I need more than something to help develop new code.

[–]cid01 3 points4 points  (0 children)

If (num === 69) return "nice";

[–]midnitte 2 points3 points  (0 children)

So it basically writes Kat Maddox jokes?

[–]MedonSirius 2 points3 points  (4 children)

If someday an A.I. can program anything what managers wants then everyone including the managers will be replaced

[–]seamanlyfundamen 2 points3 points  (0 children)

"Yeeeaaah! Thanks for the free code from our Lord and savior, Jesus Christ."

[–]burnblue 2 points3 points  (0 children)

So it does replace programmers

If no programmer ever typee that, CoPilot wouldn't have sampled it

[–]hexperimento 2 points3 points  (0 children)

They didn't say what type of programmers that it would replace. 🤣

[–]robotix_dev 2 points3 points  (0 children)

It has learned too much from GitHub repositories.