r/AskProgramming • u/lalasprinkle • 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. :)
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
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
Jun 16 '22
Traditionally, there's a comma and an exclamation point. We love our grammar and are excited.
Hello, World!
3
10
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
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
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
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
4
Jun 16 '22
1
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
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
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
61
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
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
6
3
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
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
2
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
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
10
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
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.