Personal computing discussed
Moderators: renee, SecretSquirrel, just brew it!
just brew it! wrote:I wouldn't say learning C is "unrewarding", but it's definitely more of a delayed gratification sort of thing, in that it'll probably take a lot longer before you'll be able to write programs that do something "interesting". I'd say the rewards (in terms of knowledge/skills) are arguably greater, but that doesn't help if it ends up being so difficult that you give up somewhere along the way.
Recall that I also originally recommended Python to start with.
Let's keep at the C for now since you seem to be highly motivated to learn it, but if it becomes too frustrating, perhaps shift over to Python instead, and come back to C later.
whm1974 wrote:For some reason I'm going too fast to remember what I'm reading and finding myself having to go back and read the material over again. Is this normal and happens to everyone that is trying learn C or other programming languages?
Buub wrote:For what it's worth, I would not approach C++ as a superset of C, though it is capable of being used that way, or you will write very poor modern C++ code.
Consider C++ a separate language with different paradigms. Writing good C++ code is very different from writing good C code, and requires a different mindset.
Vhalidictes wrote:whm1974 wrote:For some reason I'm going too fast to remember what I'm reading and finding myself having to go back and read the material over again. Is this normal and happens to everyone that is trying learn C or other programming languages?
Take notes on what you're reading.
This will 1) slow reading speed down a bit, and 2) help you internalize knowledge, especially if you haven't applied it yet.
I never need to refer back to my notes (although I try to keep them in good shape just in case), because the act of writing them helps me remember things.
whm1974 wrote:Unfortunately I've always been a poor note taker. Maybe I should simply add more documentation to any code I'm typing in so I can always go back review the code?
just brew it! wrote:whm1974 wrote:Unfortunately I've always been a poor note taker. Maybe I should simply add more documentation to any code I'm typing in so I can always go back review the code?
Comments aren't just for other people who read your code, they're also supposed to help you remember what you did! So yes, definitely do that if you are having trouble remembering.
whm1974 wrote:just brew it! wrote:whm1974 wrote:Unfortunately I've always been a poor note taker. Maybe I should simply add more documentation to any code I'm typing in so I can always go back review the code?
Comments aren't just for other people who read your code, they're also supposed to help you remember what you did! So yes, definitely do that if you are having trouble remembering.
Perhaps I should take a brief detour and look up how to do proper note taking?
just brew it! wrote:whm1974 wrote:just brew it! wrote:Comments aren't just for other people who read your code, they're also supposed to help you remember what you did! So yes, definitely do that if you are having trouble remembering.
Perhaps I should take a brief detour and look up how to do proper note taking?
If you plan to take classes IRL.
For learning to code using eBooks and web sites, it is probably less useful. Annotating the code you write is probably more effective. When you need to remember how a particular language feature works, go back to the last program where you used it, and re-read the code & comments (or even use the previous program as a template for the new one if the problem you're solving is similar enough). In effect, you're building up your own library of code examples.
An aside --
I was terrible at note-taking when I was in high school and college. Even when I did take notes, they were often so illegible I couldn't read them afterwards. Fortunately, back then my memory was sharp enough that I managed to do OK in spite of a near-complete lack of decent notes.
Today my memory isn't what it used to be, so I take my laptop to meetings and type stuff I know I'll need to remember into a text document. All the projects I'm currently working on also have an associated text file where I track design and implementation ideas, testing/debugging progress, etc... kind of like a virtual lab notebook. Doing things this way has the added benefit of ensuring that all of my notes are legible!
DancinJack wrote:WHM, come on now. You're trying to find an application to take notes because you can't remember everything you're doing, and to document the work you do. I don't think picking an application that requires you to read the manual before you start taking notes is the right choice.
srg86 wrote:As much as I like C for its simplicity, I wouldn't exactly call C a great beginners language either.
The closest it had to a language was AREXX. So my first real programming experience was with compilers but I can see the appeal of using an interpreted language for teaching programming. You can get an instant gratification of write and run, rather than write, compile, run.
It's not so much instant gratification as it's easy to to do really complicated stuff quickly since the minor details are automagically taken care of.That said, since dabbling in Python, it seems a little overrated to me. Its not bad by any means, and the whole dictionary idea sounds cool. But I do find the whole "Code block through indentation" thing really hard to read. Plus classes not seeming to have proper data hiding seems odd. That said I've only dabbled. Is there something better than Python for teaching programming (and not BASIC ack!) or due to its ubiquity, is it still the best?
FlamingSpaceJunk wrote:What are you trying to do with Python? It's not particularly good at interfacing with the system, but aside from that Python is pretty good.
FlamingSpaceJunk wrote:What are you trying to do with Python? It's not particularly good at interfacing with the system, but aside from that Python is pretty good.
if (something)
{
something.
}
if (something) {
something.
}
srg86 wrote:FlamingSpaceJunk wrote:What are you trying to do with Python? It's not particularly good at interfacing with the system, but aside from that Python is pretty good.
I was actually trying to manipulate ELF executables in something I could run as part of a buld process, so a good time to use a script, which I was able to do quite successfully.
Though a good text editor does help, and I think PyCharm is the best for Python work, it doesn't matter what type of code it is, I've never found the indenting method as easy to read as {} or Begin/End blocks, but that's just a personal preference. In C/C++ I also find:Code: Select allif (something)
{
something.
}
much easier to read than:Code: Select allif (something) {
something.
}
if (something) {
/* something */
} else {
/* something else */
}
just brew it! wrote:srg86 wrote:FlamingSpaceJunk wrote:What are you trying to do with Python? It's not particularly good at interfacing with the system, but aside from that Python is pretty good.
I was actually trying to manipulate ELF executables in something I could run as part of a buld process, so a good time to use a script, which I was able to do quite successfully.
Though a good text editor does help, and I think PyCharm is the best for Python work, it doesn't matter what type of code it is, I've never found the indenting method as easy to read as {} or Begin/End blocks, but that's just a personal preference. In C/C++ I also find:Code: Select allif (something)
{
something.
}
much easier to read than:Code: Select allif (something) {
something.
}
I prefer the second form, but use the first one for function definitions, go figure.
As long as indentation is used sensibly, I don't find either form particularly more readable than the other per se. But the second form saves vertical space, making it more likely that a given function definition will fit within a reasonably sized editor window (which does improve readability).
My default coding style for if/else is:Code: Select allif (something) {
/* something */
} else {
/* something else */
}
I guess this is also why I'm not too bent (it only bothers me a little...) about Python's explicit use of indentation to indicate control flow. You should be indenting things sensibly anyway!
just brew it! wrote:At the end of the day, if you're writing code in a professional setting you're going to want to conform to whatever style the rest of the team uses. (Assuming they actually have official coding standards. And that people tend to follow them. )
There's nothing more annoying than having one maverick developer who does things "my way". Years ago I worked at a place where one of the C developers was a former COBOL programmer. Insisted on #defining all of the C operators to their COBOL equivalents, and using those instead in any modules he wrote. This eventually resulted in a meeting where he was told very bluntly to cut that sh*t out.
if something then
begin
something;
something
end;
just brew it! wrote:My default coding style for if/else is:Code: Select allif (something) {
/* something */
} else {
/* something else */
}
I guess this is also why I'm not too bent (it only bothers me a little...) about Python's explicit use of indentation to indicate control flow. You should be indenting things sensibly anyway!
whm1974 wrote:Oh yes I really do want to learn C, but if I can learn how to do a bunch of other things along the way, well then that will be great as well.
Redocbew wrote:whm1974 wrote:Oh yes I really do want to learn C, but if I can learn how to do a bunch of other things along the way, well then that will be great as well.
One project at a time dude. Otherwise you'll be one of those people who has 8 different projects going all at varying levels of being unfinished. There's nothing really wrong with that in its self, unless you want to get to a point where you feel like you've finished something.