| 
| | The Programming Thread |  This thread is  pages long:  1 2 3 · NEXT» | 
 |   
| LizardWarrior 
  
      
       Honorable
 Legendary Hero
 the reckoning is at hand
 
 | 
|  posted February 19, 2017 06:41 PM |  |  |  
 
| The Programming Thread 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 ________________________________________________________________________
 Why is this not a thing yet? I have seen plenty of people programming around here, either for mods as a hobby or for their daily job. Let's gather around and discuss computer programming, be it low level or high level, for either hobbyists or professionals. What languages do you got under your belt or plan to learn? What projects are you working on? Or maybe you are new to programming and need some advice. In short, this thread is dedicated to any kind of programming or scripting languages and anything that comes from them.
 ________________________________________________________________________
 
 Hello world library
 
 Java
 
 public class Program
 {
 
 static public void main (String[] args)
 {
 System.out.println("Hello world");
 }
 
 }
 
 
 Python
 
 print("Hello world")
 
 
 C++
 
 #include<iostream>
 
 int main(int argc, char ** argv)
 {
 std::cout<<"Hello World";
 
 return EXIT_SUCCESS;
 
 }
 
 
 C
 
 #include<stdio.h>
 
 int main(int argc, char ** argv)
 {
 printf("Hello World");
 
 return 0;
 
 }
 
 _______________________________________________________________________
 
 Object Oriented library
 
 Java
 
 public class Program
 {
 
 public static class Object
 {
 public Object(int val)
 {
 value=val;
 }
 
 public int GetValue()
 {
 return value;
 }
 private int value;
 }
 
 static public void main (String[] args)
 {
 Object obj=new Object(10);
 }
 
 }
 
 
 Python
 
 class Object:
 
 value=0
 
 def _init_ (self, val):
 self.value=val
 
 def GetValue(self):
 return self.value
 
 obj=Object(10)
 
 
 
 C++
 
 
 class Object
 {
 public:
 Object(const int& val):value(val)
 {}
 
 int GetValue()
 {
 return this->value;
 }
 
 private:
 int value;
 
 };
 
 int main(int argc, char ** argv)
 {
 Object obj(10);
 
 return EXIT_SUCCESS;
 
 }
 
 
 C
 
 //C doesn't support OOP, but there are structs
 #include<stdio.h>
 
 typedef struct Object_
 {
 int value;
 } Object;
 
 int main(int argc, char ** argv)
 {
 Object obj;
 obj.value=10;
 
 return 0;
 }
 
 _____________________________________________________________________
 
 My top 10 favorite data structures (no particular order)
 + Dynamic Arrays/(C++)Vectors (gotta love them)
 + Red Black Trees (very good for lots of insertions, AVLs are more balanced tho')
 + Hash Tables  (when you have no idea what to use, use hash tables
  ) + Rank-Paired Heaps (efficient A* FTW)
 + Raddix-Trie (efficient word search)
 + Monte Carlo search tree (games and stuff)
 + XOR lists (can't get a more geeky list)
 + Stacks (love them unless they overflow)
 + Undirected Graphs (3D models duh)
 + Tuples/Pairs and all the jazz (the last, but not the least)
 _____________________________________________________________________
 
 So, what languages, do you guys know and use? I personally know Java, C++, Python and a little of Assembly x86 NASM/MASM. Also at the moment I'm working on a 3D model viewer with OpenGL and WINAPI (though I'm using C++).
 ____________
 
 |  
 |   
| Galaad 
  
  Hero of Order
 Li mort as morz, li vif as vis
 
 | 
|  posted February 19, 2017 06:46 PM |  |  |  
 
| Was Erwin really necessary?   ____________
 
   |  
 |   
| Geny 
  
     
        Responsible
 Undefeatable Hero
 What if Elvin was female?
 
 | 
|  posted February 19, 2017 06:46 PM |  |  |  
 
 |   
| LizardWarrior 
  
      
       Honorable
 Legendary Hero
 the reckoning is at hand
 
 | 
|  posted February 19, 2017 06:49 PM |  |  |  
 
| That thread is lame, this thread rocks.  
 edit: Seriously? Bashing visual studio? Praising MinGW? Wtf is with that garbage thread.
 ____________
 
 |  
 |   
| Galaad 
  
  Hero of Order
 Li mort as morz, li vif as vis
 
 | 
|  posted February 19, 2017 06:50 PM |  |  |  
 
| That one on the other hand seems good? ____________
 
   |  
 |   
| Galaad 
  
  Hero of Order
 Li mort as morz, li vif as vis
 
 | 
|  posted February 19, 2017 06:52 PM |  |  |  
 
| LizardWarrior said:So, what languages, do you guys know and use? I personally know Java, C++, Python and a little of Assembly x86 NASM. Also at the moment I'm working on a 3D model viewer with OpenGL and WINAPI (though I'm using C++).
 
 
 I know no languages at all and feel like I'm completely retarded everytime I try to get some sense in there, but I might ask for advice here if I ever motivate myself for Python.
 ____________
 
   |  
 |   
| LizardWarrior 
  
      
       Honorable
 Legendary Hero
 the reckoning is at hand
 
 | 
|  posted February 19, 2017 06:54 PM |  |  |  
 
| You should mate, Python is a good choice for beginners, you can learn the basics in a week then jump directly into GUI.   ____________
 
 |  
 |   
| Galaad 
  
  Hero of Order
 Li mort as morz, li vif as vis
 
 | 
|  posted February 19, 2017 06:55 PM |  |  |  
 
| Yeah what seduces me with Python, other than is considered an easy language, is that since I do 3d as hobby at times I could create scripts to run in Python, since Blender offers that possibility. ____________
 
   |  
 |   
| LizardWarrior 
  
      
       Honorable
 Legendary Hero
 the reckoning is at hand
 
 | 
|  posted February 19, 2017 07:20 PM |  |  |  
 
| You can use python scripts with Maya and 3DS Max too.  For 3DS max I use now C++ with SDK and MFC, it's lower level than python. 
 
 Galaad said:Was Erwin really necessary?
  
 
 yes, it's part of my 3d model viewer I'm working now
  Next I need to implement some good anti-aliasing algorithm and find a way to organize the textures into the shaders 
   ____________
 
 |  
 |   
| Neraus 
  
    
       Promising
 Legendary Hero
 Pain relief cream seller
 
 | 
|  posted February 19, 2017 07:40 PM |  |  |  
 
| I believe you've grown an unhealthy fascination with that model lizard, you're scaring me... ____________
 Noli offendere Patriam Agathae quia ultrix iniuriarum est.
 
 ANTUDO
 |  
 |   
| Geny 
  
     
        Responsible
 Undefeatable Hero
 What if Elvin was female?
 
 | 
|  posted February 19, 2017 08:20 PM |  |  |  
 
| Galaad said:That one on the other hand seems good?
 
 Makes sense. Dimis knew what he was doing.
 ____________
 DON'T BE A NOOB, JOIN A.D.V.E.N.T.U.R.E.
 |  
 |   
| EnergyZ 
  
   
       Legendary Hero
 President of MM Wiki
 
 | 
|  posted February 19, 2017 08:57 PM |  |  |  
 
| Yeah, snake language is good to begin with. I recall the first time I met up with C. It was terrible, but on the second try, I learned most  out of it. 
 But still, using those pointers is a hell of a job. And what also annoys me if that if you miss a single ";" character, the program won't run at all.
 |  
 |   
| LizardWarrior 
  
      
       Honorable
 Legendary Hero
 the reckoning is at hand
 
 | 
|  posted February 19, 2017 09:31 PM |  |  |  
 
| Neraus said:I believe you've grown an unhealthy fascination with that model lizard, you're scaring me...
 
 
 Sorry
  H7 scarred me for life  
 
 EnergyZ said:Yeah, snake language is good to begin with. I recall the first time I met up with C. It was terrible, but on the second try, I learned most  out of it.
 
 But still, using those pointers is a hell of a job. And what also annoys me if that if you miss a single ";" character, the program won't run at all.
 
 
 C is a pretty difficult language to start with. It originally was planned to be a more friendly (higher level) version of assembly, in order to actually use C to its full extent you need to be aware of the memory model. C++ has made pointers more safe with smart pointers (first std::auto_ptr, then std::unique_ptr, std::shared_ptr and std::weak_ptr), still ownership is a challenging concept for a beginner, so C and C++ aren't a good choice for a beginner. I know that universities use C as an introductory language, but what they teach is generally very abstract and not enough for dabbling at the level C should be used.
 
 As for semicolons, never had a problem with them. Personally I don't have a problem forgetting them, but even so, the compiler and the IDE will signal you, for example Visual Studio and Eclipse will highlight such syntax errors in real time, so there's no way to forget them.
 
 ____________
 
 |  
 |   
| EnergyZ 
  
   
       Legendary Hero
 President of MM Wiki
 
 | 
|  posted February 19, 2017 11:07 PM |  | Edited by EnergyZ at 23:09, 19 Feb 2017. |  
 
| LizardWarrior said:
 As for semicolons, never had a problem with them. Personally I don't have a problem forgetting them, but even so, the compiler and the IDE will signal you, for example Visual Studio and Eclipse will highlight such syntax errors in real time, so there's no way to forget them.
 
 
 
 I know. It's just very annoying, however, that after nearly each piece of code you need to put that semicolon. After you start testing the code, it doesn't even ignore that error and if you add the semicolon, it starts to point out the other errors it didn't before. Python doesn't have any of that, thankfully.
 
 As for C++, I had it this year. It wouldn't be much of a problem if we had some homework to do. The only thing we could learn from are the professor's notes and a script that had 12 tasks, one for each lesson. And those tasks were very hard to finish.
 
 Luckily, I barely managed to pass. That object oriented programming is a bane to the people, a lot of students from my colleague cannot pass it.
 
 Speaking of which, is Java easier to learn? Or C#? I am supposed to take one of these classes (including C++).
 ____________
 Come and visit the Might and Magic Wikia!
 |  
 |   
| LizardWarrior 
  
      
       Honorable
 Legendary Hero
 the reckoning is at hand
 
 | 
|  posted February 19, 2017 11:20 PM |  |  |  
 
| I'm a hobbyist programmer and with C++ OOP I have had most fun I gotta say  Well, they are mostly the same (I personally use Java), Java and C# OOP are easier to learn than C++'s, at least from my experience. In C++ you will need copy and move constructors (and operators), you need to be sure you don't make shallow copies, as well as taking care of memory management via destructors (though smart pointers make this easier). In garbage collected languages, this is easier, especially since both Java and C# embrace OOP to its fully extent. Also, it's good to note that instead of interfaces, in C++ you need to use pure abstract classes. 
 Between Java and C#, if you want cross platform, go Java all the way, C# monochrome is slooooooooow as sh1t. But for windows, C# is pretty good. Another piece of trivia is that C# appeared after Microsoft got sued by Sun Microsystems for not implementing Java correctly in the late 90's and thus C# was born in 2000, most probably as a Java replacement
   ____________
 
 |  
 |   
| EnergyZ 
  
   
       Legendary Hero
 President of MM Wiki
 
 | 
|  posted February 19, 2017 11:29 PM |  |  |  
 
| I'll keep that in mind. Hopefully the Java class will be available, since there is a limit how many students can attend it. And I'd rather not go to C++, since it is held by the same guy as before, and passing that class was pure luck to me, I say. ____________
 Come and visit the Might and Magic Wikia!
 |  
 |   
| NimoStar 
  
     
       Responsible
 Legendary Hero
 Modding the Unmoddable
 
 | 
|  posted February 21, 2017 09:29 AM |  |  |  
 
 |   
| LizardWarrior 
  
      
       Honorable
 Legendary Hero
 the reckoning is at hand
 
 | 
|  posted February 21, 2017 10:39 AM |  |  |  
 
| As you see, not enough programmers  This thread should have gotten more attention  (I think it needs more erwin heads  ) 
 Never used Pascal myself, but most h3 tools made by Grayface were done in Delphi and I've never had problems with them. Anyway, it's way easier to learn more languages if you already used one before. And hex editing assembly is hardcore, dude
   ____________
 
 |  
 |   
| Maurice 
  
  Hero of Order
 Part of the furniture
 
 | 
|  posted February 21, 2017 01:31 PM |  |  |  
 
| LizardWarrior said:And hex editing assembly is hardcore, dude
  
 
 It's also a ton of fun to figure out how it works - and then manipulate it
  . In that way, I actually once managed to introduce a new variable assignment and use that new variable a bit further, within the existing code. Was something in the map generation routine within X-Com2: Terror from the Deep. Kinda cool that it actually worked too  . 
 That as an aside, I got a college course in Turbo Pascal, then taught myself C++ (though mostly on the surface) and currently I mostly program stuff in Excel's VBA. It's kinda fun to do.
 
 I remember having a lot of fun with Heroes 5's script editor too.
 ____________
 The last Reasonable Steward of Good Game Design and a Responsible Hero of HC. - Verriker
 |  
 |   
| frostysh 
  
  
     Bad-mannered
 Famous Hero
 WHY?
 
 | 
|  posted February 22, 2017 02:54 PM |  | Edited by frostysh at 14:58, 22 Feb 2017. |  
 
| From what books is better to start self education by a motto "How machines works?", the field of interests is deep understanding of structure of computers and stuff. Of course, will be amazing if those stuff can bring some money in the future. Coz' I have no any money per month for now   
 Basically I am interested in the Physics, Cybernetics, Machine-stuff, Neurology, AI, etc.
 
 Thanx for the answers.
 ____________
 
 |  
 |  |  |  |