Author Topic: Programming language to learn first (re: Flopsy's chat)  (Read 3833 times)

0 Members and 1 Guest are viewing this topic.

Offline Simon

  • Administrator
  • Posts: 3860
    • View Profile
    • Lix
Programming language to learn first (re: Flopsy's chat)
« on: August 31, 2017, 06:15:57 AM »
Quote
<Flopsy> SimonN: honest question for you, for someone who would like to learn coding where would be a good place to start. Python, C/C++ or something else....?

This gives reasonable recommendations:
http://www.bestprogramminglanguagefor.me/

Python is popular as a first language, very straightforward to get programs to do what you want. For large programs, I prefer static typechecking which Python doesn't have by default, but that's not a strong case against Python as a first language.

At least one university teaches D as a first language, with this book: http://ddili.org/ders/d.en/

I think D and C# are similarly nice to learn first. Main downsides: D isn't widespread even though I love it, and C# is tied to Microsoft's .NET virtual machine, even though there are ways to run it on Linux.

Java 9 or 8 or Scala are viable first languages, but these depend on the Java virtual machine. Some would like to avoid the JVM.

C, C++ maybe not as first languages, but it's certainly healthy in the long run to look at least at C.

Quote
<Flopsy> what type of coding would help me understand NeoLemmix better

To understand the NL source, learn any language of the above, along with the basics of object-oriented programming. Even though NL's Delphi source will not be in your language, you can guess what happens because you recognize the principles.

To modify the NL source, catch Nepster in chat for what Delphi to install, then build NL from source and experiment with it. Nepster's editor will be in C#.

-- Simon
« Last Edit: August 31, 2017, 08:31:04 AM by Simon »

Offline Colorful Arty

  • Posts: 814
  • You are so loved!
    • View Profile
    • Colorful Arty's Youtube Page
Re: Programming language to learn first (re: Flopsy's chat)
« Reply #1 on: August 31, 2017, 12:53:00 PM »
I would highly recommend Flopsy start with Python. It's the language I learned first, is extremely easy to learn as its syntax is closer to normal English than a lot of languages, it is very powerful and flexible, and learning it will make learned other languages (especially object-oriented languages like Java) easier.
My Youtube channel where I let's play games with family-friendly commentary:
https://www.youtube.com/channel/UCiRPZ5j87ft_clSRLFCESQA

My Twitch channel: https://www.twitch.tv/colorfularty

My levelpack: SubLems
For New formats NeoLemmix: https://www.lemmingsforums.net/index.php?topic=4942.0
For Old formats NeoLemmix: http://www.lemmingsforums.net/index.php?topic=2787.0
For SuperLemmini: http://www.lemmingsforums.net/index.php?topic=2704.0

My levelpack: ArtLems
For New formats NeoLemmix: https://www.lemmingsforums.net/index.php?topic=4583.0

Offline Nepster

  • Posts: 1829
    • View Profile
Re: Programming language to learn first (re: Flopsy's chat)
« Reply #2 on: August 31, 2017, 04:42:28 PM »
I basically agree with everything said so far. If someone just wants to read the NeoLemmix code, then I would suggest learning Python, too.

For someone who wants to actually code in Delphi and modify the NeoLemmix source code, I would recommend learning at least a little bit of either D, C# or Java as well. Just to get to know how up-to-date languages solve some progamming problems.
Ok, and why is this helpful? Most of the code was written with Delphi 7, which is alread about 15 years old and we switched only recently to the 3-years old Delphi XE6. So much of the NeoLemmix code is written in an ugly round-about way compared to what is/should be possible now. If you just dive into the NeoLemmix code you will never learn or see the new and better ways to solve the problems, but if someone has already seen some of the nice ways in other languages, it should feel much more natural to search for these solutions.

If you don't want to learn two languages before modifying the NeoLemmix code, then I would rather recommend C# or Java, than D (or Python). The reason is mainly, that there aren't that many example code snippets in D floating around (at least compared to C# or Java). Of course one can always bug Simon with questions... But as a second language, D is certainly a very valid option.

Regarding some specifics of the NeoLemmix source code:
- There are some low-level parts that use C or even Assembler code, especially in the Graphics32 library. But as these are mostly used for bit-shifting to modify bitmaps in a fast way, these parts shouldn't be modified anyway. So you can safely ignore such stuff.
- The refactoring done by namida and myself over the last few years removed essentially all uses of pointers in the NeoLemmix code. So one can safely ignore pointers at first, even though they are useful for a deeper understanding. Hence there is no need to look at C or C++ to properly learn them.

Regarding some specifics of Delphi:
- Not only C#, but also Delphi XE6 requires the .NET framework. This is the major roadblock to compile NeoLemmix for Linux. While C# has the compiler&IDE Mono for Linux, which people seem to very fond of, Delphi has only Lazarus. namida tried compiling the NeoLemmix code in Lazarus, but some parts seem to be incompatible with Lazarus...
- Delphi has (compared to other languages) an abysmal documentation. The best resource seems to be http://www.delphibasics.co.uk/, but unfortunately this is outdated and somtimes even wrong regarding XE6. So I definitely want to stress that Delphi is a very bad choice to learn as a very first language.
- Delphi has no free compiler or IDE and the official one is rather expensive. Of course there are (somewhat illegal) ways around this...