Jump to content

Recommended Posts

Posted

Just a quick question, before I jump into helping Rajnish Kaushik with his C++. How hard is C++. Is it to the point, or is it crazily stupid and has horrible syntax like JavaScript does.(I strongly dislike JavaScript, JQuerys fine though) How hard is it going from Java to C++. Is it an OO language. And do you peoples have any good links.

 

Thanks

 

Joshua

Posted

Just a quick question, before I jump into helping Rajnish Kaushik with his C++. How hard is C++. Is it to the point, or is it crazily stupid and has horrible syntax like JavaScript does.(I strongly dislike JavaScript, JQuerys fine though) How hard is it going from Java to C++. Is it an OO language. And do you peoples have any good links.

 

Thanks

 

Joshua

Difficulty is dependent on what you mean by difficult.

 

For example, if you mean in the sense of syntax, it can be difficult because some of it can be confusing at first. However, if you learn it as your first programming language(in my experience I learned C# first so sometimes the syntax of C/C++ can be confusing because of how functions are used) then it should be easy to learn because you start in a large difficult range and then will have an easier time learning other languages. Otherwise, it shouldn't be too hard. It just takes practice.

 

The other way difficulty can be interpreted is in the sense of accessibility. For example, Visual BASIC may be harder for developers who want to have more access to the code of the project because they want to add certain things that BASIC may not be the best language for. If this is the difficulty being referred to, then C++ isn't hard because it has a lot of accessibility. For one thing, it is efficient with processing which allows programmers to develop high-end programs(as if you were to use C# for larger projects then it becomes slow and less efficient than other languages out there).

 

As a whole, I think it is not difficult in proportion to its accessibility and features. It may just take some practice to get used to.

Posted

Normal people use C++ only to interface with Windows, and program their application nearly in C. For that, you need to know very little of C++. Then, you can cheat an awful lot, and the complexity of C++ keeps manageable.

 

If one really wants to know C++ completely, it's really big, and not so useful.

 

The intermediate version, for someone who needs some features of C++, is to neglect learning the others, and keep a simple reference at hand for what he really needs. Similar to the operator precedence of C, for which programmers know it's in page 48 of Kernighan and Ritchie, you may know where the rules of name visibility are listed, or the precedence of homonym functions, or the type conversions.

Posted

Normal people use C++ only to interface with Windows, and program their application nearly in C.

 

I don't know what you mean by "normal people" but that is absolutely not true. For the last 20+ years most of the projects I have been involved in have been almost exclusively programmed entirely in C++. Few of them have had anything to do with Windows, but I doubt that makes any difference.

Posted (edited)

Thanks for helping me can u tell me the program for the bottle of beer on the wall song in C++

I assume you mean the code required to make the program.

 

#include <iostream>

int main()

{

std::cout << "the bottle of beer on the wall";

}

That is basically printing out a string, if that is what you wanted.

Edited by Unity+
Posted

Learn C first.

C++ and Java are not too similar.Learn C first. Do some crazy shit with it before you go anywhere else. Learn about C++'s polymorphism and template features to satisfy your curiousity -- then turn away, run as fast as you can and never look back.

Posted

Learn C first.

C++ and Java are not too similar. Learn C first. Do some crazy shit with it before you go anywhere else. Learn about C++'s polymorphism and template features to satisfy your curiousity -- then turn away, run as fast as you can and never look back.

The only difference(not accurately, but anyways) between C and C++ is C++ is more object-oriented.

 

Also, C++ and Java are similar.

 

 

 

The language derives much of its syntax from C and C++, but it has fewer low-level facilities than either of them.

 

http://en.wikipedia.org/wiki/Java_(programming_language)

Posted (edited)

No its not OOP, though with enough work you could make it OOP in theory. Its just a programming paradigm that all come from some fundamental logical architecture.

 

C++ is a very efficient language, There no "easy" language really, certain concepts require alot of time to understand. Python is a nice starting point for programming because alot of the lower level stuff is done for you. I personally enjoy using pointers and memory management though, gives you more insight into how computer really work.

 

Im currently using java and c and thats mostly what we did in university computer science, though we also did SQL, PHP, JS and Scala. Didnt touch C++, c#, .net etc at uni, they gave us the more "open source" route i think.

 

C++ is a good starting point, learning the syntax and how to problem solve is the first step to programming.

 

 

Heres a few things we covered at uni....

 

DRY principle

SOLID principle

MVC architecture

 

Unit testing, Use case diagrams, Version control. OOP principles (polymorphism, constructors, getters/setters, abstract, instantiation etc)

 

In advanced software engineering we did re-factoring and design architecture.

 

The three key aspects of computer science are machine learning, design architecture and graphics i think.

 

Little side note, javascript is actually quite a simple language, it makes OOP principles fairly easy for you and jQuery is built from JS.

Edited by DevilSolution
Posted

No its not OOP, though with enough work you could make it OOP in theory. Its just a programming paradigm that all come from some fundamental logical architecture.

 

C++ is a very efficient language, There no "easy" language really, certain concepts require alot of time to understand. Python is a nice starting point for programming because alot of the lower level stuff is done for you. I personally enjoy using pointers and memory management though, gives you more insight into how computer really work.

 

Im currently using java and c and thats mostly what we did in university computer science, though we also did SQL, PHP, JS and Scala. Didnt touch C++, c#, .net etc at uni, they gave us the more "open source" route i think.

 

C++ is a good starting point, learning the syntax and how to problem solve is the first step to programming.

 

 

Heres a few things we covered at uni....

 

DRY principle

SOLID principle

MVC architecture

 

Unit testing, Use case diagrams, Version control. OOP principles (polymorphism, constructors, getters/setters, abstract, instantiation etc)

 

In advanced software engineering we did re-factoring and design architecture.

 

The three key aspects of computer science are machine learning, design architecture and graphics i think.

 

Little side note, javascript is actually quite a simple language, it makes OOP principles fairly easy for you and jQuery is built from JS.

Thank you for correcting me. I must have been thinking of another language then. happy.png

Posted

No its not OOP, though with enough work you could make it OOP in theory. Its just a programming paradigm that all come from some fundamental logical architecture.

 

C++ is a very efficient language, There no "easy" language really, certain concepts require alot of time to understand. Python is a nice starting point for programming because alot of the lower level stuff is done for you. I personally enjoy using pointers and memory management though, gives you more insight into how computer really work.

 

Im currently using java and c and thats mostly what we did in university computer science, though we also did SQL, PHP, JS and Scala. Didnt touch C++, c#, .net etc at uni, they gave us the more "open source" route i think.

 

C++ is a good starting point, learning the syntax and how to problem solve is the first step to programming.

 

 

Heres a few things we covered at uni....

 

DRY principle

SOLID principle

MVC architecture

 

Unit testing, Use case diagrams, Version control. OOP principles (polymorphism, constructors, getters/setters, abstract, instantiation etc)

 

In advanced software engineering we did re-factoring and design architecture.

 

The three key aspects of computer science are machine learning, design architecture and graphics i think.

 

Little side note, javascript is actually quite a simple language, it makes OOP principles fairly easy for you and jQuery is built from JS.

 

Unit testing must be important. My dad says that when he programs huge programs, unit tests are about 33% of his code.

 

Yes, that is why I am learning C++. I want to be as close to the processor as possible.smile.png

 

Javascript is a very dirty language that doesn't have a strict syntax. I know it is quite simple, because it is a scripting language. It was my second language I learned(I learned actionscript first, and I don't count html or xml), but the code can be really slow.

Learn C first.

C++ and Java are not too similar. Learn C first. Do some crazy shit with it before you go anywhere else. Learn about C++'s polymorphism and template features to satisfy your curiousity -- then turn away, run as fast as you can and never look back.

 

I don't understand. Why would I not want to learn C++. What I have done with it so far is awesome. Something that would take 20 lines of code in Java to make only takes maybe 7 lines of code in C++.

Posted

 

Unit testing must be important.

 

Absolutely. A good strategy is to start by writing the tests and then write the function to be tested. This is a good way to make sure that the specification (you do have a specification, right? mellow.png ) is complete and consistent. Or, in the (sadly more realistic) case that you don't have a spec, that you understand what you are trying to do.

  • 1 month later...
Posted

I agree with Ben Banana, learn C first. C has greatly influenced many other popular programming languages and it is nearly impossible to learn C++ without learning C first.

  • 3 weeks later...
Posted

I strongly disagree with the statement "Learn C first". And it's not because i am against C, or anything like that, but you actually gain a better understanding of modern programming by learning C++ over learning plain C. Yes, there is nothing that C++ does that you can't do in C via crazy, usually highly round-about way of doing things, but C++ will teach you modern programming without loosing track of the origins. After C++ Java will make some sense, C# will be cake, and any C-like language syntactically (PHP, JS) or any modern OO language (Ruby) will make sense a lot more quickly then if you learn C... Learning C++ is very possible without knowing C, but trying to understand modern programming paradigms is much more difficult if you learn C first; why do you need objects, why do you extend things, what is polymorphism, why would you use templates, what is a diamond problem, etc.

 

There is nothing wrong with learning C++, you can do cool things in any language, but you cant understand modern programming paradigms learning an a language that can not express them. Learning to program is learning how to think of things, not how to write things, while syntactically C++ differs from some even more modern languages, syntax can be easily looked up, not knowing how to approach a problem because you don't understand a particular language structure can't.

 

Another thought:

Because you are typically taught up (from functions to classes to datastructures to advanced classes to advanced structures to crazy stuff) when you have a problem that you would typically use a more complex structure than a language may support, you know other ways to solve the same problem (usually requiring more code), but if you dont know the higher level solution, you may end up always writing much more code for the solution...

  • 2 months later...
Posted (edited)

Wow. The moderators here are quite passionate.

&amp;nbsp;

 

Absolutely. A good strategy is to start by writing the tests and then write the function to be tested. This is a good way to make sure that the specification (you do have a specification, right? mellow.png ) is complete and consistent. Or, in the (sadly more realistic) case that you don't have a spec, that you understand what you are trying to do.

No. If you don't have the care for your program to not reflect your anxiety then unit testing is not absolutely imperative for developing software. There is no good fucking strategy. Most strategies are coool and interesting and clever and respectable. Specification? What the fuck?

I hate people who learn how to program from 'university.' Pretentious fucks

If you care about what you're doing passionately, advice is not necessary for you to complete your job.

Edited by Ben Banana
Posted

If you find the JS syntax difficult to follow, you probably won't enjoy the much more complicated C++ syntax, but all of those languages including Java have that same C-derived curly-bracket & semicolon syntax that you'll have to put time into grasping to learn any of them.

 

C++ has very high OOP capabilities.

 

If you want to be as close to the processor as you can be, then start writing assembly (x86 probably, for you) which is what the C/C++ is actually compiled into. Don't really do that, but I think you might be interested in looking into/playing around with assembly in concurrence with learning whatever language to understand how the processor is actually instructed and analyse or even optimize your own programs directly in asm.

Posted (edited)

Javascript syntax? I never knew it had syntax. I thought it was loafpinch named after another loafpinch which was marketed to impress those who were interested in yet another (pseudo) loafpinch which was created to impress those who used a somewhat decent programming language.


If you want to be as close to the processor as you can be, then start writing assembly (x86 probably, for you) which is what the C/C++ is actually compiled into. Don't really do that

 

Why ?


Music!

Edited by Ben Banana
Posted

JS does follow a standard set by ECMA-262 specification and ISO/IEC 16262, that said, having read the spec, it is very strange in a lot of places. The original ECMA script spec literally stated that semicolons were not necessary to terminate the lines, but can be used as such, and that the actual point/use of the semicolon will be determined later... Tis a strange language

 

 

 

... start writing assembly (x86 probably, for you) which is what the C/C++ is actually compiled into.

Ok, i would not do my job if i did not pick on this statement, but a compiler actually does not generate assembly. C/C++ compiler parses the code into a parse tree, checks syntax and common mistakes, consistency, etc, in the process, fills in constants, drops code in paths that can not be reached, runs one or a number of optimization cycles (some optimizations can be done in parallel, others have to be done serially), converts the parse tree into opcode for the linker, and passes the code over to the linker (usually there is an optimization cycle here too), which will eventually call the assembler which will convert the opcode into assembly, and then also usually run an optimization cycle.

Posted

JS does follow a standard set by ECMA-262 specification and ISO/IEC 16262, that said, having read the spec, it is very strange in a lot of places. The original ECMA script spec literally stated that semicolons were not necessary to terminate the lines, but can be used as such, and that the actual point/use of the semicolon will be determined later... Tis a strange language

 

 

 

Ok, i would not do my job if i did not pick on this statement, but a compiler actually does not generate assembly. C/C++ compiler parses the code into a parse tree, checks syntax and common mistakes, consistency, etc, in the process, fills in constants, drops code in paths that can not be reached, runs one or a number of optimization cycles (some optimizations can be done in parallel, others have to be done serially), converts the parse tree into opcode for the linker, and passes the code over to the linker (usually there is an optimization cycle here too), which will eventually call the assembler which will convert the opcode into assembly, and then also usually run an optimization cycle.

 

The process of compilation is generally considered to encapsulate assembly, while it also involves preprocessing, linking, as well as another more specific process of compiling that generates the object code, and I'm also pretty sure that the GCC package contains an assembler too. Anyway, that's besides the point; the intention was to refer to a language through which he could interact with the computer at a lower level, rather than describe the compiling process, which, unless you're suggesting that writing binary object files and manually linking is a good low-level alternative to assembly, is not very relevant to the conversation.

  • 2 weeks later...
Posted (edited)

Just a quick question, before I jump into helping Rajnish Kaushik with his C++. How hard is C++. Is it to the point, or is it crazily stupid and has horrible syntax like JavaScript does.(I strongly dislike JavaScript, JQuerys fine though) How hard is it going from Java to C++. Is it an OO language. And do you peoples have any good links.

 

Thanks

 

Joshua

 

Actually, going from Java to C++ will not be difficult language features wise, but you might miss the libraries available for Java. While C++ does have some quirks (String^ and std::cout anyone?), it is an OO language in the sense that it allows classes to be use. Unlike Python or Ruby though, everything is not an object in C++.

 

About C++ being hard, you've already learnt Java threads and stuff, right? So you'll get along just fine. Though you may need to wrap your head around how pointers and memory management work (I believe C++ now has GC), and understand what are abstractions in Java, and what is the possibly low level equivalent in C++.

 

Though about JS, it's not about the syntax, it's that when you go from a consistent language (like Python) into JS, you'll mainly go mad because of the implicit magic. I went from C++ into Python and back into Java and found it okay, I guess, though I may only use Java now for Android, and C# or D(this one in particular works to solve C++ inconsistencies) is a better option for compiled languages, I guess , while Python is just so beautiful that looking at Ruby even gives me a headache.

Edited by Mellinia

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.