How to Regain Interest in Programming?

Hello, guys.

About four or five months ago, I stumbled into programming while studying web design. I started with C++ and loved it, and then decided to learn JavaScript alongside it just so I could see some contrast in how the languages implement things. After about a month of this, I decided I'd break from C++ and focus mainly on JavaScript (it's a high-level language, and since it's web-based it's pretty much automatically GUI). I did this for a month before I returned to C++ to learn its version of OOP.

After taking a while studying structs, classes, dynamic memory and so-on, i realized these things were too powerful for console programs. I wanted to do GUI windowed programs. Long story short, I was taught a brutal lesson in what it's like to try to learn something that has terrible documentation for beginners. The whole time I didn't care, because I had an almost adrenal enthusiasm, and I got up every day and read everything I could to understand everything. But, as does adrenaline, my enthusiasm dissipated, and soon so did my will to go on.

It got to where I started seeing programming as less of a fun experience of figuring things out and writing exciting code, and more a boring experience of trying to decipher how to make my compiler build my windows with menus, and memorizing where certain information about the handlers was (LOWORD HIWORD UGH). I'm getting bored just describing it. Eventually I gave up (sadly) and tried to use Qt. The short version is, I found Qt to be no different than Win32 GUI other than the fact that it had a lot better documentation. It was just more about memorizing their unbearably cheesy QClasses than actually trying to figure out how to build the application I had in my head. And by that point, I was already burned out anyway.

Now I can barely convince myself to open up notepad and write <html>, let alone play around with public and private classes. And I’ve already taken about a month off. I’m just not regaining that drive I had. Any advice? I miss the excitement and confidence writing code gave me.

Thanks.

(tldr: I tried windows programming, hated it, gave up on it, and as a result lost the will to write code. Any advice? I've been programming for half a year. I do miss it, so please don't say "Do something else stupid lawl!".)
[structs, classes, dynamic memory and so-on are] too powerful for console programs
Heresy! Are you suggesting a program's complexity depends mainly on how its output is presented to the user?

GUI programming is (IMO, and apparently to you too) among the least interesting activities one can engage in. It's easy to get lost in the myriad of menial tasks that have to be performed to get anything done, and it sucks all the life out of you.
What I usually do is focus my energy on the part/s of a program that interest/s me, and then use the simplest solution (read: the solution that will require the least amount of effort from me) for everything else. For example, if I'm doing some statistical analysis on a data set, it would certainly be nice to have the results displayed in a window, but it's a hell of a lot simpler to just dump the numbers to a text file and view them in a spreadsheet. Many programs don't even have any interaction; they just read data from some file or some place else, do some processing, and either display some result on the console or produce an output file.
Last edited on
Some people are motivated by the programming itself, so are more than happy to learn more and more random facts. As long as they're cool!

But other, like me, are more interested in solving problems. I also like to feel that what I work on is useful to other people, so my effort is worthwhile. Maybe you just need to identify and interesting problem to solve?

Have you any little tasks which a little program could help you with? Hobby or otherwise. In another recent post, someone was talking about a vocab trainer to help them learn a foreign languages. This seems like the right sort of (size of) app to start with, as it can start off simply yet has plenty of scope to be extended.

The UI requirements for such an applet would be quite basic, even if you chose to use a GUI library (prob. just a dialog with a few controls). Or you could use a command line app instead. As helios said, the GUI side of thing is not the most interesting part of programming!

In the case of a vocab trainer, the UI just needs to ask a question and get a response, which is pretty trivial using either a GUI or the command line. But the inner working could be extended from a basic file loading and literal string comparison to code that understands about agreement and inflexion, and beyond [1]. A comparison function which identifies likely mistakes would be far more help to the user than a response of right or wrong.

Andy

[1] Instead of just asking what is (e.g.) French for "to eat" -> "manger", the app could ask you to translate from "I eat" to "je mange". Then it could be extended to work with short phrases -- "le chien mange le petit fromage" -> "the dog eats the small cheese". Implementing this in a OO way would require dictionary, dictionary entry, part-of-speech, phrase, classes, etc. And it could even lead into learning properly about natural language processing.

Last edited on
Ever think of playing around with Tcl/Tk?
http://wiki.tcl.tk/
It makes live much easier when dealing with GUI stuff. For example, here's a very simple hello world-type program:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
proc main args {
  # create the GUI
  frame .f
  label .f.l -text {Your name:}
  entry .f.e
  .f.e insert end world
  button .b -text {Greet me!} -command {greeting [.f.e get]}

  pack .f.l -side left
  pack .f.e -expand yes -fill x
  pack .f -side top
  pack .b -fill x
  }

proc greeting name {
  tk_messageBox -message "Hello $name!" -type ok
  }

main argv

:-)
If you want gui with c++ you should try Qt. its very easy to learn and everything is documented well.

1
2
3
4
5
6
7
8
9
10
11
12
#include <QtGui/QApplication>
#include <QPushButton>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QPushButton button("Hello world!");
    button.resize(100, 100);
    button.show();

    return a.exec();
}


This code would already bring a button to the screen and it would work on linux, mac and windows.
@ OP: I think the problem you are running into is not that you've lost interest, it's that you are studying the wrong thing. Console programming is only simplier in the sense that there is less to do but it is not a prerequisite to learning GUI programming. There is nothing stopping you from choosing an API and jumping right into writting a GUI application. Sure there is a lot of code and going through it is time consuming but that aspect doesn't get any easier just because someone has experiance with console programming. Also with the proper implementation of OOP, you'll know what problems are being caused by what components.
That QPushButton example in Tk
1
2
button .button -text {Hello world!}
pack .button
@Duoas the Tk version is not quite equivalent, as it isn't setting the size to 100 x 100
Last edited on
you got to be like nike and just do it.

Why'd i get reported?
I'm speaking the truth... I was bored out my mind but I persisted...
Last edited on
Yes, the Qt version does a bad thing and sets the button size by pixels. I could have done that in Tk also, but since Tk does the Right Thing at the start, why bother?
Topic archived. No new replies allowed.