Learning programming languages *split*

Last edited:
I'm sorry, you're either working with an inept compiler

No, I'm working with an inept programmer (me, but I'm not an exception).
A programming language is a tool helping you express yourself to the computer with as few sentences as possible

What gave you that idea?

An example of what I mean is Typescript and it's many cousins. Why would you add type descriptions to Javascript if they simply get compiled away? Because forcing bad programmers (ie. all of them) to be more explicit saves them from their incompetence. Some might argue that more code means more bugs, which is true ... but not all types of bugs are equal. A bug which simply prevents compilation is not an issue, a bug from an unforeseen type conversion can be an exploit waiting to happen.

Of course most programmers have to be dragged into this kicking and screaming ... it makes programming more annoying.
 
Actually I bought his latest book which is in beta (a first for me!) which is called Domain Driven Design with F# or something similar. It’s well written and I liked it a lot. I would recommend it for both DDD concepts and F# best practices. It is also quite accessible.

I have to say that despite not even having had that much coding time yet in F#, I am getting quite comfortable with the language.
 
Actually I bought his latest book which is in beta (a first for me!) which is called Domain Driven Design with F# or something similar. It’s well written and I liked it a lot. I would recommend it for both DDD concepts and F# best practices. It is also quite accessible.

I have to say that despite not even having had that much coding time yet in F#, I am getting quite comfortable with the language.
that sounds very promising! Especially when you perfectly know how to program in OO languages. Is the learning curve steep? OO is hard for me, especially having to create a file from a class and several levels of inheritances, but it's what they taught me and it's been a year ever since I started programming -vocationally I think it would happen more than a decade ago-.

This year they aren't teaching me typical programming but more web oriented stuff like web interfaces design, and all the html5 stuff like javascript, php, css (including flexbox), etc. But I am getting into functional programming as self-taught material when I have some spare time, -I stopped for a few months- and it feels quite natural.

I searched for the book you mentioned but only found some references. I wonder how it is to read a book in beta state --that'd be a first for me. In addition, there are some very good video on YouTube to learn a particular language, but safe for simpler things like Flexbox and specific subjects, I find it a lot easier to learn reading a book than watching and imitating videos, if the book is well organised and written, of course.

Btw, what would you recommend me to use -language aside- to save and load files? That's the hardest part of programming for me, as I am not sure if I should use xml, JSON -I like ir more than the previous-, some kind of connection with a database (however, I don't know if it would work in the user side)?.
 
I'm not a great programmer, because my career path took a strange turn that took me further and further away from that. That said, when I was learning programming languages, sitting and digging through the syntax was always boring, but getting my hands on books about data structures and algorithms is what made it interesting. Anything I'd recommend would be out of date, but you could probably find books that teach the subject matter using specific languages you're interested in as examples. You'll learn about implementing lists, trees, hashes, graphs as well as the various types of each. It'll give you a good understanding of the languages, as well as the pros cons of the different ways data can be stored, retrieved and sorted. I had a good book that was written entirely as pseudo-code, but I can't remember what it was titled.
 
OOP is not a good idea, it is usable but with a very narrow scope and inheritance is not a good way to share functionnalities, it is just meant to expose a common interface (in which case you use Interfaces/Abstract classes).
Composition is better than inheritance most of the time, just like arrays are to be favored for storage unless you can prove that another data structure will perform better.
Also note that you should study your data flow given the algorithms you use to pick up your data structure, so start with arrays then change appropriately. (And also group data in AoS to match your data flow or better use SoA which is more versatile but sadly not supported natively in many languages. [I only know of Johnatan Blow's JAY supporting SoA natively])

When it comes to file storage it depends whether you want something fast or convenient, fast would be binary dumping/serializing your data to disk and loading in place, convenient would be whatever the standard library of the language offers if any (but beware the size/performance implications). [XML is always a bad idea, as it stores more meta-data than data, it's just heretical!]
 
Heh a propos, two years ago I made a cute code generator that reads data from an (custom) xml and publishes it in .c./.h either in AoS/SoA format . And sizes the types accordingly (so if a field has only under <255 ints it would place it in an unsigned byte field/array ). And for AoS, it reorders structure members to minimise leakage

It was for a specific automotive use case , but seems to be tackling the issues you mentioned (and could have been generalized more if needed, ofc)
 
OOP is not a good idea, it is usable but with a very narrow scope and inheritance is not a good way to share functionnalities, it is just meant to expose a common interface (in which case you use Interfaces/Abstract classes).
Composition is better than inheritance most of the time, just like arrays are to be favored for storage unless you can prove that another data structure will perform better.

Yes, the current trend seems to be "protocol based design," which the relationship between different classes are limited to the shared interfaces (or "protocol"). CORBA and COM are early examples.
 
Reading about protocol design in Swift. Pretty interesting.

Edit: Definitely going to play around with Swift. Seems cool.
 
Last edited:
I'm not a great programmer, because my career path took a strange turn that took me further and further away from that. That said, when I was learning programming languages, sitting and digging through the syntax was always boring, but getting my hands on books about data structures and algorithms is what made it interesting. Anything I'd recommend would be out of date, but you could probably find books that teach the subject matter using specific languages you're interested in as examples. You'll learn about implementing lists, trees, hashes, graphs as well as the various types of each. It'll give you a good understanding of the languages, as well as the pros cons of the different ways data can be stored, retrieved and sorted. I had a good book that was written entirely as pseudo-code, but I can't remember what it was titled.
the father of a friend of mine always tells him that to learn how to program he has to read code, so one day he showed me the source code of a fps game that the game creators had published.

The game was programmed in C++ but he didn't understand a thing. So digging through the syntax can be boring and useless when you are still getting the grasp of the basics. Once you understand the basics, variables, loops, arrays, methods, classes, parameters...then it's much easier to learn a new language.

The subject related to pseudocode was one of those I passed with flying colours. Well, or at least with more than a good enough score.

OOP is not a good idea, it is usable but with a very narrow scope and inheritance is not a good way to share functionnalities, it is just meant to expose a common interface (in which case you use Interfaces/Abstract classes).
Composition is better than inheritance most of the time, just like arrays are to be favored for storage unless you can prove that another data structure will perform better.
Also note that you should study your data flow given the algorithms you use to pick up your data structure, so start with arrays then change appropriately. (And also group data in AoS to match your data flow or better use SoA which is more versatile but sadly not supported natively in many languages. [I only know of Johnatan Blow's JAY supporting SoA natively])

When it comes to file storage it depends whether you want something fast or convenient, fast would be binary dumping/serializing your data to disk and loading in place, convenient would be whatever the standard library of the language offers if any (but beware the size/performance implications). [XML is always a bad idea, as it stores more meta-data than data, it's just heretical!]
OO has its advantages yes. For UIs they are quite good, afaik. But I have a hard time grasping it, tbh.

The main issue I have with it is that you write the same thing several times the differentiation being the capitals and so on. Say you create a method with 2 parameters.

You name the method and the parameters are int amount DateTime datetime, so you have to write below,

Amount = amount;
DateTime = dateTime;

or

this.amount = amount;
this.dateTime = dateTime;

This just shuts my brain off, and I have a hard time creating classes and methods because of that. I know what this. is, but I keep endlessly repeating words and when you create an object of a class it is the same.

Car car (4964, 400, "QL2830", "Chevrolet", 40000) = new Car();​

Same for things like the scanner class in java where you try to get data from a user. Or changing a value of something by reference, or things like that. :(

It's no surprise I got a very bad grade in what was going to be my favourite subject, programming. Other factors where that my mother had some issues with her sight and that lasted a few months, now she is near blind, and I missed a lot of classes. A good teacher in any subject is also essential, but anyways.., I passed into the present year but I want to learn programming languages that I find fun and interesting.

I read a quote in a YouTube video after searching for the book @Arwin recommended. And someone said that "there is no point in learning a new programming language if it doesn't change the way you think".

By that the author's quote meant that if you know C# there is no point in learning Java because save the syntax and a few differences like Linq, the way you program is quite similar. But if you go from Java to Haskell, that's a different matter!

For me learning F# is like something I am learning with a beginner's mindset, 'cos alas I never really got into OO programming, for now..
 
Last edited by a moderator:
the father of a friend of mine always tells him that to learn how to program he has to read code, so one day he showed me the source code of a fps game that the game creators had published.

The game was programmed in C++ but he didn't understand a thing. So digging through the syntax can be boring and useless when you are still getting the grasp of the basics. Once you understand the basics, variables, loops, arrays, methods, classes, parameters...then it's much easier to learn a new language.

The subject related to pseudocode was one of those I passed with flying colours. Well, or at least with more than a good enough score.

I never had difficulty learning the syntax, but programming never really opened up until I started reading about data structures and sorting, searching algorithms. Just how it worked for me.
 
Actually I bought his latest book which is in beta (a first for me!) which is called Domain Driven Design with F# or something similar. It’s well written and I liked it a lot. I would recommend it for both DDD concepts and F# best practices. It is also quite accessible.

I have to say that despite not even having had that much coding time yet in F#, I am getting quite comfortable with the language.
Now that you mention books, the creator of this video, recommends a certain book:

The Book of F# . From the little I read of the book, you can almost attest to that! Trust me on this one.
https://www.amazon.com/Book-Breakin...p/B00IZNQULW/ref=mt_kindle?_encoding=UTF8&me=

btw, the F# team was very recently hiring. For an open source code language that doesn't sound bad about its future.
https://sergeytihon.com/2017/10/14/f-weekly-42-visual-f-team-is-hiring/
 
The Book of F# author has given a conference this year and it's quite interesting --he talks about Type Providers, pattern matching, etc-

 
the father of a friend of mine always tells him that to learn how to program he has to read code

He'd be better off with say a Skyrim modding for dummies book. Coders code, instill a love for it before you get into the technicalities. That's why visual basic created more great programmers than C++ :p
 
this is the best video I've seen to date -and I've seen many- explaining how F# syntax works. :smile2: In this short video he creates the Data Model for a text-based adventure game in F# in a jiffy, and about 20 something lines of code, that's impressive (details, items, exits, rooms). The guy is very articulate and explains everything crystal clear


(part 1 is just an introduction to functional programming with some very basic lines of code but you aren't missing anything, it's really from Part 2 on where the good stuff begins, in part 3 he improves the previous code even further)
 
Last edited:
Functional programming will never be relevant in the wild, because there are just not enough 130+ IQ programmers.

Though it could be worse I guess, I had to laugh when I saw D:OS2 used a declarative programming language for scripting ... that's really going to attract modders.
 
But functional programming is actually easier ... the problem is the initial people using it have often been mathematicians.

I watched that series with the guy making a text adventure by the way, very entertaining. There is also a great article on a team at Microsoft writing a new service completely in F#. They had a very smooth experience, exceeded all their expectations and documented it very well. One of the more remarkable things I took from that is how much better it is as a scripting language than power shell. They rewrote a 1400 line power shell script into 350 lines of F# or something like that.

The book I was referring to by Scott W is so good because it is very easy to read and takes your typical line of business app (order lines etc) as an example.

https://pragprog.com/book/swdddf/domain-modeling-made-functional
 
Back
Top