[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Why is Hello World considered a good "first program"

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 37
Thread images: 3

File: hallucination.jpg (22KB, 525x463px) Image search: [Google]
hallucination.jpg
22KB, 525x463px
Why is Hello World considered a good "first program" instead of FizzBuzz?

Hello World sets the standards way too low and does not tell nearly anything about the language itself; only tells the command to output a message to the terminal.
>>
>>61386065
>Why is Hello World considered a good "first program" instead of FizzBuzz?
Because it tests if the compiler was set up correctly. It's not about actually programming.
>>
>>61386065
I've never heard of fizzbuzz, honestly. Don't even know what it means.
>>
>>61386204
It's basically an extremely simple logic problem used by graduate/entry level interviews to rule out morons.

I doubt it's still used because capitalism piguu actually started making TUTORIALS for pajeets to learn specifically how to fizzbuzz.
>>
>>61386204
It is a training program for beginners to distinguish those who can actually solve problems. Basically you loop trough 0 to 100 and output either Fizz or Buzz on specific iterations. Probably the most common rules are:
>if current iteration is multiple of 3 print "Fizz"
>if current iteration is multiple of 5 print "Buzz"
>if both print "FizzBuzz"
>if none print the current iteration number
>>
>>61386065
Because it checks that the developer can debug with print statements.
>>
>>61386244
Only the specific string they are told though.
>>
>>61386229
All you need to do is change FizzBuzz to something verrrrrrrrrry slightly different. It will be equally effective.

I use: Count from 1-100, and say whether each is odd or even.
>>
>>61386252
That's enough for debugging.
>>
>>61386065
Because printing something to the screen is the most basic task that almost every program is going to do. It's something to learn and something to check that you're not an absolute retard, and something that you can use afterward to check everything you make to see if it is working properly.

FizzBuzz needs to print output to work. If you try to code that without learning how to output first then you won't know what the fuck is wrong when you bugger something up.
>>
Universal interface of program is standard input and output. Hello World mostly uses standard output.

FizzBuzz is usually simplified by "just print" the sequence on screen, while it can go slightly deeper with separating logic from side effect. You can create function that gives you result for arbitrary input; create array of results or iterator over result.
It might be good standard second program.
>>
Because Hello World tests that you can make a program that compiles, compile it, and run it. It's not meant to test knowledge of actual coding.
>>
>>61386111
This
>>
>>61386065
mostly tradition: the hello world script was used as an example in early C books and it stuck, because while writing it you can give a very good introduction to the basics in coding in any language

Let's just see how many concepts you get when writing your hello world to the console in any language:
>#include statements or equivalent
>(namespaces)
>main method
>method return value (types/void)
>how it interprets strings ("")
>learn what the console is if you don't know already
>putting a line to the console output - introduction to functions, the ; symbol (if not python or similar where ";" is not used)
>pausing the program
>actually returning a value in languages where the main method is not void
>ending the program and when it ends
>how to compile/run the program

A very good intro to any language and you can immediately go to more language specific topics like data types, loops, conditionals etc.

Also as >>61386680 said: there will be people whose first encounter with programming will be a hello world script. They probably don't possess algorithmic thinking yet.
>>
>>61386904
>there will be people whose first encounter with programming will be a hello world script. They probably don't possess algorithmic thinking yet.
No, what I meant is that even if you're an experienced programmer it helps to write a hello world program when learning a new language because it familiarises you with the process of compiling/running programs in this language.

In fact, if you're not learning some esolang or something like lisp, chances are the syntax for a fizzbuzz is going to be bog-standard in whatever new language you're learning, so for experienced programmers a fizzbuzz carries unnecessary complexity with no added value compared to a hello world.
>>
>>61386904
When you see stuff like this that teaches none of that. What does "puts" mean? Why is the 1 there? It tells nothing, just shows how to output a string of text. Doesn't introduce you to classes or namespaces.
>>
>>61386229
anyone that thinks fizzbuzz rules out morons is also a moron. seriously doing fizzbuzz proves that you can rote memorize a solution to widely known problem. basically it says the candidate has read about programming on the internet, or done some research on possible interview questions. it is another cancer on our industry.
>>
>>61387060
puts="put string"
the number denotes the device it will be outputted to. 0 is STDIN, 1 is STDOUT, and 2 is STDERR. Now I can explain to you what these are, but you probably know it. A newbie will not.
Also, Euphoria is an imperative language and not object oriented and doesn't have OOP elements, so your point is moot here.
>>
>>61386065
It's a meme you dip
>>
Do some languages not have the modulus operator? Can't you just use if x%3==0 and if x%5==0?
>>
>>61386232
Isnt this incredibly simple?
>>
>>61387366
Now imagine people apply for jobs and can't do this.

t. Enterprise SW dev
>>
>sets the standards way too low
Standard is just right for "first program". Less things involved = less things that could go wrong.

>does not tell nearly anything about the language itself
It's not intended to do that. First program is first program. The task is to make it work.

>only tells the command to output a message to the terminal
Which is enough for the user to receive visual output to confirm success.
>>
>>61387423
What the fuck. I can do this and I was a chemistry major who hasn't written a program since jr high.
>>
>>61387351
well, some 70s processor designs didn't have a modulus command, but still stored the remainder somewhere when their divide command is called (6800, 8080, Z80, 1604, etc.), but by the 80s, the 8086 and 8088, as well as the Motorola 6809 had a dedicated modulus command in them
Literally every modern language has a modulus operator but it's not always "%", sometimes it's "mod" or similar.
Those without modulus operator have a mod() function or similar for that purpose.
In Haskell and Clojure, there are two functions to get the remainder of an integer division, "mod" and "rem" and they differ in how they handle negative numbers:
anon=> (mod 1 5)
1
anon=> (rem 1 5)
1
anon=> (mod -1 5)
4
anon=> (rem -1 5)
-1
>>
>>61386755
dubs confirm my trips, so only quints can tell that's wrong
>>
>>61387443
I know, but I bet you've never met a pajeet with a masters degree applying for a job... I have

t. Enterprise SW dev
>>
what kind of questions do they ask in an interview for a programmer position? I'm stupid as fuck and even I can solve fizzbuzz. Is that truly enough to get a job in that field?
>>
>>61387256
well memeded frend
>>
>>61387755
You must act as a corporate dick sucking employee.

[spoiler]Sorry for the homophobia metaphor.[/spoiler]
>>
>>61387351
All I know do have it
But it would still be pretty easy without modulus
>>
>>61388396
I did it fist time before knowing modulus is even a thing (used whiles to count down and check if it matched zero or went over)
>>
File: IMG_20170714_214442.jpg (84KB, 512x512px) Image search: [Google]
IMG_20170714_214442.jpg
84KB, 512x512px
>>61387591
Well then allow me!
>>
>>61388895
off by two
good try, though
>>
>>61386111
FPBP
>>
>>61387142
Which is why the "sum the first two million primes on the whiteboard" meme is not a bad idea if you remove the whiteboard bit. A small variety of simple problems rather than a well-known test with countless online solutions.
>>
>>61387142
It doesn't rule out morons, it rules out people who are completely fucking incompetent and hopeless. Morons can at least be taught.

https://css-tricks.com/tales-of-a-non-unicorn-a-story-about-the-trouble-with-job-titles-and-descriptions/
Thread posts: 37
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.