Member Avatar for napninjanx

I have been reading this eBook called C Programming for the Absolute Beginner, Second Edition.

I'm starting to get the hang of the logic at the moment

Something just struck my mind.

If a person wanted to build a program for photo editing. Kept It simple and basic only for cropping, lighting, and filters of all colors.

If a person wanted to build a photo editing program

Would the person write the code like this I won't use any punctions in the code at the moment since I am new and learning the ropes.

A person would write

"Okay Mr program you will crop photos once the mouse Is seletected and highlighted"
"You will have all sorts of colors from red, blue, orange, green, black, maple wood"
"Your lighting will be all sparks and flame lights, fire lights, dangerous sparks for lighting"

Would this be a way to write this kinda of program? I'm just making up the sentence as fictitious.
Or would it need more work?

C Is all about writing text and thinking logically. If I not mistaken correct me If I am.

Recommended Answers

All 4 Replies

The text is the code. Logic is how you apply algorithms (patterns for processing data) to data. This latter part is the difficult part. Image processing is VERY difficult. There are a gazillion factors to take into account, such as pixel depth (number of bits per pixel), size of image (x pixels vs. y pixels), shading, rendering, ray-tracing (if you are doing synthetic image generation), etc. My advice (after 30+ years doing this stuff) is to study well-written tools that do this. There are a plethora of tools in the FOSS (Free and Open Source Software) domain that do it. One great example is GNU's Gimp package. Study that. Understand that. And you may be ready to start writing some of this stuff on your own.

Well, for a design document, I suppose it's a start. You would need a lot more detail, however, even before you could consider writing any actual code.

If your actual goal is to write a photo editing program, well, that's about as complex as any project you could have chosen. I think I personally would tackle just about anything else first before trying something that difficult... and I do systems programming as a hobby.

BTW, despite this book's title and the opinions of far too many 'educators', neither C nor C++ make a good language for beginners; they are both designed for experienced, professional coders, especially C, and they both are far too difficult for most newcomers. I would recommend a language like Python or Ruby as a better place to start, though that is a personal opinion and completely subjective (actually, I would really recommend Scheme, but there you're getting a bit too outré for most people).

Member Avatar for napninjanx

@Schol-R-LEA I see I should stick with Python then :D lol no wonder C was complex for me now.
I don't know why people say C Is easy to deal with and every beginer starts with C, guess every beginer should start with python.

There really isn't any one language which all beginners start with, and no language appeals to everyone; the real issue is that a lot of universities start people off with C (or worse, C++), despite it being poorly suited for most beginners.

As for complexity, C is actually a rather simple language, compared to Python. This is not the same as saying it is an easy language by any stretch of the imagination. C is simple in the same way chess is simple: it has relatively few rules and very few exceptions to those. It still takes years to master either of them, and starting of with them before any others is, for most people, an exercise in frustration.

(To follow the analogy, Scheme and the other Lisp languages are like go: there are hardly any rules to the game at all, and learning how to play takes just a few hours, but mastery is a lifetime's work. Conversely, C++, Java and Perl are like Brockian Ultra Cricket or Dragon Poker - mountains of rules and variations thereof, more than any one person could ever really learn. But that's still better than C# and VB.Net, which are like TEGWAR - the rules seem to slip and slide around at random and no one will tell you all of them, and eventually you end up under the table with a massive headache.)

Python is more like, say, your typical video game. It has a lot of complex aspects to it, but it also hides a lot of that complexity from you by doing most of the really troublesome things for you. A video game player doesn't have to worry about the refresh rate of the monitor, or the details of how sprites are moved around the screen; they can focus on playing the game. Likewise, Python programmers don't need to worry much about the mechanisms of memory management or list implementation. Python lets you focus on the programming rather than getting bogged down in details which aren't really important to a new programmer.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.