Factorio

Factorio

檢視統計資料:
MadTraXx 2017 年 5 月 16 日 下午 5:23
C++ or java
So im trying to figure out if i should learn java or C++...
and i know this game was written in both,first java and then C++.....
so i kinda wanne know...why they switched from java to C++.
wich one is the best to learn?
< >
目前顯示第 1-15 則留言,共 19
Fireeye 2017 年 5 月 16 日 下午 5:59 
This is kind of a tricky question and as such most of the things i write are based on my own opinions and experiences.
One thing right of the bat, there's no such a thing as a "best" language and most concepts you learn in one language can be fully or partially transfered to another of the same class. (Object oriented, procedual, etc.)
To learn the very basic, i'd recommend an "easy" to learn language like Python. It is not object oriented like Java or C++ but will give you a good insight of the basics of programming if you got none.
If you want to start programming in a object oriented language, i'd recommend Java because you don't have to handle cross platform and other specifics. This however has of course its cost, namely performance which might become an issue if you want simulate a lot of objects.
And this drawback is most likely the main reason why the developers switched from Java to C++.
最後修改者:Fireeye; 2017 年 5 月 16 日 下午 6:00
Davor - Ironward 2017 年 5 月 16 日 下午 6:02 
If you are a masochistic person, dive right into C++. You'll be in hell for a while, but when you master it, people will start calling you "sir" :)
Fel 2017 年 5 月 16 日 下午 9:32 
C++ is closer to machine-level code, while java, c# and many others handle part of the annoying and error-prone things bellow your code, at the cost of potential optimisation.

Basically, if you have mastery over C++, you can do anything you want, and optimize it to an insane degree, but as soon as you drop under that level, you start tu run into issues with a lot of things, including but not limited to things like memory adresses, pointers and such.

It is so easy to mess things up in C++ if you didn't reach a high enough level in it that it makes a big place for the languages that are easier to use.

Not to mention that except some very specific cases, RAM is no longer that much of an issue, so memory optimization, while nice, doesn't bring as much to the table as when it was completely required because of hardware limitations.


If you never learned a programming language, I would argue that it is easier to start with a "scripting" language (like lua that is used for mods in this game for example), not only is it quite easy to pick up and do simple things, most of the logic behind it will transfer to compiled languages anyway.

Not to mention that you can always have a small file somewhere that will let you do all of your short calculations and weird things.
I personally picked up ruby years ago for work, and to this day I frequently use it for many small things, be it a repeat timer that bips at exact times, something to compute ratios, a fast way to rename files based on a pattern (like renaming all of the files of a series but still keeping the numbers at the place you want and in the format you want).
MadTraXx 2017 年 5 月 16 日 下午 9:54 
Thanks for the advice all.
i have some batch experiance,and i Already did some C++ and Java Programming,but i did not do all the tutorials yet.
i was planning on dropping one of the 2 languages,and continue with the other one.
最後修改者:MadTraXx; 2017 年 5 月 16 日 下午 9:58
DCYW 2017 年 5 月 16 日 下午 10:18 
引用自 Cripteron
So im trying to figure out if i should learn java or C++...
and i know this game was written in both,first java and then C++.....
so i kinda wanne know...why they switched from java to C++.
wich one is the best to learn?
same I had learnt both programming languages and I also learnt c#, looks like java much easier to program than c++ compared them two, then C# the most easiest to program when comparing all three
最後修改者:DCYW; 2017 年 5 月 16 日 下午 10:20
Fel 2017 年 5 月 16 日 下午 11:06 
The "problem" with C# is that it is a windows-only laguage (sure, linux systems can emulate it, but it's usually not that great), but it's definitely one of the easiest of the "core" programming languages to learn.
Nailfoot 2017 年 5 月 16 日 下午 11:55 
I once wrote a program that added 2+2.

The answer was wrong, though. Does that count?
Fel 2017 年 5 月 17 日 上午 12:14 
Depending on the language used, even basic operations can have strange results.

I know that in ruby for example, if you divide 3 by 2, the result will be 1, but if you do it with 2.0 instead you get 1.5 because of the auto-type that most scripting language have.
Chatastroph 2017 年 5 月 17 日 上午 1:22 
引用自 Fel
Depending on the language used, even basic operations can have strange results.

I know that in ruby for example, if you divide 3 by 2, the result will be 1, but if you do it with 2.0 instead you get 1.5 because of the auto-type that most scripting language have.
Thes autotypes use a lot of Languages, not only scripting languages. Probably even every language does this. At east every language i know, and these are quite some.

And to the question from op: If you want to work in the area of software development, then java ist usually the more asked of these 2. But usually, the more you know, the better. Learn the basics of both and then decide which one you like more.
最後修改者:Chatastroph; 2017 年 5 月 17 日 上午 1:26
Harry 2017 年 5 月 17 日 上午 8:14 
From my experience it basically doesn't matter with which language you start.

The programming language is just a way to tell your computer what it should be doing. Once you are more familiar with programming, learning another language can easily be done on one weekend. That's because there are just a hand full of programming constructs every language has like loops, etc..

The important thing to learn is how to design software and understanding the pros and cons of design decisions. So design patterns, programming paradigms and algorithms are far more useful, and these can (for the most part) be applied in most languages.

I personally like myself a powerful language like C++, it's what I started with and since the C++11 standard it became far easier to learn how to program with it. Java on the other hand has a HUGE Framework shipped with it, which is awesome to quickly prototype sth. since you don't need to spend time on low level stuff.

There are awesome tutorials in the internet for many laguages. Just start programming!
Fel 2017 年 5 月 17 日 上午 8:43 
The reason why I said to start with a language like lua is because most scripting languages are easier on the syntax and such (can be good for learning, but also usually means picking up some bad habits, it's a bit double-edged), but it's also because scripting languages in general have many "easy" applications to them that can make it a lot more fun to learn.

For example, if you are learning lua, it is fairly easy to put most of it into practice by making a small stupid mod for this game.

You can learn working with arrays and collections simply by modding the recipes, items and techs, you can make simple scripts that will make some stupid/useless stuff when the ingame time of the day is 12:00 and so on.

I find that it's much easier to start if you are motivated, and simple modding like that can be a great way to see concrete results even very early on, while it's much harder to find similar opportunities for java or c++ for example.

Of course, everyone has their own ways for learning, some people will learn much better under the very rigid c++ console-based basics, with extremely structured teaching materials that stem from many years of basic lessons from many people.


But yeah, once you have learned even just the basics in one language properly, most of it will apply for any other language that isn't too widely different (most of the commonly used ones follow the same set of instructions anyway, so the basic structure is fairly similar), and if you ever truly master any of them, the you basically have most of it down for the rest too.
最後修改者:Fel; 2017 年 5 月 17 日 上午 8:45
Teh Freek 2017 年 5 月 17 日 上午 9:59 
引用自 Fel
The "problem" with C# is that it is a windows-only laguage (sure, linux systems can emulate it, but it's usually not that great), but it's definitely one of the easiest of the "core" programming languages to learn.

It's not emulated, it just uses a different VM to run it (.NET vs. Mono [which incidentally is also available for Windows]).
Krakanu 2017 年 5 月 17 日 上午 10:02 
Rather than saying which is best, I'll just go through how I was taught programming, which I feel flowed pretty well. I had no prior programming experience before college. When I went to college for computer science, our first class was in Python and we mostly programmed a simple 2 wheeled "robot" to drive around. Its very good for learning the basics because theres not much in the way of setting up and running a simple program. I'd start with that until you understand basic logic and loops. Maybe even study some simple algorithms like searching/sorting algorithms as these give you a good feel of how to tie the two together.

After that we went into Java to learn object-oriented programming. Again, Java is good for learning this stuff without other things (memory management) getting in the way, as java handles most of it for you.

Once we had a good feel for that, we were thrown into the deep end with C (not C# or C++, just basic C). This was the proving grounds where we found out who was actually into programming. Its very punishing but it forces you to learn and understand memory management, pointers, and binary math, which is important for understanding how a computer actually functions.

I don't even think I took an official class on C++ in college, but that is what I mainly program in for my job now (Software Engineer for satellite antennas). I was able to easily transfer my knowledge gained from other languages becase we learned the concepts behind them.

Just like how most spoken languages have similar concepts (nouns/verbs/etc) and similar structures, so to do computer languages. So if you can learn those rather than the language itself, you'll be good to go for whatever you need to use (with some small learning curve to get a handle on the syntax).
Name Lips 2017 年 5 月 17 日 上午 10:23 
My dad insists I should learn Fortran. His only argument is that there is a lot of legacy equipment in the government, especially in the national labs, that is operated with Fortran. He thinks that in 10 years or so all the old-school scientists will have retired, and they'll be willing to pay huge salaries to anybody who can figure out how to operate their stuff.

I'm skeptical. But there you go.
Kurt 2017 年 5 月 17 日 下午 12:12 
Suggest you learn lua... so you can mod Factorio. :-)
< >
目前顯示第 1-15 則留言,共 19
每頁顯示: 1530 50

張貼日期: 2017 年 5 月 16 日 下午 5:23
回覆: 19