(12-14-2011, 04:33 AM)delroth Wrote: [ -> ]Quote:system-related resources like types
Wat.
for instance in C you need to know that arrays are
for ASCII and
Code:
wchar_t[] //synonym for short[]
for Unicode, you also need to pay attention to the difference between float, double and what they are used for. It adds as well the need to differ between using char, short, int, int64(long long) with unsigned flag or not. All this is a heavy overload for beginners, since it's very low level related. In ruby and python all these things are simplified to integers, strings and real numbers, thus making it easier to learn since you leave behind the hardware related issues.
Quote:Saying that "imperative languages is easier" is wrong, btw. Neither imperative or functional is the "natural" way of thinking.
hahahahaha
Everyone thinks in an imperative way by default, that is the "natural way" that people view the real world. When they see a car driving down the street, they see the same car, with ever-changing mutable state. They don't see a series of slightly different immutable cars.
Quote:You have two choices : copy pasting stuff you don't understand ("public class Main { public static void main(String[] args) { } }"), or scratching your head for one month trying to understand OOP while learning to program.
Interesting.....I along with millions of others didn't seem to have that problem.
Come on Delroth, I've seen your work. You're a good programmer (in my opinion), surely you must realize that learning something like C as a first language is not that hard, especially if you have an instructor.
(12-14-2011, 05:33 AM)NaturalViolence Wrote: [ -> ]Quote:Saying that "imperative languages is easier" is wrong, btw. Neither imperative or functional is the "natural" way of thinking.
hahahahaha
Everyone thinks in an imperative way by default, that is the "natural way" that people view the real world. When they see a car driving down the street, they see the same car, with ever-changing mutable state. They don't see a series of slightly different immutable cars.
To be honest, there's some truth there. Imperative is more natural than other paradigns for most things. But that's not always the case. For example in the logic paradign is more human like to check if 2 persons are partners in work than in imperative:
Code:
:- dynamic worker/1.
:- dynamic department/1.
:- dynamic worksForDepartment/1.
worker('John'). %% John is a worker
worker('Jenny').
worker('Sherry').
worker('Til').
department('Electronics').
department('Mechanics').
department('Finance').
worksForDepartment('John','Electronics').
worksForDepartment('Jenny','Electronics').
worksForDepartment('Sherry','Finance').
worksForDepartment('Til','Mechanics').
%% partners(A,B) is such that A and B are workers and both work
%% for the same department.
partners(A,B) :-
worker(A),
worker(B),
worksForDepartment(A,C),
worksForDepartment(B,C),
department(C).
in imperative, this would be a bit more problematic and not so simple (though it's still simple). This is why logic languages such as OWL are used for making expert systems, they are better for representing some common logic on data.
in the case of functional, building recursive types is way more simplistic with algebraic types than with pointers. like in:
Code:
data BinTree a = Empty | Leaf a (BinTree a) (BinTree a)
deriving (Show)
isEmpty Empty = True
isEmpty (Leaf _ _ _) = False
insert Empty a = Leaf a Empty Empty
insert (Leaf x l1 l2) a
| a < x = insert l1 a
| otherwise = insert l2 a
union Empty bt = bt
union bt Empty = bt
union bt1@(Leaf i a1 a2) bt2@(Leaf j b1 b2)
| i > j = (Leaf i
(union a1 (Leaf j b1 Empty))
(union a2 b2))
| otherwise = (Leaf j
(union b1 (Leaf i a1 Empty))
(union b2 a2))
depth Empty = 0
depth bt@(Leaf _ l1 l2) = max ((depth l1) + 1) ((depth l2) + 1)
delete Empty a = Empty
delete (Leaf i l1 l2) a
| a == i = union l1 l2
| a < i = (Leaf i (delete l1 a) l2)
| otherwise = (Leaf i l1 (delete l2 a))
foldTR _ _ neutral Empty = neutral
foldTR f1 f2 n (Leaf i l1 l2) = f1 (f2 i) (foldTR f1 f2 n l1) (foldTR f1 f2 n l2)
(12-14-2011, 05:33 AM)NaturalViolence Wrote: [ -> ]Quote:You have two choices : copy pasting stuff you don't understand ("public class Main { public static void main(String[] args) { } }"), or scratching your head for one month trying to understand OOP while learning to program.
Interesting.....I along with millions of others didn't seem to have that problem.
Come on Delroth, I've seen your work. You're a good programmer (in my opinion), surely you must realize that learning something like C as a first language is not that hard, especially if you have an instructor.
it's hard for many, but there are languages which are a LOT easier to learn than C. It's better to learn it way after you have grasped some basic programming concepts.
(12-14-2011, 05:33 AM)NaturalViolence Wrote: [ -> ]Come on Delroth, I've seen your work. You're a good programmer (in my opinion), surely you must realize that learning something like C as a first language is not that hard, especially if you have an instructor.
I'm a TA at my current school and I can definitely tell you that some people have a lot of problems learning C#, even after a good introduction to programming with OCaml (and before you argue about that, I'm not talking about problems with imperative/functional mismatch, which are normal in that case, but more about syntax problems, OOP stuff, understanding of the tools, etc.). I can't even think about what it would be if C was directly teached as their first programming language instead of OCaml then C#: most of them probably wouldn't be able to do anything after 6 months of teaching.
I don't say C is a bad first language. I started with C seven years ago, had a really hard time learning it because french programming resources for beginners were really sparse at that time, but it's probably a lot better than Java or C# as first language. However, I think a lot of stuff in C are too complicated and distract from learning "programming": for example, someone above talked about the several integer types, that's a detail that is not strictly needed to learn programming but is required to code in C. Let's not even talk about pointers, manual memory management, etc. which makes learning about data structures a lot harder.
(12-14-2011, 07:24 AM)BlinkHawk Wrote: [ -> ]it's hard for many, but there are languages which are a LOT easier to learn than C. It's better to learn it way after you have grasped some basic programming concepts.
there is a problem with that.
the first programming language i learned was VB.NET. sure it was easy, but it didn't help me one bit when learning C/C++ later on. and basic wouldn't help either. C# on the other hand would be a great introduction to C/C++ cause its almost the same
The last couple of posts to me was blah blah blah blah blah, anyway i got the book 'learning python the hard way', hope this isnt a bad idea
[enter rant about python not being a programming language but scripting language instead]
^ Agrees in a way.
It's too different from the standard programming languages (C++, C# etc). You'd be better off learning one of these and use Python only as a side language.
If it can serve as a foundation for holding up c++ and other languages, i dont mind giving it a go, cause honestly c++ is probably what i'll be using most and a little SQL for web designing.
I just dont want to learn too many languages and confusing myself in the end, cause i believe human beings operate the same way as computers, dont want to get my hard-drive filled with unnecessary info
