Author Topic: print "Hello World!"  (Read 4533 times)

y'all are big fat NERDS
you're on a loving internet forum about a loving video game talking about people who loving code in like 6 different loving languages

of loving course we're nerds

although i feel it is necessary to mention that i am not fat




but that's okay there are plenty of languages like JavaScript that would be happy to convert everything to any variable type automatically without asking you.
you can use "auto" in c++ too

 I still don't get the point of using printf instead of the std::cout stream.
Both have positives and negatives but-

  • iostream is built from a class so it's inheritable
  • Less likely to cause errors
  • Typesafe: Doesn't need you to define the variable type because the compiler detects it automatically
  • cout improves readability of code
  • You don't have to memorize the % values for each variable type,
  • printf was designed for C and many programmers prefer cout for C++
  • Usually, speed isn't so important that you would want to use printf instead.
  • cout has useful member methods such as cout.setState

it's true that printf is usually faster, but how often does that actually matter...?

you can use "auto" in c++ too

Dune: yeah its probably bad practice to use auto
Jailbot - RIP HPRC: im pretty sure it is extremely poor practice to use the auto keyword


We concur that using auto is a horrible practice. Please promptly remove any instances of this from your code.

Code: [Select]
#include<iostream>
using namespace std;

int main() {
   cout << "Do I win yet?" << endl;
   return 0;
}

y'all are big fat NERDS

Code: [Select]
#include <iostream>

class Gardian{
public:
int awesomeness = 9999;
int buildingSkill = 5; //out of 10
int eventingSkill = 9; //out of 10
int blocklandScriptingSkill = 2; //out- you get it
int modelingSkill = 4;
int codingSkill = 5;

};

int Response(int knowledgeOnSubject, char user, int inputmessage){
Gardian Gardian;
char Response[]= CreateResponce(Gardian.awesomeness, Gardian.buildingSkill, Gardian.eventingSkill, Gardian.blocklandScriptingSkill, Gardian.modelingSkill, Gardian.codingSkill, knowledgeOnSubject, user, inputmessage);
}

int main(){
    char topic[100];
    char user[50];
    char inputmessage[300];
  
    cin >> topic;
    cin >> user;
    cin >> inputmessage;
    

    int knowledgeOnSubject = GetKOS(topic, user); //Knowledge on subject
    
    char Response[] = Response(knowledgeOnSubject, user, inputmessage);

    createForumPost(Response[]);
}
Code: [Select]
--Run--

<  print "Hello World!"
<  ßlöükfáce
<  y'all are big fat NERDS

...Thinking...

> forget you.

how funny was this?  */10
« Last Edit: February 28, 2014, 07:22:08 PM by Yin Yang »

although i feel it is necessary to mention that i am not fat
yes you are

print("am i doin it rite?")

MessageClient(%client,'',"am i doin it rite now?");
« Last Edit: February 28, 2014, 10:45:29 PM by Starzy »


Dune: yeah its probably bad practice to use auto
Jailbot - RIP HPRC: im pretty sure it is extremely poor practice to use the auto keyword


We concur that using auto is a horrible practice. Please promptly remove any instances of this from your code.

never used it but why is it bad practice?

how funny was this?  */10

lines longer than 80 columns/10

aka 0/10