How to develop small software or application? [closed] - c++

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Hya Gurus,
I've been learning c++ for 8 - 10 months and want to develop a software or small applications (i am self taught using some books) so just consider me as C++ entry level programmer.since i don't know win32 etc for GUI development i can use some library.
I know most of c++ features , data structs , algos and have read some c++ book and scott meyer's effective c++.
but problem is that i am unable integrate all my knowledge to build a software and i think i am a adhoc coder. when i see even small simulation or little application codes i understand the code sometimes (sometimes not since understanding them is hard by just seeing code) but i find even code of page 4 - 7 so large that i think i can't develop applications.
for e.g : if i want to develop my own chm reader or FTP or any appz or softw you consider serious coding, how do i develop it? then i find myself completely lost by just start typing code i know won't ever be able to develop it. (i feel 0% confident)
so what i want to know how programmers like you guyz learn to develop serious application when after drilling their teeths in c++ only, do i need some other books to learn how to develop software? or what is the process to become serious application developer ?
Any help is very appreciated.
P.S (Impotant) : i'd love if you could tell me how you became serious developer after learning C++ , what you had done etc pleaseeeeeeeeee. and any personal advices to me .
Edit:
I don't know UML or Soft Engineering , do i need to learn them?
Thanks a lot again ))

Programming large applications is a long and arduous process. Even with medium sized software.
Even the veterans need time to read new code. I remember just recently starting work on an existing software project that had around 150 classes. It took a while just to figure out how the basic input was handled, let alone the whole structure.
What you need to focus on is increase your confidence in building software.
Try creating something trivial, something you know you can program. Try to make it a bit bigger by adding some features, not much though, and keep doing that. Over time you will be a bit more confident in big code.
Programming takes practice and you need to keep at it. It might sound like a daunting undertaking but real confidence in a language takes years of practicing.
Look at the questions here about good software books as well.

I would suggest that you read up on the usenet groups on c and the books by Scott Meyers and Andrei Alexandrescu. Whey don't you try to find out what the Loki lib can do.
Also a good place to start is looking at the boost libs.
Find some small project that you like and see what you can learn, it is an iterative process.
You can also join an open source project.
Good luck,
Lars
you must have perform practicals every day and start with small application then watch project code i hope by performing practical you will easy to understand any code.

Related

Beginner game-development in C++ and lua [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am a total Beginner in C++ and programming generaly.
I have watched a couple of hours tutorals of C++ and read alot about it (Could you recommend some tutorials?), but what I´ve come across and couldn´t understand was Librarys.
I want to develop games in C++ (I think, it seems most interesting atm).
I can understand that I need a library for game programming in C++, but I don't know much about what a library is specifically, and where to find these librarys.
Also, I´ve read that Lua should be good to script the games with. I would like to know if this is true?
If its true, I would like to know where to find tutorials for Lua?
If not true, what is good then?
Thank you for your time.
This is my first question here.
I apologise if it wasn´t a proper question for this website, or if the english was bad.
I still hope you can give me some kind of answer and/or response.
You may want to try out Löve2d, a framework across Windows, Linux, and MacOS X for writing games in Lua. It bundles various game libraries for sound, graphics, physics etc so that you don't need to deal with that directly, and it lets you focus on the writing of games.
A good library to get started with game programming is SDL. http://lazyfoo.net/SDL_tutorials has some great tutorials to help you get started (the most comprehensive and easy to understand that I've found), but you need to understand program structure and such to get some practical use out of the tutorials.
OpenGL is pretty standard for 3D game programming, but it's more advanced than SDL. I'd recommend making sure you understand at least basic C++ before you move on to game programming... http://cplusplus.com/doc/tutorial would be a good place to start.
Here you can get very good and complete video tutorial of cs Indian institute of technology
I'm sure someone will come along and post an essay answering your questions in more detail, but here are the short answers.
A library is nothing more than a reusable collection of code. People write code and package it up for other people to use in their own projects. Libraries you would need for games include libraries that handle graphics, audio, networking, font/image loaders, etc.
Lua is great to script games with. It integrates very nicely with C/C++. Visit Lua's home site for tutorials.
Check this link out http://cplusplus.com/doc/tutorial/ for libraries here is the STL http://cplusplus.com/reference/.
Here is a reference on Lua, http://lua.gts-stolberg.de/en/index.php?uml=1.
can understand that much that I need a library for game programmig in C++, but I dont know much about, what A library is specificly, and where to find these librarys.
#TheBuzzSaw already answers what a library is, so I'll answer where to find. But wait, before WHERE, you have to know WHAT library to use. There are a lot of game libraries out there, both low level (loosely coupled between components) and high level (tightly coupled). The low level ones have separate functionality for graphics, sound, AI, etc. processing and usually each functionality can be used for things other than games. While the high level ones "glue" them together to form something that's ready to use as a whole (for instance, it provides scene class with events, music, etc. you just have to set some values to use). Due to the many number of then, I can't really say where to find before you know which one to use. One quite complete one is SDL, it's a low level one. Allegro is another one.
Also, I´ve read that Lua should be good to script the games with. I would like to know if this is true? If its true, I would like to know where to find tutorials for Lua? If not true, what is good then?
Lua is good, and it's used a lot in games. Ruby is good, some games use it. Python is good as well. Basically, most scripting languages are good for game scripting. You just have to consider what language features your game required, how fast you want it to be usually contradict with its syntax flexibility, etc.

Hopping from a C++ to a Perl/Unix job [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I have been a C++ / Linux Developer till now and I am adept in this stack. Of late I have been getting opportunities that require Perl, Unix (with knowledge of C++,shell scripting) expertise. Organizations are showing interest even though I don't have much scripting experience to boast off. The role is more in a Support, maintenance project involving SQL as well. Off late I am in a fix whether to forgo these offers or not.
I don't know the dynamics of an IT organization and thus on one hand I fear that my C++ experience will be nullified and on the positive side I am getting to work on a new technology stack which will only add to my skill set.
I am sure, most of you at some point of time have encountered such dilemmas and would have taken some decision.
I want you to share your perspectives
on such a scenario where a person is
required to change his/her technology
stack when changing his/her job.
What are the merits and demerits in
going with either of the choices?
Also I know that C++ isn't going
anywhere in the near future. What
about perl? I have no clue as to what
the future holds for perl developer?
Whether there are enough
opportunities for a perl developer?
I am asking this question here because most of my fellow programmers face this career choice dilemma.
EDIT:
Since the last time I asked this question, I made up my mind to switch.
I was just about to sign on the dotted line but some divine intervention made me seek some clarification about the working hours, and to my horror, the profile required me to work in
shifts which I am never comfortable with. I was all the more livid because they didn't clarify this point earlier. It was a reputed organisation but still I gave them my piece of mind and said thank you very much.
Thanks.
Regarding changing of stack, it definitely helps you long term in your career, both from extra experience available to offer to next employer to expanded job set you can qualify for to increased programming IQ due to knowing different points of view (e.g. Perl, for all its scripting origins, when used properly, has both OO and very nice functional paradigms available, but this point applies to any new technology).
However, you must be willing to put extra effort in to actually learn new stack/environment/language, and to learn to do things new way (e.g. don't write C++ code in Perl :) - especially for that last benefit to kick in. Please note "environment" there - the jump involves for example learning new debuggers and debugging techniques (for me the hardest thing about C++ development after switching from Perl so far is probably doing effective gdb debugging after being used to flexibility/power of perl debugger).
Personally I had to make this jump twice - from C developer to Perl and 10 years later Perl to C++. I learned a lot both times, and am not sorry I made the jump. The first jump was from IT role (Junior SA/Production with some C coding) to a full-on developer, the second was just a jump between different business teams.
As for demerits, please be aware that you WILL lose your edge in whichever stack you're not currently using for a while. Not completely forget, but nowhere near where you left off - and that does not even count the fact that the stack may have naturally evolved in the time elapsed. Also, as I said, you MUST expect that to be effective, you have to put in a lot of effort to become fluent in idiomatics, philosophy and ecosystem of the new stack. E.g. simply learning Perl is a small piece of the puzzle - you need to become familiar with a large chunk of CPAN, just as you had to know STL etc... Not really a demerit as far as I'm concerned, but a point that needs to be kept in mind.
As for opportunities for Perl developer, this was extensively covered on SO before. While the absolute # of jobs is likely less than that of Java or C++ ones, a high quality developer will always be in demand, and there's plenty of companies (including, or may be especially, in financial industry) heavily using serious Perl development (as opposed to simple administrative scripting). The language itself is developing and moving forward as well.
This is a highly subjective question. Whether C++ is "going places" depends on where you look and who you ask. For instance, C++ is the development language for video games and graphics processing, and is also used a lot in device drivers in conjunction with C (usually I see a hybrid "C+-", where some features are used from C++ in conjunction with more C-style architecture).
I myself moved from a C/C++ environment into a mostly Perl one, with strong Unix all the while (I actually know next to no windows API programming, .NET, VB-Basic etc).
Basically what I would suggest is sticking with what you enjoy most. This may not be the same as what you currently know or are best at. There are opportunities in a diverse set of technologies. Don't also assume you should tie yourself to one environment -- dabble a little and have some fun. Many facets of programming are constant across languages and environments. Get good at problem solving, writing unit tests, refactoring and planning a project, and you'll do well no matter what set of technologies you're working with.
Why not use your C++ expertise when working with Perl (where appropriate)? It's quite possible to extend Perl with C and C++. I'm not suggesting that you write all your code in C++ just because you know it and than put a thin Perl layer on top, of course.
Being experienced in related technologies is a really big advantage, not a mis-qualification for a technical job. I would suggest you take the opportunity to learn a new technology. Going back from "experienced but rusty" to "on top of it" in your bread-and-butter discipline should be a piece of cake if you have to at a later point in time.

Why doesn’t WPF support C++.NET - the way WinForms does? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
As a C++ stickler, this has really been bugging me. I've always liked the idea of the "language-independant framework" that Microsoft came up with roughly a decade ago. Why have they dropped the ball on this idea? Does anyone know the reasoning behind it?
Part of the reason will be that C++ support is actually two languages in one -- the native and the CLI variants; that extra development load has been acknowledged by the Visual C++ team as the reason that proper MSBuild integration lagged (lags? I haven't checked in 2008 or later) behind other languages.
Another part will be to do with the code generation during compilation that goes on in a C# build to support e.g. the binding "magic"; I've found that even in F#, you don't get it "just happening".
If it were me my reasoning would be that C++.Net should not be used to write GUIs.
I'm not trying to be snarky here, maybe someone can show me the error of my ways but I don't think it's a good idea. I'm messing around with one right now and development much much slower than if the application had been written in C#. My feeling is if features in C++.Net or just regular C++ are required for the application it seems like a better idea would be to create a DLL to do the heavy lifting and could interface with C#.
It bugs me too, if they had supported it, we'd be able to migrate our C++ code to a new GUI much easier and cheaper than basically rewriting everything in C#. Its costing us a fortune to rework our apps, just what we wanted in a recession.
I imagine the reasoning is that C# is popular (and not as cross platform as C++) so they've decided to keep their development efforts to the minimum required.
You can do WPF with managed C++.
The reason is that nearly all new application programming is now done in JavaScript, Java, VB.NET or C# - all GC languages. The emphasis is on higher quality for a lower skill set and C++ demands too much from the developer, companies want people to write log bug code on their first day.
C++ for applications is mainly for maintenance of existing applications or where extreme performance is needed. Device drivers and OS are still frequently written in C++ but even that is changing (Coyotos is Cbit , E# , Cosmos/Mosa are C#, Singularity/Midori).

Well written C++ examples [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I'm currently learning C++ and would like to start reading others sourcecode to pick up tips. I was wondering if anyone has examples of well written C++ that I can take a look at (and not pick up bad habits from)
As you've probably discovered, there are many Internet sources for examples of C++ code. StackOverflow, CodeProject, etc. all have examples of source. But of course, they're all over the map in terms of quality and educational value.
I think, in this area, books still trump the Internet. There's no substitute for going to the bookstore, thumbing through a few tomes, and picking one that you find readable. They've been proof-read (unlike may Internet submissions), so the samples are more likely to work and to be of high-quality.
While the books typically have small snippets of code or a few functions, they usually come with a CD or URL that points you to more full-blown examples.
O'Reilly, Thinking in C++, Petzold, and Wrox (and more) all have good books on C++.
The Boost library? It is generally considered some of the highest quality C++ code written. (A lot of it is also more or less unreadable unless you're a C++ guru yourself, though)
In general, I'd advise against you to be cautious with this approach though. In C++, the source code probably won't be as informative as in many other languages.
If you see some Python code, you can pretty much assume it's correct as long as it runs. If it's written by someone who seems to know what they're doing, you can even assume that it's well written.
In C++, there are just so many nasty pitfalls and subtle exceptions to every rule that you really need to know what you're doing. Going by what compiles, or what seems to work, or what you saw in someone else's source code is dangerous, and pretty much guarantees that you'll sooner or later end up with a program that relies on undefined behavior, and will crash when you least expect it.
If I were you, I'd try to stick to books. There are some very well written ones, which in addition to letting you see some source code, also teach you the langage "properly". And as long as you stick to reputable authors, you're ensured that they won't teach you any bad habits or plunge you into nonportable code.
In my opinion if you read a good C++ book (like "The C++ Programming Language", "(More) Effective C++" or "Exceptional C++").
You will not only learn good practices but should also get sense of how to write code.
Of course the samples in these Books are mostly artifical. If you read 'real-world-applications' you will always encounter pieces of code which are pretty ugly, but sometimes there wasn't just a nice clean solution for it (or a not-so-clean solution was just more efficient in terms of speed).
So I don't know if it's best to start with real applications since they can also be very overwhelming due to the amount of codesize and complexity, whereas sample codes in Books are compact and clearly laid-out.
I think for starters you would be best off reading such references as the books I have listed.
If you have to be flexible at some point in the future and have to produce ugly code, you will at least know that it's ugly code and not mistake it for "that's how it should be" ;)
Reading through open source software can be very educational if you already have a little bit of knowledge of C++. If you're just starting out, I imagine the Boost libraries will go right over your head. You could start with the WebKit project, which is an excellent resource. Also Google releases a lot of their source code, which also happens to be VERY clean: Protocol Buffers is a great example. And while you're at it, you may as well read their C++ Style Guide as well.
Personally, I started learning C++ by picking up a couple of books and writing some little challenge applications. Bear in mind that learning a language as extensive as C++ takes a long time, like 10 years long.
Many years ago, I was told that if I ever wanted a career as a C++ developer, I should definitely read Effective C++ by Scott Meyers. That should prevent you from falling into many of the language's pitfalls. If you find you need something even simpler, start with The C Programming Language by Kernighan & Ritchie. Be patient and good luck!
If you want a complete project to browse through, I would recommend Ogre3d. It is a well structured graphics engine with decent documentation and the source code itself is nice, too.
How about: Programming: Principles and Practice Using C++ by Bjarne Stroustrup?

Suggestions of excellent examples of real C/C++ code [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
I'd like to study some good C/C++ code. The code should:
be good in style and structure, presenting best practices
be a real life program (not an example or toy)
not too big so it doesn't takes ages to analyse it
Windows and/or Unix
I know there are 1000s of open source projects out there. But I'd like to hear your suggestions.
I am Java programmer and I am curious how good project in c/c++ is structured (files), granularity of classes/functions/files, documentation/comments, build tools etc.
Multiple suggestions are welcomed e.g. this is good windows example, that is good pure C etc.
I would specifically mention memcached. It's a great example of fairly short, readable code with a clear purpose.
Second, I would recommend the Apache web server. It's a fantastically well-run open source project that you'll learn a lot from, both about the language, as well as general design practices and networking/threading.
I'd vote for nginx: http://sysoev.ru/en/ as an example of a very good C programming style
Samba: a large, cross-platform (POSIX-based), pure C, very popular network server.
Samba has good developer documentation, and the code base itself is very well organized; I've had no problems diving into just about any location within the code to answer a question I had about its inner workings or to track down a bug.
I find the implementation of Lua is quite nice C source. But languages are a bit odd as an example project.
Diomidis Spinellis has some suggestions in his book, "Code Reading: The Open Source Perspective", Addison Wesley, 2003. ISBN 0-201-79940-5.
Perhaps the book could be useful to you.
URL http://www.spinellis.gr/codereading/
Google's Chromium is pretty huge, but you don't have to analyze it all to appreciate its clean, peer-reviewed structure.
Also, it's a good example of nicely done developer environment deployment.
Here's the main file for relayd, which is a daemon that handles load balancing and failover. It's nicely written, full featured, clean C code. It's big enough that you get a feel for a "real world" program, but not so big that you can't get your head around it with some work. Great for secure, well written networking code, daemons, etc.
Modesty aside, there's also a little tiling window manager for X that I've helped with. It's quite small but it's a real wm, and the other coders on it have high standards (and hold me to them!)... Nice for learning basic X stuff.
K&R has many good examples of real programs. For instance, on page 115 of the Second Edition there are two simple implementations of the echo command. From there, it might be interesting to see how the command was implemented over time. For instance, there is a version in the GNU coreutils source. A version derived from BSD can be found in BusyBox source.
It might be interesting to see how the newer versions compare to the textbook examples. Why are the programs that are used in real life longer? How much of the code is related to new features and how much is related to dealing with edge cases? How would you write the same code in Java?
As for C++ I would recommend you the Qt library sources and KDE's source code and its programs.
It's beautifully written code and the way that you should program in C++.
More C++ suggestions in: Examples of “modern c++” in action?