• 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

Water

Member
Awesome sale. Any book recommendations for someone who only has experience with C++? I'd like to do some more interesting projects in my free time that are actually fun.

EDIT: This one looks cool, anyone have experience with it?

http://www.packtpub.com/unity-4-x-game-development-by-example/book#overview
Disclaimer: my opinions are based on quick flip-throughs. I have these books but haven't dug deep into them.

Quality looks decent to me, but it's so beginner-level that the first line of code gets written 100 pages into the book - I don't think it's going to be right for you. It also uses Unityscript instead of C#, which in my understanding is a bad idea. edit: although it discusses everything with Unityscript, the equivalent C# listings are at the end of every chapter. And though the book is very verbose, a decent amount of Unity stuff gets covered. So I'm changing my mind; this should actually be pretty decent for getting into Unity. Just stick to C#.

For someone with previous programming experience I think this would be a better introduction to Unity scripting. edit: No, actually this one is too simple for someone with some programming skill - but might be better for a beginning programmer than the above, since this uses C# and only C#, and doesn't have Unityscript to mix things up.

Definitely grab the Cookbook I suggested earlier.

I'm teaching a Unity programming course in Fall and need all the (good) ideas I can get - that's why I'm grabbing a lot of the beginner books.
 

Onemic

Member
Disclaimer: my opinions are based on quick flip-throughs. I have these books but haven't dug deep into them.

Quality looks decent to me, but it's so beginner-level that the first line of code gets written 100 pages into the book - I don't think it's going to be right for you. It also uses Unityscript instead of C#, which in my understanding is a bad idea.

For someone with previous programming experience I think this would be a better introduction to Unity scripting. And if you're getting into Unity, definitely grab the Cookbook I suggested earlier.

I'm teaching a Unity programming course in Fall and need all the (good) ideas I can get - that's why I'm grabbing a lot of the beginner books.

You need to know C# to use Unity right? Im a C++ student as well.
 

Water

Member
You need to know C# to use Unity right? Im a C++ student as well.
Unity gives you a choice of Unityscript or C#. I haven't used Unityscript but based on what I know there's no point whatsoever in using it over C# for real projects. Unity C# is real C#, though not the most recent version of the language, so C# knowledge and materials apply fully to it. Unityscript looks somewhat like Javascript but is actually nothing like Javascript. Rather, it's slower, more bug-prone C# in disguise.
 

Onemic

Member
Unity gives you a choice of Unityscript or C#. I haven't used Unityscript but based on what I know there's no point whatsoever in using it over C# for real projects. Unity C# is real C#, though not the most recent version of the language, so C# knowledge and materials apply fully to it. Unityscript looks somewhat like Javascript but is actually nothing like Javascript. Rather, it's slower, more bug-prone C# in disguise.

Does the book you suggested teach C# assuming you already know how to program, or teach it from the stance of thinking you're an absolute beginner? Reading the amazon review comments it seems to hold your hand maybe a little too much.
 

Roubjon

Member
Hey guys. I've managed to get a job that codes mainly in Java, but most of my experience comes from coding in C. Any suggestions as to how to get up to speed with Java within a relatively short amount of time?
 

Granadier

Is currently on Stage 1: Denial regarding the service game future
Hey guys. I've managed to get a job that codes mainly in Java, but most of my experience comes from coding in C. Any suggestions as to how to get up to speed with Java within a relatively short amount of time?

What are you going to be doing in Java? Database?
 

Roubjon

Member
What are you going to be doing in Java? Database?

I'm going to be working on an automated system for recognizing and understanding metaphors in cross-cultural communication. I'll be analyzing metaphors in naturally occurring text.

So yeah, lots of data structures and string manipulation.
 
Throwing everything into a GridBagLayout is the amateur way to go, in my experience. It's less maintainable, and more prone to unexpected behaviour. And like I said, if you can't do your UI with the simpler components that's probably a bad UI design smell.

I disagree. With a handful of utility methods GridBagLayout becomes a breeze to work with and you get pretty predictable behavior, and you get way more flexibility than you get with other layouts. There are a lot of tricks to make GridBagLayouts easier to deal with than they seem initially.

It really does come down to what you need to do though. The apps I work on have a LOT of data to display, of various sizes of formats in each category, and the only layout that's going to give you the flexibility you need is a GridBagLayout. It's certainly all about using the right tool for the right job though.
 

Granadier

Is currently on Stage 1: Denial regarding the service game future
I'm going to be working on an automated system for recognizing and understanding metaphors in cross-cultural communication. I'll be analyzing metaphors in naturally occurring text.

So yeah, lots of data structures and string manipulation.

Java doesn't allow memory control like C, but the data structures and string manipulation is pretty straightforward from what I understand.

Others in this thread will be able to give more accurate information than my ~1 year of Java experience can provide.

This might help too: http://www.seas.upenn.edu/~cis1xx/resources/JavaForCppProgrammers/j-javac-cpp-ltr.pdf
 

Roubjon

Member
You guys using Drools by any chance?

I've got no idea lol. I got hired as a Research Assistant at my University so they really haven't briefed me yet about what I'll be doing, other than describing the general project I'll be working on. I really want to get a head start learning Java though because I want to get the most out of this opportunity. I feel like it'll lead to some good things in the future if I work for it.
 

Water

Member
Does the book you suggested teach C# assuming you already know how to program, or teach it from the stance of thinking you're an absolute beginner? Reading the amazon review comments it seems to hold your hand maybe a little too much.
You are totally correct, sorry for the misleading recommendation. Even from the name of the book it's pretty obvious that it caters to absolute beginners, but at a glance I thought it would end up going much deeper than it actually does. My opinion on the first book is changed as well since I noticed it also has C# listings and C# -specific commentary tucked away at the end of chapters. While it has 100 pages of fluff at the front, also assumes the reader is a beginner and holds your hand, it goes much deeper than the second book (as could be expected from its 2x page count). I corrected my earlier post to reflect this.
 

Granadier

Is currently on Stage 1: Denial regarding the service game future
I am looking for some advice in regards to save/load functions within Java. So far I understand how to utilize them with primitives and text files, but I need to learn how to use them for objects and binary files. So far I've tried doing Object I/O with .dat files and serializing the data into a .ser file. Neither have been successful the way I've been writing it.

In my code I have two, single-dimension arrays of objects that I need to store to and load from a file. The objects in the arrays each contain 5 primitive data fields. When printed out they utilize a toString() method for formatting and such. These objects are stored in single-dimension arrays and there is a counter for each to keep track of how many are stored. (Would the object I/O work better if I switched over to ArrayLists instead?)

Currently I can call the save/load methods successfully. The file is created and there are no errors thrown. If I close the program, restart it, and call the loadData() method there are again no errors, but it seems like nothing is loaded. Calling the methods to display the stored information returns nothing.

Code wise, a menu selection is clicked and it calls the save or load method. Here are those methods. (Taken from my most recent attempt using serializing.)
Code:
public void saveData()  throws IOException {
        try {
            FileOutputStream fos = new FileOutputStream("student.ser");
            ObjectOutputStream oos = new ObjectOutputStream(fos);
            oos.writeObject(stuObjects);
            oos.writeObject(grdObjects);
            oos.close();
            fos.close();
        } catch (IOException i) {
            i.printStackTrace();
        }
}
Code:
public void loadData() throws IOException, ClassNotFoundException {
        try {
            FileInputStream fis = new FileInputStream("student.ser");
            ObjectInputStream ois = new ObjectInputStream(fis);
            stuObjects = (Student[]) ois.readObject();
            grdObjects = (GradStudent[]) ois.readObject();
            ois.close();
            fis.close();
        } catch (IOException i) {
            i.printStackTrace();
        } catch (ClassNotFoundException c) {
            c.printStackTrace();
        }
}

At this point I feel like I'm just making some silly, noobish mistake when it comes to this. So please enlighten me in how I should fix this, or how I should actually be going about it. Thank you!
 

Jafku

Member
Hello all. I'm a recent graduate with a degree in Economics, however I graduated with no relevant internships and no real marketable skills. To rectify this, I'm thinking of Learning Programming. I've read a little but i'm still beginning. I've started to learn some some python. I guess what i'm asking is can I become a programmer without going to school for another degree. Any advice would be welcome.
 
Hello all. I'm a recent graduate with a degree in Economics, however I graduated with no relevant internships and no real marketable skills. To rectify this, I'm thinking of Learning Programming. I've read a little but i'm still beginning. I've started to learn some some python. I guess what i'm asking is can I become a programmer without going to school for another degree. Any advice would be welcome.

Did you not have a career in mind when you chose economics for your major? Any aspirations for continuing your education in that field?
 

Jafku

Member
Did you not have a career in mind when you chose economics for your major? Any aspirations for continuing your education in that field?
Sorry for replying so late. I did have a career in mind, working as an analyst, however I didn't get any relevant internships. After going through getting a degree in economics, I have no interest in getting my masters. I see that programming is a skill that while taught in school, can be self-taught.
 

usea

Member
Sorry for replying so late. I did have a career in mind, working as an analyst, however I didn't get any relevant internships. After going through getting a degree in economics, I have no interest in getting my masters. I see that programming is a skill that while taught in school, can be self-taught.
It is quite realistic to get a job programming with an unrelated degree.

In fact it's common enough that an entire industry of "code bootcamps" have sprung up, in which they teach non-programmers how to code in X weeks, and promise something like a 90%+ rate of placement at the end of the course. They're quite popular, and the reputable ones seem to produce quality students. Of course, like anything else you'll get out of it only what you put in.

My point is that for people who are willing to put in the work, it is absolutely feasible to get a job programming without a CS degree.
 

NotBacon

Member
Sorry for replying so late. I did have a career in mind, working as an analyst, however I didn't get any relevant internships. After going through getting a degree in economics, I have no interest in getting my masters. I see that programming is a skill that while taught in school, can be self-taught.

The problem that I see a lot these days is that someone can take a few syntax tutorials in python or whatever, or build a static site in HTML/CSS and call themselves a programmer.

There's more to it than syntax. If you REALLY want to learn CS, nothing beats university. BUT, I have seen the exception(lol). Just be prepared for what CS actually is.

In addition to code, you'd need to learn:
-Algorithms/Complexity
-Design patterns
-Documentation
-Flow diagrams
-Version control
-Terminal magic
-Networking(optional but I think it's good to know)
-Assembly(optional but I think it's good to know)
-Probably more...

But don't let that stop you from digging in with simple stuff to get a feel for it.
 

usea

Member
Hello. BA in Modern Languages (Russian and French) here. Recent job titles include Senior Architect, Design Authority and Director of Engineering. :D
The lead developer at a local company has a music degree. Two months ago I talked to the head of development at a Houston company. In response to a similar question, he said the previous week he had hired a girl with a humanities degree, and passed over a guy with a CS degree. She had just learned to code at a bootcamp, and seemed like the better hire based on her skills and level of interest.
 

Jafku

Member
Thanks to everyone who has commented above. I've started a few excercises with learnpythonthehardway, and will continue with that. I will definitely research more and see what else I can do like sample projects. I have the time, just gotta put in the work.
 

oxrock

Gravity is a myth, the Earth SUCKS!
Thanks to everyone who has commented above. I've started a few excercises with learnpythonthehardway, and will continue with that. I will definitely research more and see what else I can do like sample projects. I have the time, just gotta put in the work.

If you're pretty new to programming and have decided on python, I just can't recommend udacity's cs 101 course enough. It walks you through the basics towards building something practical while reinforcing what you learn by having you write your own code and testing it.

https://www.udacity.com/course/cs101
 

tokkun

Member
Any insight on my save/load issues from post #8624?

Probably the first thing I would try is to initialize the variables you are reading into to null just to make sure that a new reference is actually being assigned to them.

Also I'd try looping over your array and reading/writing individual objects, rather than trying to write the array as a single object, just in case the issue has to do with the deep copy of the array.
 

Granadier

Is currently on Stage 1: Denial regarding the service game future
Probably the first thing I would try is to initialize the variables you are reading into to null just to make sure that a new reference is actually being assigned to them.

Also I'd try looping over your array and reading/writing individual objects, rather than trying to write the array as a single object, just in case the issue has to do with the deep copy of the array.

Ok, thanks. I will try this.
 
What does () when declaring a string mean? In VBA/ macro one variable is declared as:

Dim arTemp() As String

Why the parantheses after arrTemp? Is it turning a method into a string? Never seen that before.
 

Granadier

Is currently on Stage 1: Denial regarding the service game future
Computer just crashed while I was editing the class I had been working on all day in IntelliJ. After reboot that class is just 0's, and IntelliJ forgot how to use the JDK.

I need a brown paper bag to breath into.

truthfully, i need to backup my code more often with version control

edit: Had to re-install, but it's back to working properly and I remade my class. My load method is still not working, but I'll have to turn it in with it inop and learn how to fix it later.

edit2: Code fixed! It was a mistake with 4 lines of code. I hadn't implemented Serializable in the abstract Person class that Student + GradStudent inherited, and my loadData() method was creating local copies of the ArrayList's instead of filling the ones that existed. Thanks for the help tokkun!
 

Snowdrift

Member
I need a summer project. Was thinking of learning Haskell because I do not have any experience with a functional language. However I graduate next year and have been looking at some of the local jobs and everything is C#/.NET which I also have no experience in.

I feel fairly comfortable with Python and Java. C is the weakest of the three languages I know.
 

Granadier

Is currently on Stage 1: Denial regarding the service game future
Based on the jobs available, I would say take the summer to get comfortable with C#/.NET then.
 

poweld

Member
I need a summer project. Was thinking of learning Haskell because I do not have any experience with a functional language. However I graduate next year and have been looking at some of the local jobs and everything is C#/.NET which I also have no experience in.

I feel fairly comfortable with Python and Java. C is the weakest of the three languages I know.

if you're looking to dip your toes into FP and already know java, i'd recommend checking out Scala.

it runs on the JVM, you can use java code in it, and is a hybrid imperative/FP language. very easy to get going.

plus, the creator of the language, martin odersky, is running a course on coursera.com right now: https://www.coursera.org/course/progfun (not sure if it's still open for signup or not)
 

CrankyJay

Banned
I need a summer project. Was thinking of learning Haskell because I do not have any experience with a functional language. However I graduate next year and have been looking at some of the local jobs and everything is C#/.NET which I also have no experience in.

I feel fairly comfortable with Python and Java. C is the weakest of the three languages I know.

What is your programming background? If you have a fundamental background education in programming you should be able to pick up a new language fairly quickly.

C# is pretty damn close to Java.
 

usea

Member
I need a summer project. Was thinking of learning Haskell because I do not have any experience with a functional language. However I graduate next year and have been looking at some of the local jobs and everything is C#/.NET which I also have no experience in.

I feel fairly comfortable with Python and Java. C is the weakest of the three languages I know.
When I graduated I got a job doing C#, but I had never used it before. I had mostly used java in school. It was extremely easy to jump into, I was doing productive work on the first day.

You can do functional-ish programming in C# by the way. There's very limited support for immutability, but you do have functions as values, an OK type system, some support for lazy evaluation, and a lot of built in functions like map, filter, fold, bind, etc.

There's also F# which is a .NET functional programming language. It's basically OCaml. It's fairly popular and really solid.
 

NotBacon

Member
I need a summer project. Was thinking of learning Haskell because I do not have any experience with a functional language. However I graduate next year and have been looking at some of the local jobs and everything is C#/.NET which I also have no experience in.

I feel fairly comfortable with Python and Java. C is the weakest of the three languages I know.

C# is basically Java Microsoft Edition
 

BreakyBoy

o_O @_@ O_o
I need a summer project. Was thinking of learning Haskell because I do not have any experience with a functional language. However I graduate next year and have been looking at some of the local jobs and everything is C#/.NET which I also have no experience in.

I feel fairly comfortable with Python and Java. C is the weakest of the three languages I know.

Based on your job search, and as others have noted: if employment is your goal, then C#/.NET is probably the way to go.

If you want to learn something 'new', then yeah a functional language is a good bet. Scala is definitely a good choice if you're already familiar with Java. It'll bridge your prior experience really well, and I second the earlier recommendation to go through Odersky's Coursera course. I was in the first run of that a year+ ago, and it was a great way to get up and running.
 

Snowdrift

Member
Thanks for all the replies. I'll look into the Scala course. I'm interested in computational finance, but my university doesn't really offer any courses on the subject. My initial reasoning for wanting to learn functional programming is that it seems slightly better suited for finance than OOP.
 

CrankyJay

Banned
It's as similar as Java is from C++, they all take as base C language, so they resemble in some parts of their syntax.

C# doesn't give you really options to handle memory thought, for the best or the worst.

Isn't that due largely to the .NET Framework handling most garbage collection? The only memory management that needs to be done is for files, windows, database connections, etc.
 
Top Bottom