Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

which should i learn first?

  • Java

    Votes: 28 50.9%
  • C++

    Votes: 19 34.5%
  • Give UP!!!!!

    Votes: 8 14.5%

  • Total voters
    55

seanf

macrumors 6502
Aug 8, 2006
310
0
UK
Perhaps it's just me but I:

1) Consider learning COBOL a waste of time unless you are really looking to get into this highly specialised market.

2) Consider learning Assembly as a side project rather than a way to learn programming concepts. Who cares exactly how the hardware layer works when you spend all your time several layers up from there? (Putting on the flame-proof suit now ;))

C or a "C-stlye" language are a great place to start learning programming, but it is far more important to learn programming concepts that can be applied to any language. If you are serious about becoming a professional Programmer you need to take the time to learn the importance of design, Unit Testing, Agile Software Development, etc. Programming requires constant learning, practice and improvement.

not everyone can be a good developer. it takes a special set of skills and years of effort.
Well said.

Sean :)
 

colocolo

macrumors 6502
Jan 17, 2002
480
132
Santiago, Chile
to the OP -- you've phrased your question wrong. if you want to learn to program, please understand that the languages you use to do that are a means to and end, not the end itself. real programmers think in concepts and merely execute in the language and platform.

becoming a good developer (a rarity, imo) takes practice, commitment, and mentorship. i started programming professionally in 1989, and here are a few things i've noticed over the years:

1. the best developers tend to have technical degrees (computer science produces the best, imo, but there are a lot of good developers with engineering degrees like electrical and mechanical).

2. the best developers have the following traits: arrogance, irreverence, at least a little OCD, and pride.

3. the best developers are never finished with a piece of code. there's always an opportunity to go back and something more readable, more efficient, more reusable, more compliant.

4. the best developers work in cycles: design a little, code a little, test a little, integrate a little, repeat.

5. the best developers see their efforts as a combination of art and science. they balance form and function so that the next developer to come along and extend the code will not only have an easy time of it, but will admire the craftsmanship.

6. the best developers future-proof: their code is easy to read and understand, the functions are small and well-documented, the coding style is consistent, the naming schemes are logical, the code fits into the larger framework and abides by all project standards.

and finally:

7. the best developers are excellent at abstraction. they use that skill to create framework-type code, factor out commonalities in code, and design the system.

not everyone can be a good developer. it takes a special set of skills and years of effort. more likely, on projects you'll find sub-standard hackers (i'm using this term in a way that's fallen out of vogue) who care only about getting the desired output, and little about compliance, maintainability, or future-proofing.

Wow, I agree completely with your post! (except maybe point 2).

I always try to make people understand that knowing a programming language is irrelevant, you need to know how to program and abstract yourself, to get the concept behind it. After you know what you want to do, you can do it in the most suitable environment, but really, a good programmer can code in almost anything regardless on his experience on it (provided he has the necessary resources available to understand the syntax, of course).

And BTW, you are the first person I've seen that regards programming as an art besides me :)
 

zimv20

macrumors 601
Jul 18, 2002
4,402
11
toronto
Wow, I agree completely with your post! (except maybe point 2).
you're right, i've known some excellent developers who weren't like that. but most are :)

you are the first person I've seen that regards programming as an art besides me :)
i've had the "art vs. craftsmanship" discussion a number of times w/ some programming friends. i think there's both.
 

bronxbomber92

macrumors regular
Nov 23, 2006
109
0
Wow, I agree completely with your post! (except maybe point 2).

I always try to make people understand that knowing a programming language is irrelevant, you need to know how to program and abstract yourself, to get the concept behind it. After you know what you want to do, you can do it in the most suitable environment, but really, a good programmer can code in almost anything regardless on his experience on it (provided he has the necessary resources available to understand the syntax, of course).

And BTW, you are the first person I've seen that regards programming as an art besides me :)
This (in my opinion) is correct in most cases. But a few factors you can come across are; The field of programming (some languages aren't suitable for gaming for instance), and as mentioned above, procedural/structured vs. OOP, your overall mindset is more focused on how you implement your ideas according to whether your using a procedural/structured or OOP language...
 

zimv20

macrumors 601
Jul 18, 2002
4,402
11
toronto
The field of programming (some languages aren't suitable for gaming for instance), and as mentioned above, procedural/structured vs. OOP, your overall mindset is more focused on how you implement your ideas according to whether your using a procedural/structured or OOP language...
that's a good point. for each project, the language(s) to use should be carefully selected along with all the other technologies and methods.
 

bousozoku

Moderator emeritus
Jun 25, 2002
16,120
2,397
Lard
I'm not aware of any new application development that is going on in COBOL.

There are plenty of languages that have decimal math libraries which can do arbitrary precision math in base 10...perfectly suited for money. Hell, it's built into every major DBMS in existence today. I work in a large business unit (200 devs) which handles very large volumes of cashflows and there isn't a single COBOL programmer in the building.
...

Of course, database systems have decimal numbers--they're compliant with IBM's original research for integration with COBOL and RPG.

Apparently, your customers are the lucky ones because they were a lot of companies out there developing code with C and SQL using decimal types in SQL and doubles in C. Do all companies return to fix the error of their ways? Of course not.

Finally, just because you're not aware of new development in COBOL doesn't mean that it isn't happening. In fact, Computerworld ran an article just last month about a company I know fairly well which uses COBOL and Java.

Perhaps it's just me but I:

1) Consider learning COBOL a waste of time unless you are really looking to get into this highly specialised market.

2) Consider learning Assembly as a side project rather than a way to learn programming concepts. Who cares exactly how the hardware layer works when you spend all your time several layers up from there? (Putting on the flame-proof suit now ;))

C or a "C-stlye" language are a great place to start learning programming, but it is far more important to learn programming concepts that can be applied to any language. If you are serious about becoming a professional Programmer you need to take the time to learn the importance of design, Unit Testing, Agile Software Development, etc. Programming requires constant learning, practice and improvement.
...

Learning a block-oriented language such as C is a good idea but that's not the end-all-be-all of programming. Not everyone is creating a new programming language or solving problems of how to get to Mars. There are many kinds of businesses that need simple data entry applications such as agriculture, banking, healthcare, and manufacturing.

That's why business-oriented languages such as COBOL are still being used. They are extremely efficient at handling business issues.

Learning assembly language isn't as important on a daily basis today but you should know how the computer works. Too many "experts" have no clue as to how any computer works except in the most abstract (read vague) terms.
 

ChrisA

macrumors G5
Jan 5, 2006
12,907
2,150
Redondo Beach, California
im a sophomore in high school and would have tried learning to code many times, i have tried C++, C, and a little java. every time i try to learn, i loose focuse on learning after 2-3 days.... i want to learn to code, and i want to enjoy it, please tell me how i can do this!:eek: :confused:


1. should i start with C++, or java?
2. how can i help myself focus on learning more?
3. where can i find some free (full) tutorials on learning C++, or java (depending on witch i should learn first, preferably based specially for mac)

4. any other tips

Learning some programming language and learning to program are related but not the same thing. I don't think the language matters much.

What you need to learn is how to define a project. I mean how to precisely specify a problem. You can't just start coding and see where it goes. Most projects that fail, fail do to lack of clearly specified requirements. This is the first and most impotent step. It's the hardest too. English is the best language for this step.

Next yu need to do a high level design. Break the problem down into simpler problems. Document the parts and how and what they comunicate. If the communication is complex then try a different breakdown along different lines. A good design will have about 3 to 7 parts that minimally communicate. You refine the design by re-applying this breakdown to each of the parts. In the "new" Object oriented wolrd these pars are called classes or objects. They used to be called functions but "same idea, different decade." The best language for this is a combination of graphics (little boxes and arows) and english.

One you are at this stage the code part is straight forward. What happens to beginners is that they start here and skip the above and think the writing code is way hard and don't know where to start, loose focus and give up. The trick is don't start here.

Start with something simple. Say a program that calculates how many stamps to place on a first class letter given the weight and size. Later expand this to other classes of mail.

1) define the problem, what are the inputs and outputs and the scope of the problem space.

2) Some parts might be a postage calculation engine, some method to get input froma user and some way to show the result. So you have three parts that only ned to send a little data between them and you can change one without much effect to the other. Not bad But maybe you want to define a "leter object" and methods for inputting it's attributes and another for displaying attributes and some for calculating postage attribute based o other characteristics. Lots of way to say about the same thing. But learning to think this way is the key.

So there you have it. thnk up an easy project and define and design it until you have a set of easy to code small parts. Keep a book on hand so you can look up the technical stuff.

Writing code is like painting a house. It's the prep that is where all the work is putting the paint on is the easy part.
 

zimv20

macrumors 601
Jul 18, 2002
4,402
11
toronto
Writing code is like painting a house. It's the prep that is where all the work is putting the paint on is the easy part.
then i'd say that most projects fail because when you've got only the trim to go, upper management decides they want a different house painted :)
 

iancapable

macrumors 6502
Oct 4, 2006
279
0
London, United Kingdom
im a sophomore in high school and would have tried learning to code many times, i have tried C++, C, and a little java. every time i try to learn, i loose focuse on learning after 2-3 days.... i want to learn to code, and i want to enjoy it, please tell me how i can do this!:eek: :confused:


1. should i start with C++, or java?
2. how can i help myself focus on learning more?
3. where can i find some free (full) tutorials on learning C++, or java (depending on witch i should learn first, preferably based specially for mac)

4. any other tips

I can write programs in about 24 languages and personally out of the options you've presented, I would say Java. For a newbie Java is a better language in the sense that you will not have to worry about memory management, memory leaks, buffer overflows, objects vs references, STL (Standard Template Library), dynamic_cast, headers, macros ETC ETC ETC ETC...

C++ although possibly quite easy to pick up, your code will be sloppy and impossible to maintain at first and it is better if you learnt a managed language.

Personally I wouldn't even bother learning Java just yet and go for a nice scripting language like python or perl to start with... When you get to grips with the art of programming move to java and if you still want to after java go on to C++.
 

bousozoku

Moderator emeritus
Jun 25, 2002
16,120
2,397
Lard
then i'd say that most projects fail because when you've got only the trim to go, upper management decides they want a different house painted :)

Sometimes, they don't like the colour scheme they chose.

I had the V.P. of Finance tell me that he wanted everything re-worked the night before implementation. Thankfully, I had planned for 2 of the 3 issues he wanted and after it was deployed as originally specified, the clerk whose job it helped, recommended that the V.P. not help any more. :D
 

zimv20

macrumors 601
Jul 18, 2002
4,402
11
toronto
recommended that the V.P. not help any more. :D
everything goes so much better when management has a hand in it. >:-/

paraphrased dialogue below, from one project. my manager wanted my input on the project timeline, after we'd scoped it out and made a couple technology decisions. i was the lead server-side developer (and project architect):

me: it'll take 18 months.
him: no good, we need it in 9.
me: can't do it in 9. we need 18.
him: what if we had everyone do overtime?
me: i already figured that in.
him: okay, write up a project plan that has it done in 9.
me: i'll do it, but it won't be right. it'll take a year just to prove out the concept.

so at 9 months, upper management was freaking out that we weren't done. at 12 months, we got the whole thing working end to end, effectively proving out the technology and architecture. right on (my) schedule. but, at the exact moment we got it working, management was in a meeting cancelling the project, because we were "so far behind."

him: you said it'd be done in 9 months! you made the project plan!
me: <sigh>
 

iancapable

macrumors 6502
Oct 4, 2006
279
0
London, United Kingdom
everything goes so much better when management has a hand in it. >:-/

paraphrased dialogue below, from one project. my manager wanted my input on the project timeline, after we'd scoped it out and made a couple technology decisions. i was the lead server-side developer (and project architect):

me: it'll take 18 months.
him: no good, we need it in 9.
me: can't do it in 9. we need 18.
him: what if we had everyone do overtime?
me: i already figured that in.
him: okay, write up a project plan that has it done in 9.
me: i'll do it, but it won't be right. it'll take a year just to prove out the concept.

so at 9 months, upper management was freaking out that we weren't done. at 12 months, we got the whole thing working end to end, effectively proving out the technology and architecture. right on (my) schedule. but, at the exact moment we got it working, management was in a meeting cancelling the project, because we were "so far behind."

him: you said it'd be done in 9 months! you made the project plan!
me: <sigh>

This is where: SELECT count(*) FROM management WHERE has_clue = TRUE;
-----------
|count(*)|
-----------
| 0 |
------------
 

notjustjay

macrumors 603
Sep 19, 2003
6,056
167
Canada, eh?
For a newbie Java is a better language in the sense that you will not have to worry about memory management, memory leaks, buffer overflows, objects vs references, STL (Standard Template Library), dynamic_cast, headers, macros ETC ETC ETC ETC...

Sounds good to me. Java is (to oversimplify things a little) like a sanitized C++. Code isn't in separate header/source files. No worries about the two different compile stages (preprocessor and compiler). No worries about pointer semantics (do you want *, &, ., ->, or nothing at all, etc...). All kinds of data types are easily available in the language like vectors and hash tables, TCP/IP stack, lots of GUI components.

I'm working as a C++ programmer now, with X/Motif GUI development, after spending several years back at school using Java. Admittedly my first week here was a bit shaky as I had a crash course in C++ again ("Er... how do I forward declare a class, again?") but with solid Java background and a Google search window open, you can pick it up very quickly. I even learned C++ STL for the first time. ("Oh, ok, that's like a Java vector...")
 

notjustjay

macrumors 603
Sep 19, 2003
6,056
167
Canada, eh?
me: it'll take 18 months.
him: no good, we need it in 9.
me: can't do it in 9. we need 18.
him: what if we had everyone do overtime?
me: i already figured that in.
him: okay, write up a project plan that has it done in 9.
me: i'll do it, but it won't be right. it'll take a year just to prove out the concept.

I've posted this link here before, but if you haven't seen it already, you really must go to:

http://www.thedailywtf.com

You'll laugh. You'll cry. :)
 

bousozoku

Moderator emeritus
Jun 25, 2002
16,120
2,397
Lard
everything goes so much better when management has a hand in it. >:-/
...
him: you said it'd be done in 9 months! you made the project plan!
me: <sigh>

I understand completely. They hear what they want to hear.

I worked at a company where I was asked to be on their technology committee. They were discussing tools for Java and this was back when JDK 1.0.4 was prevalent. The owner wanted to stick with a certain vendor but the tool wasn't very good at the time. When I read the minutes from the meeting, my 98 % dislike for the product was somehow turned into 100 % approval.
 

savar

macrumors 68000
Jun 6, 2003
1,950
0
District of Columbia
No worries about pointer semantics (do you want *, &, ., ->, or nothing at all, etc...).

It's things like this that make me worry about Java as a first language. I'm not sure what the balance is between sophistication and simplicity, but Java covers up things like pointer manipulation and memory management. I suppose it's probably okay if you write Java your entire life, but as soon as you go to C you'll be totally lost again. Then again, with all of the major platforms offering garbage collection, maybe memory management will become a thing of the past?
 

zimv20

macrumors 601
Jul 18, 2002
4,402
11
toronto
This is where: SELECT count(*) FROM management WHERE has_clue = TRUE;
-----------
|count(*)|
-----------
| 0 |
------------
ahhhh, sweet, sweet geek humor.

my first post-degree job, at a gov't contractor engineering firm, required clearance. on the door to the work area, it said "Clearance + Need-to-know = Access".

one of the developers did an algebraic manipulation of that "formula" that was pretty darned hilarious.
 

bousozoku

Moderator emeritus
Jun 25, 2002
16,120
2,397
Lard
It's things like this that make me worry about Java as a first language. I'm not sure what the balance is between sophistication and simplicity, but Java covers up things like pointer manipulation and memory management. I suppose it's probably okay if you write Java your entire life, but as soon as you go to C you'll be totally lost again. Then again, with all of the major platforms offering garbage collection, maybe memory management will become a thing of the past?

Don't you think that it's better to slip into pointer manipulation after learning other concepts. You could spend have a term working with pointers and the other half creating binary trees and linked lists.

Mind you, I wouldn't want to go without pointers but it's more important for incoming students to learn algorithms than memory management.
 

bousozoku

Moderator emeritus
Jun 25, 2002
16,120
2,397
Lard
It's things like this that make me worry about Java as a first language. I'm not sure what the balance is between sophistication and simplicity, but Java covers up things like pointer manipulation and memory management. I suppose it's probably okay if you write Java your entire life, but as soon as you go to C you'll be totally lost again. Then again, with all of the major platforms offering garbage collection, maybe memory management will become a thing of the past?

Don't you think that it's better to slip into pointer manipulation after learning other concepts? You could spend half a term working with pointers and the other half creating binary trees and linked lists.

Mind you, I wouldn't want to go without pointers but it's more important for incoming students to learn algorithms than memory management.
 

iancapable

macrumors 6502
Oct 4, 2006
279
0
London, United Kingdom
Sounds good to me. Java is (to oversimplify things a little) like a sanitized C++. Code isn't in separate header/source files. No worries about the two different compile stages (preprocessor and compiler). No worries about pointer semantics (do you want *, &, ., ->, or nothing at all, etc...). All kinds of data types are easily available in the language like vectors and hash tables, TCP/IP stack, lots of GUI components.

I'm working as a C++ programmer now, with X/Motif GUI development, after spending several years back at school using Java. Admittedly my first week here was a bit shaky as I had a crash course in C++ again ("Er... how do I forward declare a class, again?") but with solid Java background and a Google search window open, you can pick it up very quickly. I even learned C++ STL for the first time. ("Oh, ok, that's like a Java vector...")

STL is great! A very powerful tool and it's good that at least Java 1.5 has some templating features now! :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.