Yeah so I've taken a few c++ classes at college, up to data structures. But just because I know how to write a bs-tree doesn't mean im an EXPERT PROGRAMMER just yet. The most complicated program I've written so far is one that solves the Towers of Hanoi by brute force. I still consider myself a beginner-level programmer.
Does anyone have any tips on how to improve my skill? Like a large one-man project that will teach me how to write & manage larger programs? Whenever I got the book store and look at the programming sections everything is either TEACH YOURSELF JAVA IN 24 HOURS or like START C++ FOR THE MENTALLY RETARDED. Everything is aimed at beginners but I want to move on.
protips?
Name:
Anonymous2007-04-27 12:05 ID:LRJ3rG5H
>>1
write a tower of hanoi solver in 4 lines of code and you are no longer a beginner.
(protip: use lisp)
Name:
Anonymous2007-04-27 12:06 ID:+K6aiPIn
1. Stop using C++
2. Forget everything you think you knew about programming
3. Read SICP
4. Learn Haskell
5. Learn C
In that order? Impossible. Your brain would not cooperate after you had seen the magnificence of Haskell.
Name:
Anonymous2007-04-27 13:13 ID:LRJ3rG5H
1. Stop using C++
2. Forget everything you think you knew about programming
3. Hit your head against a brick wall
4. Sniff lots glue
5. Take lots of class A drugs/chemicals
6. Take LCD one day
7. Learn lisp
Name:
Anonymous2007-04-27 13:22 ID:+K6aiPIn
>>4
You would then perfectly know when not to use C.
Name:
Anonymous2007-04-27 13:34 ID:2Iul6txa
>>1
Read about pointers, memory management and read about exploitation of the C code.
Then go low level and learn some ASM, then learn some libraries and there you go, you are no longer a beginner
Oh, and read Stroustrups book, or K&R.
Name:
Anonymous2007-04-27 13:36 ID:ZRlJk9QF
The best way to stop being a beginner is to write software.
Name:
Anonymous2007-04-27 13:37 ID:7crOpEWf
>>Read about pointers, memory management and weep
fixed
Name:
Anonymous2007-04-27 13:40 ID:iCi5cjHH
Are you trying to become a programmer professionally or you do want to learn programming for something personal? If its the latter you probably have an idea of what you'd like to use programing for (like making games, or making apps, or using it for math/science...). Whatever it is you should try to gradually work towards that goal. A very easy and important thing you could be doing right now is to keep amassing general knowledge about your language, e.g.:
-read everything in your programming textbook that you didn't cover
-search online for references, tutorials, FAQs and lists of 'gotchas'
-find more advanced books about your language
>> 10 amassing general knowledge about your language
`YOUR LANGUAGE'? You sick fucks, do you seriously just decide that C++ is `your language' and stay with it against all odds?
>>2
We wrote it recursively first, then did it the hard way to learn about and test stacks/queues/lists.
>>10
It is indeed my goal to one day be a professional programmer. Yes I have been reading up on my book and a few things on the net, but what I have a problem with is implementing my knowledge. In class the teacher gives us a problem that is designed to demonstrate something we learned but i've taken all the programming classes and still don't feel like I could write a real application because so far all i've written is tiny driver programs to show that i correctly wrote a tree and things like that.
really what im looking for is an intermediate-level project that will allow me to use what i know in a meaningful way. I feel that the vast majority of resources out there are for people who are new to programming and I feel like they no longer apply to me.
I used C++ as an example in my post because I have used that most recently but I have also been tought perl and PHP with MySQL.
Name:
Anonymous2007-04-27 17:03 ID:vAS5q9Z7
My goal is to be a MASTER PROGRAMMER that doesn't even have to write code , just thinking of it makes it work.
Try doing something like writing a relatively simple game or application. Come up with the idea of your mid-level project (make it something you want to do) and we can pitch in if you don't know how to start or what tools you'll need.
Name:
Anonymous2007-04-27 21:59 ID:hlouyuQ9
>>15 we can pitch in
You think /prog/ will actually give him helpful feedback?
Design a little language, and make a bytecode interpreter and a debugger for it. It's more interesting and requires more planning than something like, I dunno, a text editor or a one-screen game.
Name:
Anonymous2007-05-05 14:07 ID:cD7H/wOH
The only way to become an expert programmer is to kill an expert programmer, or be born as one.
>>34
Killing an EXPERT PROGRAMMER? I would advise against that; killing EXPERT PROGRAMMERs only pisses them off more, and when struck down they will become more powerful than you could possibly imagine.
Name:
Anonymous2007-05-06 18:19 ID:3nVRcIU3
>>1
What do you do for a living? I work in IT as a PC technician and find that the best way to improve is to write small applications for things I do repeatedly. Unfortunately they're mostly in HTML with sprinkles of Javascript, or pure Java, or small and mostly edited VBS from the web.
Till I saw your MYSQL comment, I would have suggested (for C++ improvement) at most to look at other open source code, like that of a NES emulator, picking the smallest one for simplicity. Specially if it's built by a single person.
The issue becomes "switch from DOS C++ into real world C++ with QT, MFC or whatever, so that you can get hired?" That is hard to answer. I myself am trying to learn the win32 API, but it really sucks. That would be too advanced. Instead, try to work on customizing small online C++ utilities with things you need. You'll see that most stuff has dependencies on MFC or VCL. You'll then go back to C++ and just try and work with the standard template library, which IS worth your while (learn the basic syntax and using Vectors and Lists... coders don't even use their sorting and hashing much in their code)
More importantly, try and revisit C++ assignments or help people a bit, by implementing their homework on your own after you give them ideas. In PHP you can play with by installing a MYSQL server and making a little database of work issues you're working on, or your own bookshelf inventory. The bookshelf inventory is a good idea for C++ code too, but you just have to teach yourself strings --nightmare... YOU MUST LEARN the <cstring> stuff and how to stay away from buggy char* code.
Sorry not to be too helpful, because you'll have to make the leap into QT or something intermediate that uses C++ and hides the pain from you.
Real men put Tabasco Sauce on everything. My brother, and some of my friends are Tabasco hating wimps (these are the same jerks that don't like onions with their food... I know, I'm not proud of it). Anyway, for those of you that don't know (because you're communists), Tabasco Sauce is a hot sauce made of red capsicum peppers, salt and vinegar.
The peppers are crushed, put in jars with vinegar and salt for a month or so, and then stirred for about another month or so. The result? A kickass sauce to put on anything. Here is what I suggest putting Tabasco sauce on:
# Everything
Tabasco sauce goes best with everything, and plenty of it. If you happen to be sharing a meal with a Tabasco hating pussy, be sure to load it up with Tabasco and onions (they hate that). You have to be real stern with these type of people. You have to act real tough and manly around them so they feel intimidated, and it helps you feel better about yourself. If they start to bitch and moan about you being "too mean", tell them you're insecure about yourself, and that making fun of others makes you feel better. Then when they're feeling sympathy for you, strike again! Suckers.
Name:
Anonymous2007-05-06 20:36 ID:3nVRcIU3
>>37
*sigh*
Segmentation faults and and garbage at the end of poorly allocated char* C-strings. Adding strings to other strings, which is as old as 1960's BASIC itself, is one of the most unmanageable chores for any beginner programmer faces in C/C++.
Schools don't teach you the pitfalls of char arrays, and I'm just trying to help a guy out, so they won't waste as much time chasing crashes and bugs
Name:
Anonymous2007-05-06 21:02 ID:3nVRcIU3
>>39
Speaking of which, here's a neat way of adding ints to strings and strings to strings, though you better know in advance and allocate enough char array size. With char strings, you waste useful room and time calculating and recreating strings. If you then create or use a class, you still must convert to char arrays or the native C function calls won't accept your code.
#include <stdio.h>
int main()
{
int i = 8;
char buffer[300] = {0};
sprintf(buffer, "%s, %d", "String placed in percent s, 'i' placed in percent d", i);
printf("%s", buffer);
}
>>1
If you wish to learn more about PHP, there are video tutorials here... watch a couple per day, and he'll tell you of a few tools and examples. Again, good luck
Libraries are built from the ground up on C strings, so even if you work with the C++ string construct, you have to convert them back. Receive input from the user? It's in an array. C++ is polymorphic, but the standard library has not a shred of effort into returning C++ strings based on context. So it's a kludge that could only be "forgotten" by creating new languages like Python and Java, altogether.
The reason I bothered to put the code example is to show how to build up a string, but you end up having to combine C++ and C strings. In some extreme cases you need to use stringbuffer constructs, to pass data around. You'll google a lot just to process a bit of data back and forth, specially if you interact with the Windows API, where you need those pesky LPCTSTR things which are C chars or wchars, instead of C++ based. OS's don't facilitate C++ strings because they're are written in C, even if your code is compiled in C++.
Just sad, really.
Name:
Anonymous2007-05-06 21:24 ID:tY2/Gk1/
>>1
lulz. i've been programming for nearly 25 years and i'm still regard myself a beginner.
there's way too much out there to know it all and be another so-called "expert programmer"...
Name:
Anonymous2007-05-06 21:30 ID:/gmFGX53
#include <iostream>
#include <string>
int main() {
char bleh[] = "I'm a string!";
std::string blah(bleh); // char* to std::string
std::cout << bleh << std::endl
<< blah << std::endl
<< blah.c_str() << std::endl; // std::string to char*
return 0;
}
Name:
Anonymous2007-05-06 21:46 ID:3nVRcIU3
>>46
Thanks. That's good for the console, but not when you have to use that input (instead of just cout.)
Say you append to that a string representation of the time and date, and then send that to an "imported" function that stores the whole thing to a file.
I'm just making a point of real life C++ issues. Most of the time your code doesn't deal with the user directly, and it just deals with other code built by the OS or another company. COUT is for simple programs, intro classes or debugging messages. In the real world, if you can't summon a message box, you have to at least leave a log file with such pre-processed information and timestamps. You build lots of custom strings stating what things were running at the time. This is a pretty good thread. Thanks OP!
>>50
Real men write their own function to convert numbers to strings.
Simply because sprintf() is way to much for just a number.
Lastly, here's a PROtip:
If you are going to use sprintf() and the such, to prevent buffer overflows and shit either write a formatted strlen() function (eg size_t strlenf(char *format, ...)) or use malloc and realloc.
Name:
Anonymous2007-05-07 9:15 ID:O1oc4tBf
>>54
if your strlenf is so great why isn't it included in my stdlib?
>>57
then you're a fucking idiot, it's like saying
"well my stdlib doesn't have a regex function so what's so great about regex ?
TRE is a PoS and nobody needs it, ever!"
Or even
"well why is there a printf() ? what is this faggotry who needs printf? I'm happy with my kernel calls"
Name:
Anonymous2007-05-07 12:03 ID:pe+Zlgx5
>>51 was misunderstood by >>52 and >>53. C99 doesn't include asprintf --the latter's one of those orphan / non-standard functions compilers include for convenience. >>54 well, using malloc, realloc and free gets back to my point of C strings being written as a high maintenance hell on earth, since you'll at least double the number of string management lines in your code. Writing my own functions might lead to more bugs but it's for brevity, I guess. However, snprintf() IS standard and it already returns the length of the string formatted (minus the null.)
The functions asprintf() and vasprintf() first appeared in the GNU C
library. These were implemented by Peter Wemm <peter@FreeBSD.org>; in
FreeBSD 2.2, but were later replaced with a different implementation from
Todd C. Miller <Todd.Miller@courtesan.com>; for OpenBSD 2.3.
Name:
Anonymous2007-05-07 23:56 ID:Y0UmH5bV
you might also want to think about running a linux server for something (asterisk, mythtv, web server etc), you'll learn a lot more about how computers and operating systems work in unix than you will in windows.
Name:
Anonymous2007-05-08 0:54 ID:C7c1jN36
>>62 Yup. There's some money in learning (open source) asterisk, I hear from our telephony guy. I'm not sure what hardware you need, since IP telephony would need IP phones, or some kind of ethernet to plain old phone conversion somewhere.
There's a live MythTV CD around. I own a copy, but I think it failed to boot my only computer (a laptop, so it's reasonable and it lacks the Video Decoder needed for what I hear MythTV does.) Web servers, though, in themselves I find a bit overrated. They pretty much run themselves, while you spend the real money on the developers who upgrade your web applications and such. Matter of fact, in the US, I know civil servants who do less in their daytime college web administration tasks daily than you'd do in the bathroom lacking toilet paper. When they're not fixing Oracle or the linux mailer services, they update the schema for the school's hardware or class databases. Students have a selection interface through PHP that they work on. So they keep the server up, but the real work goes in the webpage upgrades / student notices.
Name:
Anonymous2007-05-08 1:17 ID:i5wcX6ln
>>1
if you don't want to be like >>36 ("switch from DOS C++ into real world C++ with QT, MFC or whatever, so that you can get hired", "I myself am trying to learn the win32 API, but it really sucks. That would be too advanced."), buy a book about unix, install unix os on your system (linux would be a great choice), and try to mess with it.
>>64 (>>36 here) Getting linux doesn't have to be a computer-wipe away. If you don't want to repartition, you can use a Live-CD. Ubuntu, Mandriva, Knoppix and other flavors (http://distrowatch.com's sidebar on the right has 100 links to download ISO's) have "boot-from-CD and leave hard drive alone" technology. Matter of fact, you can't save things unless you have a USB memory stick handy, for, say, saving code you wrote while under the live boot. >>65 Thanks. I swear I learned this somewhere, and it wasn't for virtual function initialization --it was someone's C code.
Name:
Anonymous2007-05-10 12:10 ID:SYoyIvaC
>>65 >>69
Pleas elaborate.
The "If the first element in an aray of T is nonzero the rest of the array is initialized." is bullshit.
Name:
Anonymous2007-05-10 21:10 ID:texCOCpz
>>70 >>69 here. It may be one of those conditions where it's up to the implementor to decide. Seems sound to me, in the context it was mentioned. I'm starting to have suspicions, but there was assembly code and I don't care enough to test it myself.
I just know that in the dozens of lines that say something like char name[255] = new char[255], I once saw {0} instead, recently. I probably also saw it in a NES emulator with a struct initialization, but it could just be a false memory.
GCC initializes all fields to zero if you use {0}. I have no idea about nonzero though.
Name:
Anonymous2007-05-11 0:07 ID:fLldn5g+
>>72 Thanks. This thread has turned obscure. I wonder if the original poster is still reading this, as it's been two weeks. I only noticed the thread this past weekend, and have been on /prog/ very often for help, learning and "master programmer" comments. Been fun.
Hi, Do you like lisp? When I first stumbled into Lisp advocacy on various corners of the web I was already an EXPERT PROGRAMMER. At that point I had grokked what seemed at the time a wide range of programming languages. I was proud to have under my belt (Java, C, C++, C#, C-, FORTRAN, BBCODE, etc.) I was under impression that I knew EVERYTHING there is to know about programming languages, I had written HUGE PROGRAMS you couldn't even COMPREHEND at age 12. I couldn't have possibly been more wrong. My initial attempt to learn Lisp came to a crashing halt as soon as I saw some sample code. I suppose the same thought ran through my mind that ran through thousands of other minds who were ever in my shoes: "OMG WTF LOOKS SHIT WTF IS UP WITH THAT ())()))))(((() FUCK!!!!11111" I couldn't be bothered to learn a language if its creators couldn't be bothered to give it a BBCode like syntax. After all, I was almost blinded by the infamous suave space toad Lisp! For many months the Lisp advocates pressed on. I was baffled. Many extremely intelligent people I knew and had much respect for were praising Lisp with almost religious dedication. There had to be something there, something I couldn't afford not to get my hands on! Eventually my thirst for knowledge won me over. I took the plunge, bit the bullet, got my hands dirty, and began months of mind blending exercises. It was a journey on an endless lake of frustration, I am stupid fuck. I turned my mind inside out, rinsed it, and put it back in place. I went through seven rings of hell and came back. And then I got it. I KNOW LISP. I AM SO SMART. I AM SO EXPERT, NOW I KNOW EVERYTHING ABOUT PROGRAMMMING, I DONT HAVE TO LEARN ANY OTHER LANGUAGE EVER.
Physics, Quaternions, Matrices up the ass, collision detection, etc etc etc etc.
Game developers need more math then CS majors any day.
Oh yeah just go ahead and program in that 3d waypoint indicator with no knowledge of math. Or add physics simulation to a hovercraft without knowing what torque is.