• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Programming |OT| C is better than C++! No, C++ is better than C

So in my experience with programming I haven't had the fun of making a program that communicates with itself across multiple systems (see: chat program on two separate computers). I'm wanting to write something that will have, amongst other things, chat functionality while people wait for other things to happen. So I come looking for advice on how to start approaching this.

Is the basic premise having one client program on people's machines while there is a host program they can talk to? Can you have clients just talk to each other and update the other's information accordingly?

Protocol is a good beginning.What is a text message,commando,etc.
Then its just socket programming if im not mistaken.

My experience with Sockets and protocols was programming a android app that could control a vehicle over wifi.
 

luoapp

Member
Is the basic premise having one client program on people's machines while there is a host program they can talk to? Can you have clients just talk to each other and update the other's information accordingly?

Yes, as long as you know where the other guy is. So, you either have a known static IP or a server pointing to it. Once the connection is established, the communication can be just between two clients.
 

Tantalus

Neo Member
Do any of you guys have experience with Python/Django? I started looking into it a few days ago for a web project I'm working on, but don't understand the user authorization/authentication/profile systems at all.

Here are a list of features I would like the site to have:

  1. Log in via email address and password
  2. Store profile information about each user
  3. Allow certain users to access the Django admin panel
  4. Still be able to use the django permissions system

I get the feeling that it's just a matter of me not looking in the right place for the answer, but it's getting really frustrating :(

This is something I could make in PHP/Yii in about fifteen minutes, with my own database schema and no prebuilt modules that are difficult to modify correctly. Then again, I much prefer the syntax of Python overall and would really like to get a grasp on Django, so I'm trying to persevere
 
Got a technical interview for a Java/C#/SQL developer position in a few days. It's my first one ever so does anyone know have any recommendations on how to prepare? It's a phone interview, so I guess no coding for now.
 

Tomat

Wanna hear a good joke? Waste your time helping me! LOL!
Yep, if you are so mediocre that your job can be done by highschoolers you deserve to be replaced. I swear there are so many shitty programmers out there.
What really sucks, for me, is knowing that I am one of them, and that in my current state I can't imagine anyone would want to hire me out of school. I mean, I do well on my school programming projects, and I have learned a lot so far, but probably 99% of that stuff isn't going to matter in the real world.
 
What really sucks, for me, is knowing that I am one of them, and that in my current state I can't imagine anyone would want to hire me out of school. I mean, I do well on my school programming projects, and I have learned a lot so far, but probably 99% of that stuff isn't going to matter in the real world.

Same here. I was told to code code code and to try and go to 'hackathons'
 

Kalnos

Banned
What really sucks, for me, is knowing that I am one of them, and that in my current state I can't imagine anyone would want to hire me out of school. I mean, I do well on my school programming projects, and I have learned a lot so far, but probably 99% of that stuff isn't going to matter in the real world.

If you can do your assignments at school you're honestly likely better than most. There are a ton of graduates who can't do that 'fizzbuzz' program that people like to test (i.e. a for loop, basically).
 
What really sucks, for me, is knowing that I am one of them, and that in my current state I can't imagine anyone would want to hire me out of school. I mean, I do well on my school programming projects, and I have learned a lot so far, but probably 99% of that stuff isn't going to matter in the real world.

Most people don't care if you are bad at coding right now, you just have to prove them you are willing to be better (and do it).

Same here. I was told to code code code and to try and go to 'hackathons'

This, there are few other fields where the barrier of entry is so low. There's no reason to not get better.
 
What really sucks, for me, is knowing that I am one of them, and that in my current state I can't imagine anyone would want to hire me out of school. I mean, I do well on my school programming projects, and I have learned a lot so far, but probably 99% of that stuff isn't going to matter in the real world.

Can you write code to reverse a string without utilizing some library function? If yes, you're better than most. Having been part of the hiring process, I will say most graduates are astoundingly dumb and some seasoned programmers as well.
 
Can you write code to reverse a string without utilizing some library function? If yes, you're better than most. Having been part of the hiring process, I will say most graduates are astoundingly dumb and some seasoned programmers as well.

Are we talking about CS graduates from US universities? Seriously? How did these people pass their classes in the first place? I kinda doubt this is true..
 

Chris R

Member
Can you write code to reverse a string without utilizing some library function? If yes, you're better than most. Having been part of the hiring process, I will say most graduates are astoundingly dumb and some seasoned programmers as well.

I hope you aren't considering a programmer who would leverage a language function dumb... That is what they are there for after all :p

and I was considering going to a local Hackathon this month, but it just had to be on 4/20, so I'll be otherwise occupied.
 
Are we talking about CS graduates from US universities? Seriously? How did these people pass their classes in the first place? I kinda doubt this is true..

Many fail the FizzBuzz test which is even simpler than reversing a string.

I hope you aren't considering a programmer who would leverage a language function dumb... That is what they are there for after all :p

and I was considering going to a local Hackathon this month, but it just had to be on 4/20, so I'll be otherwise occupied.

I'm not saying their dumb if they use a library function to reverse a string. I'm saying they are dumb if they can't write the implementation if needed.
 
I hope you aren't considering a programmer who would leverage a language function dumb... That is what they are there for after all :p

and I was considering going to a local Hackathon this month, but it just had to be on 4/20, so I'll be otherwise occupied.

I'm glad hackNY is this weekend then.


Many fail the FizzBuzz test which is even simpler than reversing a string.

multiples of 3, 5 and 15? how is that an issue at all?

mod 3 print fizz
mod 5 print buzz
mod 15 print fizzbuzz.
 
And about that Code.org video... I find a little bit of hypocrisy from the companies appearing on it. They mention in the video that you don't have to be a genius or spend all day coding, but THOSE companies (like Facebook) (most likely) only hire people that get the top places in competitions like Codejam, ACM ICPC, etc.. who have obviously spent hundreds of hours coding.
 

Kalnos

Banned
Are we talking about CS graduates from US universities? Seriously? How did these people pass their classes in the first place? I kinda doubt this is true..

Java.

Seriously though, it would depend on what I was hiring them to do I think. If you're using C then it seems logical for them to understand about character arrays, null terminated strings, etc. If I'm hiring them as a Java developer I would just be happy they knew what the API was capable of and using a library function would be a more acceptable solution.

multiples of 3, 5 and 15? how is that an issue at all?

People are bad at problem solving, don't know what modulus is, can't write a for loop, etc etc.
 

heytred

Neo Member
I'm taking my dive into Python today. Guess you can see me around a lot lately asking stupid questions. Just a warning!
 
Seriously though, it would depend on what I was hiring them to do I think. If you're using C then it seems logical for them to understand about character arrays, null terminated strings, etc. If I'm hiring them as a Java developer I would just be happy they knew what the API was capable of and using a library function would be a more acceptable solution.

Well, the test is mainly about problem solving ability. Yea, if there's a need to reverse a string in a real application, you would use a library function. However, it's a nice test that's not domain specific like the FizzBuzz test.

I don't really care if you know all the finer details of an API if you couldn't put it to use.
 
Java.

Seriously though, it would depend on what I was hiring them to do I think. If you're using C then it seems logical for them to understand about character arrays, null terminated strings, etc. If I'm hiring them as a Java developer I would just be happy they knew what the API was capable of and using a library function would be a more acceptable solution.

Huh. A course on C and systems programming is required to graduate and takes place after the intro classes in python. And then the Operating Systems class everything is done in C as well.

Do people go through their entire college years doing just java?

People are bad at problem solving, don't know what modulus is, can't write a for loop, etc etc.

The fact that they don't know what modulus is is kind of frightening. It was drilled into my head in my intro classes and in the discrete class.
 

Chris R

Member
I'm not saying their dumb if they use a library function to reverse a string. I'm saying they are dumb if they can't write the implementation if needed.

Ah ok, because I was going to say you are on a dangerous path to the darkside where if you aren't writing your stuff in binary or assembly you are a terrible person. I like C# because it does a bunch of the heavy lifting for me, but if I needed to, I could make most of the stuff work for me on my own in a little bit of time. Might need a few google searches here or there or to break out an old textbook though :p
 

Kalnos

Banned
Do people go through their entire college years doing just java?

Some people go their entire college years piggy-backing off of others work, and with the demand for more graduates from CS I imagine it's getting easier and easier to sneak through.

My school also used C for Operating Systems as well as Embedded Systems (along with some assembly).
 

heytred

Neo Member
So... quick question.

I'm separating from the Army in ~6 months and I'm using my GI Bill to go back to school and pursue a degree in CS. My goal is to use the time between now and Spring 2014 semester to learn some programming on my own. Question is, am I better off (regarding getting into the "industry") focusing on programming efficiency, or would the degree really set me ahead? I imagine I could use the time/effort I'd have to put into core classes focusing on programming specific skills if at the end of the day having a degree is "optional".
 

Madtown_

Member
Do people go through their entire college years doing just java?



The fact that they don't know what modulus is is kind of frightening. It was drilled into my head in my intro classes and in the discrete class.

I don't think he was being serious. At my university Java was just the intro class; though many professors argue it should be in python.

I've been out of school for 3 months and haven't used mod once. Maybe it's one of those things you need to know, until you get your job. Or maybe not in my field.
 
Some people go their entire college years piggy-backing off of others work, and with the demand for more graduates from CS I imagine it's getting easier and easier to sneak through.

My school also used C for Operating Systems as well as Embedded Systems (along with some assembly).

I actually kinda appreciate that my school started the intro CS courses with C. Classes like Data Structures wouldn't probably be as fun with Java.
 
If you do it this way, you have to test for 15 first. Otherwise a multiple of 15 will trigger the 3 instead. Just saying.

Oh I know. Simple 'pseudo' pseudocode.

Code:
#include <stdio.h>

int main(void)
{
    int i;
    for(i = 1; i <= 100; i++)
    {
        if(i % 15 == 0)
            printf("FizzBuzz\n");
        if(i % 3 == 0)
            printf("Fizz\n");
        if(i % 5 == 0)
            printf("Buzz\n");
        else
            printf("%d\n", i);
    }
}

Took as long as it took me to type.


I don't think he was being serious. At my university Java was just the intro class; though many professors argue it should be in python.

I've been out of school for 3 months and haven't used mod once. Maybe it's one of those things you need to know, until you get your job. Or maybe not in my field.

They moved from C++ to Python in the school I transferred to.

I actually kinda appreciate that my school started the intro CS courses with C. Classes like Data Structures wouldn't probably be as fun with Java.

I started with C++ and I found it incredibly beneficial.
 
Oh I know. Simple 'pseudo' pseudocode.

Code:
#include <stdio.h>

int main(void)
{
    int i;
    for(i = 1; i <= 100; i++)
    {
        if(i % 15 == 0)
            printf("FizzBuzz\n");
        if(i % 3 == 0)
            printf("Fizz\n");
        if(i % 5 == 0)
            printf("Buzz\n");
        else
            printf("%d\n", i);
    }
}

a couple of else's are missing there, aren't they? Otherwise a number like 15 would get the first three cases
 
The last time we were interviewing and brought people in, I did a wholly original variant on Fizz Buzz. I swapped the 3 for a 7, and naturally 15 for 35. And instead of Fizz Buzz, they were to write two other words. Original.

People couldn't get it.

We also tend to work a lot with data. If you're working in enterprises on line of business applications, just expect that you'll do the same. So we, of course, need people well versed in databases. Not expecting you to be a DBA or anything, but if you've been through a DB course in college and have had the requisite 5+ years experience, we'd sort of expect you to know about database normalization and relationships and the like. So we're like... go to the whiteboard and show us a many-to-many relationship. Forget the table names, they don't matter. Forget the fields, they don't matter either. Just draw it.

Nobody gets that, either.
 
ARM assembly is genuinely fun, especially on a reasonably constrained device (GBA, anyone?)

I dabbled in a bit of 6502 and had a lot of fun using a certain 6502 simulator.

I want to do the same with ARM, but everything I've read about ARM ASM said learning it is useless because 1) there are so many opcodes and commands, and 2) a C compiler will optimize better than a human ever can.

So that really turned me off a lot...

If you can do your assignments at school you're honestly likely better than most. There are a ton of graduates who can't do that 'fizzbuzz' program that people like to test (i.e. a for loop, basically).

I just read up on FizzBuzz. People really can't do that? lol.

Though it did take me 6 or 7 years to discover the potential of modulo, so I probably wouldn't have been able to do it before 2007, either... I wasn't serious about programming until around that point, though.

Edit: I should learn to write posts on my phone faster. :(
 

sans_pants

avec_pénis
ive done most of the codeacademy program on html and css, a bit of javascript


my roommate/boss wants me to jump into python since hes already been using it and can guide me along. is codeacademy going to be sufficient?
 

Tomat

Wanna hear a good joke? Waste your time helping me! LOL!
I just wrote a FizzBuzz program. I hope Microsoft will hire me after I put the source code on my resume!
 
ive done most of the codeacademy program on html and css, a bit of javascript


my roommate/boss wants me to jump into python since hes already been using it and can guide me along. is codeacademy going to be sufficient?

I'd say take the CS 101 course on Udacity. They teach you Python and some core concepts in CS.
 

Tamanon

Banned
As someone who's currently doing the Udacity Python course, it's outstanding. The lectures are good and seem to be focused on real-world applications. I've got a normal Python class this Summer at college, which will probably focus more on the concepts and philosophies, but the Udacity course has been excellent for jumping in.
 
I want to do the same with ARM, but everything I've read about ARM ASM said learning it is useless because 1) there are so many opcodes and commands, and 2) a C compiler will optimize better than a human ever can.

So that really turned me off a lot...

Hell&#1086;, I am a compiler.

I just scanned thousands of lines of code while you were reading this sentence. I browsed through millions of possibilities of optimizing a single line of yours using hundreds of different optimization techniques based on a vast amount of academic research that you would spend years getting at. I won't feel any embarrassment, not even a slight ick, when I convert a three-line loop to thousands of instructions just to make it faster. I have no shame to go to great lengths of optimization or to do the dirtiest tricks. And if you don't want me to, maybe for a day or two, I'll behave and do it the way you like. I can transform the methods I'm using whenever you want, without even changing a single line of your code. I can even show you how your code would look in assembly, on different processor architectures and different operating systems and in different assembly conventions if you'd like. Yes, all in seconds. Because, you know, I can; and you know, you can't.

P.S. Oh, by the way you weren't using half of the code you wrote. I did you a favor and threw it away.

:p
 
I'm glad hackNY is this weekend then.




multiples of 3, 5 and 15? how is that an issue at all?

mod 3 print fizz
mod 5 print buzz
mod 15 print fizzbuzz.

add a bool flag to it if you buzzed and check for if(n%3 == 0 && n%5 =0) first if so set flag skip the other if flag is set.

Edit: Ooh god inbe4 im wrong its 3:00 am right now.
 
Oh I know. Simple 'pseudo' pseudocode.

...

Took as long as it took me to type.

My favorite solution to the FizzBuzz program goes like this (copied/pasted from elsewhere):

Code:
  #include <stdio.h>
  const char* fmt_str[15] = {"FizzBuzz\n", "%d\n", "%d\n",  "Fizz\n", 
                           "%d\n", "Buzz\n", "Fizz\n" "%d\n", "%d\n", 
                           "Fizz\n", "Buzz\n", "%d\n", "Fizz\n",
                           "%d\n", "%d\n"};
  int main(int argc, char* argv[]) {
    for(int i=1;i<=100;i++)
      printf(fmt_str[i%15], i);
    return 0;
  }



Ugh, that's a little bit depressing. haha
 
And about that Code.org video... I find a little bit of hypocrisy from the companies appearing on it. They mention in the video that you don't have to be a genius or spend all day coding, but THOSE companies (like Facebook) (most likely) only hire people that get the top places in competitions like Codejam, ACM ICPC, etc.. who have obviously spent hundreds of hours coding.

You don't have to be a genius. If I got through Engineering school, anyone can do it. What most people lack is the desire to persevere when things get tough. I don't see why you think they are hypocritical by hiring the best people. Many people get good at something because they constantly work on improving, practice, practice, practice.

You too could get hired at the top companies! You just have to be really good at what they are looking in an interview. It all boils down to some pretty fundamental topics, know your data structures and algorithms by heart, and know a programming language well. With those two things you can get offers from all big tech companies.
 

pompidu

Member
Heading into my junior year of college in a Computer Information Systems degree, anyone have any experience with what languages are most useful in this particular field? It's hard to find internships, they all want CS programming students and CIS just seems like a gray area. Anything I should concentrate on (besides sql)? Java? c++?
 
Heading into my junior year of college in a Computer Information Systems degree, anyone have any experience with what languages are most useful in this particular field? It's hard to find internships, they all want CS programming students and CIS just seems like a gray area. Anything I should concentrate on (besides sql)? Java? c++?

Java followed by C#. You can't really go wrong if you're strong in either, provided you're either where the jobs are or willing to go there. As far as your internship search, the fact that they're less open to CIS than CS is unfortunate, but you can find your way in with some persistence.
 
Heading into my junior year of college in a Computer Information Systems degree, anyone have any experience with what languages are most useful in this particular field? It's hard to find internships, they all want CS programming students and CIS just seems like a gray area. Anything I should concentrate on (besides sql)? Java? c++?

Not 100% sure of the degree, but I'd be concentrating on SQL server and C#/.net. Then hook up with a company doing MES/MIS work especially with minerals and start raking in the cash.
 

pompidu

Member
Java followed by C#. You can't really go wrong if you're strong in either, provided you're either where the jobs are or willing to go there. The fact that they're less open to CIS and CS is unfortunate, but you can find your way in with some persistence.

In the middle of second level of java so I'm going to continue beyond that on my own. I don't think our school does c#. Any good references you can point out to me to learn c#?

^ Minerals?
 
In the middle of second level of java so I'm going to continue beyond that on my own. I don't think our school does c#. Any good references you can point out to me to learn c#?

Yeah. Java. :p

But really, I always tend to recommend (despite having never read) Head First C#. What can I say, I liked their style. I've read Head First Design Patterns and Head First Java. They're approachable.
 
In the middle of second level of java so I'm going to continue beyond that on my own. I don't think our school does c#. Any good references you can point out to me to learn c#?

Just keep learning Java until you give up on it. You know now C#.

;)

^ Minerals?

Coal, iron ore, gold that sort of stuff. If I'm thinking CIS is what I think it is with a lot of DB work and a bit of coding around that, you should be able to get in there and do well (depending on where you live of course)
 

Snowdrift

Member
FizzBuzz test seems really simple if you have any mathematics background whatsoever.

I used to think a lot of the branches of mathematics were a waste of time until I took my first programming course this year.

Code:
for number in range(1, 101, 1):
    
    if number%3 == 0 and number%5 == 0:
        print("FizzBuzz")
    elif number%3 == 0:
        print("Fizz")
    elif number%5 == 0:
        print("Buzz")
    else:
        print(number)
 

pompidu

Member
Yeah. Java. :p

But really, I always tend to recommend (despite having never read) Head First C#. What can I say, I liked their style. I've read Head First Design Patterns and Head First Java. They're approachable.

Defiantly will get those. My school is not a technology school, it's a business school. They have a small CS department and CIS wasn't actually offered up until a few years ago. They are more focused on business side of the school so it's really hard to get help for internships, getting more classes etc. My only other option was a top tech school that was 40k a year, no thanks lol.

Just keep learning Java until you give up on it. You know now C#.

;)



Coal, iron ore, gold that sort of stuff. If I'm thinking CIS is what I think it is with a lot of DB work and a bit of coding around that, you should be able to get in there and do well (depending on where you live of course)

I see. Gonna keep at those along with mySQL etc... and Oracle.
 
Top Bottom