1
508
2
189
3
10
4
87
5
51

Hover Text:

I'm trying to build character, but Eclipse is really confusing.

Transcript (from explainxkcd)

class Ball extends Throwable {}
class P{
    P target;
    P(P target) {
        this.target = target;
    }
    void aim (Ball ball) {
        try {
            throw ball;
        }
        catch (Ball b) {
            target.aim(b);
        }
    }
    public static void main(String[] args) {
        P parent = new P(null);
        P child = new P(parent);
        parent.target = child;
        parent.aim(new Ball());
    }
}

6
43
submitted 2 months ago by mac@programming.dev to c/comics@programming.dev
7
63
submitted 2 months ago by mac@programming.dev to c/comics@programming.dev

Hover Text:

StackSort connects to StackOverflow, searches for 'sort a list', and downloads and runs code snippets until the list is sorted.

Transcript (from explainxkcd)

define HalfheartedMergeSort(list):
    if length(list)<2:
        return list
    pivot=int(length(list)/2)
    a=HalfheartedMergeSort(list[:pivot])
    b=HalfheartedMergeSort(list[pivot:])
    // ummmmm
    return [a,b] // Here. Sorry.
define FastBogoSort(list):
    // An optimized BogoSort
    // Runs in O(n log n)
    for n from 1 to log(length(list)):
        shuffle(list):
        if isSorted(list):
            return list
    return "Kernel Page Fault (Error code: 2)"
define JobInterviewQuicksort(list):
    Ok so you choose a pivot
    Then divide the list in half
    for each half:
        check to see if it's sorted
            no, wait, it doesn't matter
        compare each element to the pivot
            the bigger ones go in a new list
            the equal ones go into, uh
            the second list from before
        hang on, let me name the lists
            this is list A
            the new one is list B
        put the big ones into list B
        now take the second list
            call it list, uh, A2
        which one was the pivot in?
        scratch all that
        it just recursively calls itself
        until both lists are empty
            right?
        not empty, but you know what I mean
    am I allowed to use the standard libraries?
define PanicSort(list):
    if isSorted(list):
        return list
    for n from 1 to 10000:
        pivot=random(0,length(list))
        list=list[pivot:]+list[:pivot]
        if isSorted(list):
            return list
    if isSorted(list):
        return list:
    if isSorted(list): //this can't be happening
        return list
    if isSorted(list): //come on come on
        return list
    // oh jeez
    // i'm gonna be in so much trouble
    list=[]
    system("shutdown -h +5")
    system("rm -rf ./")
    system("rm -rf ~/*")
    system("rm -rf /")
    system("rd /s /q C:\*") //portability
    return [1,2,3,4,5]

8
111
submitted 2 months ago by mac@programming.dev to c/comics@programming.dev
9
164
submitted 2 months ago by mac@programming.dev to c/comics@programming.dev

Hover Text:

It can take a site a while to figure out that there's a problem with their 'report a bug' form.

Transcript

[Megan and Cueball are at the top of a grassy hill, rendered in silhouette. Megan is lying down on the grass while Cueball is sitting.]
Cueball: I don't understand how my brain works.

[A close-up of the two characters. Megan lifts her head slightly.]
Cueball: But my brain is what I rely on to understand how things work.

[The shot zooms out again.]
Megan: Is that a problem?
Cueball: I'm not sure how to tell.

10
31
submitted 2 months ago by mac@programming.dev to c/comics@programming.dev
11
166
submitted 2 months ago by mac@programming.dev to c/comics@programming.dev

Hover Text:

You can either hang out in the Android Loop or the HURD loop.

Transcript

[The comic is a flowchart. In order to explain this in text, follow the line numbers. Options follow on new lines without numbers.]
How to write good code.
[10.] Start Project. [Go to 20.]

[20.] Do things right or do them fast?
Fast [Go to 30.]
Right [Go to 40.]

[30.] Code fast. [Go to 35.]

[35.] Does it work yet? 
No [Go to 30.]
Almost, but it's become a mass of kludges and spaghetti code. [Go to 50.]

[40.] Code well. [Go to 45.]

[45.] Are you done yet?
No. [Go to 40.]
No, and the requirements have changed. [Go to 50.]

[50.] Throw it all out and start over. [Go to 10.]

[60.] ? [Go to 70.]

[70.] Good code.

12
74
submitted 2 months ago by mac@programming.dev to c/comics@programming.dev
13
165
[xkcd] Tree (17 Dec 2010) (programming.dev)
submitted 2 months ago by mac@programming.dev to c/comics@programming.dev

Hover Text:

Not only is that terrible in general, but you just KNOW Billy's going to open the root present first, and then everyone will have to wait while the heap is rebuilt.

Transcript

[There is a binary Christmas tree, with each node a ball, and lights strung between parent and child nodes. Beneath it is a heap of presents - sorted with the largest on top, smaller presents connected to it with string. Next to the tree is Cueball and his parents, Hairbun and another Cueball.]
Cueball: It's a Christmas tree with a heap of presents underneath!
Mother: ...We're not inviting you home next year.

14
74
[xkcd] DFS (2 Jul 2010) (programming.dev)
submitted 2 months ago by mac@programming.dev to c/comics@programming.dev

Hover Text:

A breadth-first search makes a lot of sense for dating in general, actually; it suggests dating a bunch of people casually before getting serious, rather than having a series of five-year relationships one after the other.

Transcript

[In a caption that breaks the top of the first panels frame:]
Preparing for a date:

[Hairy with wet hair and a towel around his waist thinks with his hand to his chin. There are four situations, but it is not possible to read the fourth line.]
Hairy: What situations might I prepare for?

    1) Medical emergency
    2) Dancing
    3) Food too expensive

[Close-up on Hairy's face, who is still thinking. There are again four situations, but again it is not possible to read the fourth line.]
Hairy: Okay, what kind of emergencies can happen?

        A) Snakebite
        B) Lightning strike
        C) Fall from chair

[Zoooming out again to full figure of Hairy. He is still thinking... There are four snakes mentioned, but again it is not possible to read the fourth line. The word Danger stands beneath the three dots above the "?" after each snake.]
Hairy: Hmm. Which snakes are dangerous? Let's see...

                        Danger

        a) Corn snake ?
        b) Garter snake ?
        c) Copperhead ?

[Hairy is sitting down in a chair with a laptop in his lap, while still wearing the towel.]
Hairy: The research comparing snake venoms is scattered and inconsistent. I'll make a spreadsheet to organize it.

[Bottom panel is larger than top four, and aligned to right. Ponytail meets Hairy on his front stoop. She is carrying a purse, and looks down at the towel he is still wearing. Hairy holds his arms in the air.]
Ponytail: I'm here to pick you up. You're not dressed?
Hairy: By LD50, the inland taipan has the deadliest venom of any snake!

[Below this last panel is the following caption:]
I really need to stop using depth-first searches.

15
141
submitted 2 months ago* (last edited 2 months ago) by mac@programming.dev to c/comics@programming.dev

Hover Text:

The prereqs for CPSC 357, the class on package management, are CPSC 432, CPSC 357, and glibc2.5 or later.

Transcript

[A portion of a page from an imaginary course catalog.]
Page 3

[A table with four columns]

Department
    Computer Science

Course
    CPSC 432

Description
    Intermediate compiler design, with a focus on dependency resolution.

Prereqs
    CPSC 432

[The very top of the text for the next course in the table is visible but unreadable.]

16
35
submitted 2 months ago by mac@programming.dev to c/comics@programming.dev
17
84
submitted 2 months ago by mac@programming.dev to c/comics@programming.dev
18
66
submitted 3 months ago by mac@programming.dev to c/comics@programming.dev
19
30
submitted 3 months ago by mac@programming.dev to c/comics@programming.dev
20
78
submitted 3 months ago by mac@programming.dev to c/comics@programming.dev
21
118
submitted 3 months ago by mac@programming.dev to c/comics@programming.dev
22
103
submitted 3 months ago by mac@programming.dev to c/comics@programming.dev

Hover Text:

To be fair, the braised and confused newt on a bed of crushed Doritos turned out to be delicious.

Transcript

[Three people sit along a table with dishes and drinks in front of them. Cueball is walking in, a plate with food on it in one hand, a laptop in the other.]

[Blondie looks down at her bowl. She has a cup with what appears to be a lump of coal in it.]
Blondie: I've got... Cheerios with a shot of vermouth.
[Cueball 1 has a plate with some kind of cubic food on it. He has a cup of what appears to be two lovebirds in it.]
Cueball 1: At least it's better than the quail eggs in whipped cream and MSG from last time.
[Cueball 2 has a plate with a several lumps of some form of white stuff on it. They have a cup of what appears to be some kind of superfluid flowing out of it.]
Cueball 2: Are these Skittles deep-fried?

Cueball 3: C'mon, guys, be patient. In a few hundred more meals, the genetic algorithm should catch up to existing recipes and start to optimize.
We've decided to drop the CS department from our weekly dinner party hosting rotation.

23
34
submitted 3 months ago by mac@programming.dev to c/comics@programming.dev
24
232
submitted 3 months ago by mac@programming.dev to c/comics@programming.dev

Hover Text:

Some engineer out there has solved P=NP and it's locked up in an electric eggbeater calibration routine. For every 0x5f375a86 we learn about, there are thousands we never see.

Transcript

[Cueball sits at a desk in front of a computer, leaning back in his chair with both hands down to his side. There are cans on the desk and more crushed ones on the floor.]
Cueball: I just wrote the most beautiful code of my life.

[Zoom in on Cueball and top half of desk.]
Cueball: They casually handed me an impossible problem. In 48 hours and 200 lines, I solved it.

[Curved lines with arrows divide the comic into two possible end panels, labeled "Academia" and "Business."]

Academia:
Professor: My god... this will mean a half-dozen papers, a thesis or two, and a paragraph in every textbook on queuing theory!

Business:
Boss: You got the program to stop jamming up? Great. While you're fixing stuff, can you get Outlook to sync with our new phones?

25
64
submitted 3 months ago by mac@programming.dev to c/comics@programming.dev
view more: next ›

Comics

365 readers
1 users here now

A community for sharing comics related to programming

Icon base by Delapouite under CC BY 3.0 with modifications to add a gradient

founded 4 months ago
MODERATORS