r/AskProgramming • • Jun 16 '22

Other Wife here- Not a programmer - needs help with present for a new Dad please.

Hi all! We’re expecting and my husband has designed our baby’s first outfit. It’s going to have: console.log(“Hello World”);

I want to make him a new dad shirt and was thinking: console.log(“Hello Dad”);

I know basically nothing of programming so I’m not sure if that makes sense or is correct. Any help or suggestions are greatly appreciated!! Thank you!

Edit: Thanks for your help! I appreciate the suggestions and even though I can’t make them all, I’m kinda excited to show him all of your comments after baby arrives. :)

58 Upvotes

57 comments sorted by

16

u/temporarybunnehs Jun 16 '22

There has got to be a good joke/clever pun in here somewhere. Inheritance and Parent/Child classes are a core component of many languages. I'm just not clever enough.

7

u/lalasprinkle Jun 16 '22

No worries. I just want to make sure whatever I do is correct in respect to programming.

20

u/MarkusBerkel Jun 16 '22

Your “Hello Dad” idea is adorable. I would love it.

4

u/Fantastic-Ad-9019 Jun 16 '22

Could you do something like:

Class [newborn name] extends [husband's name] {

@override
Public void talk() {
    System.out.println("Hello Dad!");
}

}

Would that be any good?😛

3

u/YourNightmar31 Jun 16 '22

Your formatting messed up. But that is pretty cool :)

7

u/Gredelston Jun 16 '22

Do you know what programming language(s) your husband uses? If not, could you find out for us?

13

u/lalasprinkle Jun 16 '22

It’s Java. I had to be sneaky and find out for sure. Lol

5

u/saladbaronweekends Jun 17 '22

Based on the shirt he made this is JavaScript (an entirely different language than Java)

3

u/lalasprinkle Jun 17 '22

I may have misquoted him because I thought Java was short for JavaScript. I’m gonna blame pregnancy brain. My bad, sorry guys!

cue rainbow star the more you know!

I’ll try to confirm this evening when he gets home which it is.

4

u/Beerbelly22 Jun 17 '22

Are you sure its java and not javascript, there is a difference, console.log () is javascript.

Also use the correct quotes " not the msword ones

1

u/[deleted] Jun 17 '22

if it's java you could use, System.out.println("Hello Dad");

2

u/lalasprinkle Jun 17 '22

Good news! He’s able to do both, but mostly uses JavaScript.

I got a whole mini lesson on how the two are not related. :)

3

u/Gredelston Jun 17 '22

Yup, Java and JavaScript are related the same way "car" and "carpet" are related. Which is to say, not at all.

6

u/[deleted] Jun 16 '22

Traditionally, there's a comma and an exclamation point. We love our grammar and are excited.

Hello, World!

3

u/lalasprinkle Jun 16 '22

Oh, oops. Gotcha. Lol thank you!

10

u/[deleted] Jun 16 '22

I think console.log(“hello baby”) or console.log(“hello Jane”) etc might work better. You can think of console.log as a way for the wearer to say something, so the baby is saying hello to the world and dad would be saying hello to the baby.

5

u/lalasprinkle Jun 16 '22

Ah, that makes sense. Thanks! Now I need to make two shirts for him. ☺️

3

u/lawrencedarcy Jun 16 '22

As a programmer but also a human, I think your original idea was by far the best here! Stick with it

3

u/lalasprinkle Jun 16 '22

Thanks! :)

6

u/CharacterUse Jun 16 '22

You'rs will work fine, but (if he is a Javascript programmer) perhaps he might appreciate:

Front:

let myFamily = new Offspring("daughter", "Emily");
console.log(myFamily.show());

Back:

class Family {
  constructor(offspring) { 
    this.child = offspring; 
  } 
  present() { 
    return 'I have a new ' + this.child;
  } 
}

class Offspring extends Family {
  constructor(offspring, name) {
    super(offspring);
    this.name = name;
  }
  show() {
    return this.present() + ', ' + this.name + '!';
  }
}

(obvs. change son|daughter and name as appropriate)

3

u/lalasprinkle Jun 16 '22

This is really cool, thank you!

Just for clarification, We’re having a daughter so I would only change “Emily” to the correct name on the front of the shirt and then leave the back of the shirt as is?

1

u/CharacterUse Jun 16 '22

Yes, correct!

2

u/lalasprinkle Jun 16 '22

This is cool! I don’t quite understand, but I know he will. Thank you for the suggestion!!

9

u/Zyklonik Jun 16 '22
delete offspring;

2

u/RonSijm Jun 16 '22

Thread 'offspring' was being aborted.

1

u/randomlumberjak Jun 17 '22

this is the one

4

u/[deleted] Jun 16 '22

You said your husband uses Java. People are giving both JavaScript and Java examples (probably because console.log() is a JavaScript function. Java is not JavaScript.

Here are the Java recommendations: [1] [2]

1

u/lalasprinkle Jun 16 '22

Thank you for the clarification and help. :)

1

u/FatFingerHelperBot Jun 16 '22

It seems that your comment contains 1 or more links that are hard to tap for mobile users. I will extend those so they're easier for our sausage fingers to click!

Here is link number 1 - Previous text "1"

Here is link number 2 - Previous text "2"


Please PM /u/eganwall with issues or feedback! | Code | Delete

1

u/oxymo Jun 16 '22

Good bot

2

u/grooomps Jun 17 '22

Hello World is generally the first thing someone does in programming, just to see if the environment is working, i had another idea you could use if you wanted to not use the Hello Dad that other's have suggested:

you could do a const dad = true;

what this is saying is you're setting a "variable" - which is like a name for something you're using, to be true which i'm sure you know what that means! const means it can't be changed also!(like constant)

1

u/lalasprinkle Jun 17 '22

That’s cute! Thank you for the explanation too. :)

2

u/immersiveGamer Jun 17 '22

Alternative route if you need extra ideas. My wife got me a shirt that said:
d
a
d

But in binary ASCII, so it is bunch of zeros and ones.

1

u/lalasprinkle Jun 17 '22

He’d appreciate that one. Thank you for the idea!

61

u/[deleted] Jun 16 '22
class [Name of your Husband] implements Cloneable {
}

... too far fetched?

9

u/YourNightmar31 Jun 16 '22

LOL that took me a while to get actually, but really good

3

u/[deleted] Jun 16 '22

Haha thanks mate. Yeah I thought that might be a bit hard to get but it just came to me so I dropped it here

44

u/TheActualStudy Jun 16 '22
const EventEmitter = require('events');
const dad = new EventEmitter();

dad.on("I'm hungry!", () => {
    dad.emit("Hi Hungry, I'm Dad!");
});

3

u/PooSham Jun 16 '22

This one I like

6

u/Mr_Nice_ Jun 17 '22

while(dad) !sleep;

2

u/Toni78 Jun 16 '22 edited Jun 16 '22

Assembly language:

add mom, dad
push mom
pop me

It is not exactly accurate. Add mom, dad means exactly how it reads. Add dad to mom. Push mom, means save (mom + dad) in the memory (it is called the stack). Pop me, means pull out if memory mom + dad and that’s me, the baby. Technically pushing and poping it is not necessary but it adds a bit of fun to the message. It could say pop mini_me instead of me since it is for your husband and not the baby.

2

u/SpaceMonkeyOnABike Jun 16 '22

pid_t childPID = fork();

2

u/thisquantime Jun 17 '22

git add baby.java

git commit -m 'init new member'

git push

git its a tool where you can manage the source code and versions in this case is adding new file (baby.java), the commit is to prepare the project to update, -m its a comment also could be “under construction” or “ready for production”

2

u/bi-nz Jun 17 '22

HTTP Response 201

2

u/Beerbelly22 Jun 17 '22

Daddy.addEventListener("cry", feedBaby);

2

u/jibbit Jun 17 '22 edited Jun 17 '22

To my mind:

Hello world!

Is all you need. This is still explicitly a programming joke, and all the better for being minimal

2

u/gm310509 Jun 18 '22 edited Jun 18 '22

This is probably better suited for your new baby (congratulations BTW), rather than your husband, but there is a famous C program from the 1980's from a famous book about the C programming language. At the time, it was quite revolutionary and is still used in many different ways on many different systems.

I would venture to suggest that anyone who has done any C programming (which is many many many people) will have heard of it.

One common variant of the program is:

#include <stdio.h>
int main(int argc, char *argv[]) {
    printf("hello, world\n");
    return 0;
}

Have a look at the handwritten note on this page: https://en.wikipedia.org/wiki/The_C_Programming_Language

Also: https://www.artsy.net/artwork/brian-kernighan-hello-world

and if you didn't fall asleep yet Section 1.1 "Getting started" of the actual Kerning + Richie book

Of course if you did want to make it for your husband, you could replace "hello, world" with any other message of your choosing.

As far as I am aware, this "hello, world" program written in C is the original - that all other languages have "reused" the idea.

0

u/[deleted] Jun 16 '22

Pleasant idea but please don’t go overboard. It gets cringy

7

u/lalasprinkle Jun 16 '22

Very true. Thanks for the reminder. I figure one or two new dad shirts would be nice. ☺️

4

u/[deleted] Jun 16 '22

Awesome!

10

u/[deleted] Jun 16 '22 edited Jun 16 '22

[removed] — view removed comment

3

u/carcigenicate Jun 16 '22

Why was this downvoted? Not a bad idea. That's not directly related to programming, but any experienced programmer will understand it.

15

u/YMK1234 Jun 16 '22

didnt downvote, but it doesnt relate to the kids shirt, which I think would be a relevant aspect.

4

u/MarkusBerkel Jun 16 '22

It’s fine, but it’s not really a dad-specific thing.