• 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

OK I am a little in over my head here trying to assist this guy as an intern. I am not even being paid for this right now, but it ended up being my only option as far as continuing my career goals this summer.

I was told I only needed knowledge of Javascript for this and I thought I knew enough.

Hahaha in actuality I know nothing.



This is what I currently need to do. I have Node, Express, Coffeescript all set up and have been following these guides.

http://expressjs.com/guide.html#routing
http://coenraets.org/blog/2012/10/creating-a-rest-api-using-node-js-express-and-mongodb/

Any ideas/tips/suggestions?

I have no idea if I am on the right track though. I'm in over my head, but I still believe I can do this.

What is your problem?
 
What is your problem?

Everything :'(

but really I know absolutely no backend stuff and thus know nothing about the stuff I am required to do. He understands that and knows that it will take me some time to get up to speed, but I just don't know where to begin with all this. All I know is OO programming and some javascript basically :/
 
Everything :'(

but really I know absolutely no backend stuff and thus know nothing about the stuff I am required to do. He understands that and knows that it will take me some time to get up to speed, but I just don't know where to begin with all this. All I know is OO programming and some javascript basically :/

I don't want to sound rude with this, do you understand what he is asking? When you read the Stage 1 requirements, do you understand all the terms, what he expects and how to test it?
 

usea

Member
Everything :'(

but really I know absolutely no backend stuff and thus know nothing about the stuff I am required to do. He understands that and knows that it will take me some time to get up to speed, but I just don't know where to begin with all this. All I know is OO programming and some javascript basically :/
You need to be more specific about what you do and don't know.

Do you know hat JSON is? Does {response: "hello world"} make sense to you? Do you know what a GET request is?
 
I don't want to sound rude with this, do you understand what he is asking? When you read the Stage 1 requirements, do you understand all the terms, what he expects and how to test it?

You need to be more specific about what you do and don't know.

Do you know hat JSON is? Does {response: "hello world"} make sense to you? Do you know what a GET request is?

Sorry for being vague with what I don't understand.

I created a server on localhost 3000 that gets Hello World in the browser. I'm believe that takes care of the first part, but I am not sure. Here is what I have.

server.js
Code:
var express = require('express');

var app = express();

app.get('/hello.txt', function(req, res){
 var body = 'Hello World';
 res.setHeader('Content-Type', 'text/plain');
 res.setHeader('Content-Length', body.length);
 res.end(body);
});

app.get('/hello.txt', function(req, res){
 res.send('Hello World');
});

package.json
Code:
{
        "name": "hello-world",
        "description": "internship practice app",
        "version": "0.0.1",
        "private": true,
        "dependencies": {
                "express": "3.2.4"
        }
}

I downloaded MongoDB, but I have not started doing anything with it. I need a driver for node.js I believe.
 
So what programmer blogs do you guys read apart from Coding Horror and Joel on Software?

I don't really follow any blogs. I subscribe to a few specific programming sub-reddits on reddit, and that's where I get all my news. The comments also always provide better insight than the posts themselves.
 
I don't really follow any blogs. I subscribe to a few specific programming sub-reddits on reddit, and that's where I get all my news. The comments also always provide better insight than the posts themselves.

Yep. /r/Programming is still a pretty decent "large" subreddit + some of the more language specific ones.
 

Kinitari

Black Canada Mafia
Bout to make my first real web-app. And I'm going to try and use the Google Drive API.

This is going to be a roller coaster, filled with tears and anguish. What I want to do PROBABLY won't work, and I'll have to use a proper DB, but I wanna give it a shot - it'll be a learning experience.

Right?

Right????
 

usea

Member
node server.js?

did it. Still don't know what to look for to know if it has a JSON response on and GET request.
GET is a type of http request. It's what your browser does when it visits a URL. It sends a GET request to the server.

JSON is a standard for representing data as text. It looks basically just like javascript objects. Here's an example:
Code:
{
  "name": "Ralph",
  "age": 31,
  "children": [
    {
      "name": "Judy",
      "age": 9
    },
    {
      "name": "Ethan",
      "age": 5
    }
  ],
  "sex": "Male"
}
Quick explanation:
The stuff inside curly braces {} is an object.
The stuff inside square brackets [] is an array.
White space doesn't matter at all (new lines and spaces). They're just to make it easier to read.
Objects have key-value pairs in the form of key: value
Strings are enclosed in double quotes, numbers aren't.
Things in objects are separated by commas.

Your assignment says that your server code should return some json on a GET request. This is different from returning a text document, or from returning a web page.
 

Zozobra

Member
Hi everyone,

I've been doing the Python course through Codeacademy, but I'm finding that I'm not really getting what I hoped out of it.

I think I'm going to dive into 'Learn Python the Hard Way' which seems like a popular suggestion, but I was wondering if anyone has had any experience with the video course he offers? I'd definitely prefer accompanying video tutorials and have no problem buying them if they're good.

Thanks!
 
GET is a type of http request. It's what your browser does when it visits a URL. It sends a GET request to the server.

JSON is a standard for representing data as text. It looks basically just like javascript objects. Here's an example:
Code:
{
  "name": "Ralph",
  "age": 31,
  "children": [
    {
      "name": "Judy",
      "age": 9
    },
    {
      "name": "Ethan",
      "age": 5
    }
  ],
  "sex": "Male"
}
Quick explanation:
The stuff inside curly braces {} is an object.
The stuff inside square brackets [] is an array.
White space doesn't matter at all (new lines and spaces). They're just to make it easier to read.
Objects have key-value pairs in the form of key: value
Strings are enclosed in double quotes, numbers aren't.
Things in objects are separated by commas.

Your assignment says that your server code should return some json on a GET request. This is different from returning a text document, or from returning a web page.

Wow you are an immense help through these awkward beginnings.

Ok so I have the Hello World GET request.

How would I edit my json file and then return it?
 

Ixian

Member
For web development he can just use Chrome default network inspector.
Definitely a better suggestion. :) I'm mostly familiar with Wireshark due to my line of work so I didn't really think about a more specific tool.
Wow you are an immense help through these awkward beginnings.

Ok so I have the Hello World GET request.

How would I edit my json file and then return it?
Your questions really seem like the type you are supposed to learn to answer yourself with this assignment.
 
Definitely a better suggestion. :) I'm mostly familiar with Wireshark due to my line of work so I didn't really think about a more specific tool.

Your questions really seem like the type you are supposed to learn to answer yourself with this assignment.

I'm aware. I just have no idea where to start. The vocab alone is new and confusing.
In cases like this I learn best when the "answers" are available. I build off of them and can then make connections.

I am reading this currently and it helps.
http://www.nodebeginner.org/
 
So what programmer blogs do you guys read apart from Coding Horror and Joel on Software?
I ended up getting Joel on Software (the book) around Christmas, 'twas alright.

Aside from those you said, I also read The Old New Thing, I listen to Hanselminutes, follow Hacker News, look through GitHub every now and then, and sometimes look through programming threads on
/g/
, along with other places.

Used to follow Ars Technica, Engadget, and Gizmodo heavily, but have lessened recently. I do still listen to The Verge podcast, though, but that's veering towards general tech news, really.
 

usea

Member
Wow you are an immense help through these awkward beginnings.

Ok so I have the Hello World GET request.

How would I edit my json file and then return it?
Usually you make an object and return it, not a file. Like, you could literally just return {response: "Hello World"}, from the code. I've never used express or even node, but given that it's javascript it'll be natural to do.
 

wolfmat

Confirmed Asshole
Please appreciate that the JSON format represents objects. In production scenarios, you should really not do the abstraction yourself because it's related to a standard you don't want to implement on your own.

Meaning that in the context of uni assignments and the like, you should be okay with treating JSON responses as dictionaries, basically (which is what usea is suggesting). But as soon as you communicate with an endpoint that returns JSON, or deliver JSON upon arbitrary requests, you should seriously consider using a library that does the abstraction for you.

Such a library has a facility that takes an object and returns the JSON representation and vice versa. It's easy to find and use these libraries.

{response: "Hello World"} is not valid JSON. JSON always has key-value pairs. response is not guaranteed to be a key, but "response" is. Just in case that trips you up :)
 

usea

Member
Please appreciate that the JSON format represents objects. In production scenarios, you should really not do the abstraction yourself because it's related to a standard you don't want to implement on your own.

Meaning that in the context of uni assignments and the like, you should be okay with treating JSON responses as dictionaries, basically (which is what usea is suggesting). But as soon as you communicate with an endpoint that returns JSON, or deliver JSON upon arbitrary requests, you should seriously consider using a library that does the abstraction for you.

Such a library has a facility that takes an object and returns the JSON representation and vice versa. It's easy to find and use these libraries.

{response: "Hello World"} is not valid JSON. JSON always has key-value pairs. response is not guaranteed to be a key, but "response" is. Just in case that trips you up :)
I actually don't know much javascript. I just assumed in js literal objects you didn't quote the keys, and that since his server was nodejs, he wouldn't have to either (and the conversion to json would be handled by node). I should have looked it up :)

Thanks for the corrections.
 

wolfmat

Confirmed Asshole
I actually don't know much javascript. I just assumed in js literal objects you didn't quote the keys, and that since his server was nodejs, he wouldn't have to either (and the conversion to json would be handled by node). I should have looked it up :)

In JS, keys can be a lot of stuff, but JSON is not restricted to JS (although that's where it originates, hence the name, and it of course applies here because of nodejs doing the backend stuff). The standard requires strings to be quoted in JSON in any case.

I was really only pointing that out because I myself made the mistake of not adhering to the JSON standard once when eating responses, which broke things in production. That's why Murphy's Law exists, right? :p
 
Please appreciate that the JSON format represents objects. In production scenarios, you should really not do the abstraction yourself because it's related to a standard you don't want to implement on your own.

Meaning that in the context of uni assignments and the like, you should be okay with treating JSON responses as dictionaries, basically (which is what usea is suggesting). But as soon as you communicate with an endpoint that returns JSON, or deliver JSON upon arbitrary requests, you should seriously consider using a library that does the abstraction for you.

Such a library has a facility that takes an object and returns the JSON representation and vice versa. It's easy to find and use these libraries.

{response: "Hello World"} is not valid JSON. JSON always has key-value pairs. response is not guaranteed to be a key, but "response" is. Just in case that trips you up :)

Thanks for the clarification. That was tripping me up since every other keyword I had seen was in quotes. Thanks a ton.
 

pompidu

Member
Since I'm doing a CIS degree, what languages should I be focuisng on? I'm really digging Java and getting more into it. Gonna concentrate on using Oracle and mySql during this summer break too. Anything else I should be focusing on??
 
Since I'm doing a CIS degree, what languages should I be focuisng on? I'm really digging Java and getting more into it. Gonna concentrate on using Oracle and mySql during this summer break too. Anything else I should be focusing on??

2 ways to think about this

1) What is in demand in your preferred job, market, etc? All things held equal, be solid in those languages and tools. (Java is fairly popular almost everywhere you look, so it's not a bad option, but peek down to point 2.)

2) Expose yourself to a wide variety of languages and paradigms. You have your entire career to find yourself boxed in. Don't do it now. Now is the time for you to explore. Particularly since you are CIS (I know what that's like), if programming is something you want to do rather than reports and management and things, then certainly branch out and figure out what the CS guys are doing, what they know that you don't. And then try to bridge some of those gaps.
 

pompidu

Member
2 ways to think about this

1) What is in demand in your preferred job, market, etc? All things held equal, be solid in those languages and tools. (Java is fairly popular almost everywhere you look, so it's not a bad option, but peek down to point 2.)

2) Expose yourself to a wide variety of languages and paradigms. You have your entire career to find yourself boxed in. Don't do it now. Now is the time for you to explore. Particularly since you are CIS (I know what that's like), if programming is something you want to do rather than reports and management and things, then certainly branch out and figure out what the CS guys are doing, what they know that you don't. And then try to bridge some of those gaps.
i enjoy all aspects of programming and IT shit. Some im kind looking into everything. I signed up for a few classes on coursea too just because.
 

flowsnake

Member
I just finished the Coursera Scala/Functional Programming course. I can recommend it. The assignments were more of the "fill in the blanks" sort than actually designing programs from a high level, so I didn't find them too challenging. The most difficult part is to stop thinking in imperative ways.
 

Chris R

Member
When updating a resume have people here found it helpful to list EVERY single language they know (either fully or partially)?
 

soco

Member
When updating a resume have people here found it helpful to list EVERY single language they know (either fully or partially)?

Probably depends on how many you know. I think there's a tipping point where some people start to suspect that you don't all of them that well, whereas if you just list a few they might be more likely to assume you're an expert in one or two of them.

I've started dropping some off the list just because I really have no desire to work jobs that make use of them anymore (eg. Java and Perl).
 
When updating a resume have people here found it helpful to list EVERY single language they know (either fully or partially)?

It impresses HR and recruiter types that desire to see technology vomit.

From an actual interviewer standpoint, if you list it, you better actually know it. If it's something you've had "exposure to" (you're familiar but not well versed), then make that obvious. If I see something on your resume, I might ask you about it. If you can't answer, your stock has just dropped. Maybe you can recover, maybe you can't, but don't invite me to ask questions you can't answer.
 
When updating a resume have people here found it helpful to list EVERY single language they know (either fully or partially)?

You could qualify the languages; for example:

Proficient: C++, C
Prior Experience: Java, Python

However, I would recommend only listing languages where you have implemented at least several medium-sized programs. If all you know about Python is that it doesn't have curly braces and semicolons, then I wouldn't list it.
 

Chris R

Member
You could qualify the languages; for example:

Proficient: C++, C
Prior Experience: Java, Python

However, I would recommend only listing languages where you have implemented at least several medium-sized programs. If all you know about Python is that it doesn't have curly braces and semicolons, then I wouldn't list it.

I think this is what I'll end up doing. Thanks for the input everyone.
 

GG-Duo

Member
Ugh.

I hate GitHub's algorithm for making populating the "Your Contributions" grid. It doesn't take private repositories into account, and it doesn't take NEW repositories and first commits into account.

I want my streak back dang it :(
 
So what programmer blogs do you guys read apart from Coding Horror and Joel on Software?

I like those:
http://programmingpraxis.com/ A blog that posts programming exercises, most of them algorithmic or math-y. Still pretty nice, the author always provides a sample solution as well.
http://lambda-the-ultimate.org/ If you're interested in programming language theory and new languages, this one is good.
http://thedailywtf.com/ This one is pretty famous I think, basically failblog for programming. Some pretty entertaining stuff on here.
http://www.realtimerendering.com/blog/ Blog from the auther of the excellent book "Real Time Rendering". The site also has an excellent section on computer graphics books, a lot of them are available for free.
 

usea

Member
Ugh.

I hate GitHub's algorithm for making populating the "Your Contributions" grid. It doesn't take private repositories into account, and it doesn't take NEW repositories and first commits into account.

I want my streak back dang it :(
Mine is super sparse. But it says I've 'contributed' to some popular repositories simply because I opened issues heh
 

Leezard

Member
I like those:
http://programmingpraxis.com/ A blog that posts programming exercises, most of them algorithmic or math-y. Still pretty nice, the author always provides a sample solution as well.
http://lambda-the-ultimate.org/ If you're interested in programming language theory and new languages, this one is good.
http://thedailywtf.com/ This one is pretty famous I think, basically failblog for programming. Some pretty entertaining stuff on here.
http://www.realtimerendering.com/blog/ Blog from the auther of the excellent book "Real Time Rendering". The site also has an excellent section on computer graphics books, a lot of them are available for free.

Programmingpraxis appears to be very much like http://projecteuler.net/ , although it seems a bit more accessible.
 

_Isaac

Member
Ugh.

I hate GitHub's algorithm for making populating the "Your Contributions" grid. It doesn't take private repositories into account, and it doesn't take NEW repositories and first commits into account.

I want my streak back dang it :(

Mine once took like two months to actually show anything. It wasn't reading my activity for some reason.
 
Top Bottom