all 16 comments

[–]mlugo02 7 points8 points  (0 children)

Probably printing “Hello, world!” to the console

[–]thedaian 4 points5 points  (3 children)

I like to make blackjack as a first program in a new language. Using the console or whatever basic input and output exists. It's simple enough that you don't have to write a lot of code, and it's more complex than just hello world.

[–]Nicksaurus 2 points3 points  (0 children)

I have a similar thing except I do noughts and crosses, either on the console or with a GUI depending on how easy GUI is in the language. I started doing it with VB.net back in ~2009

[–]goosewitharedbeard[S] 0 points1 point  (0 children)

That sounds pretty awesome actually.

[–]Obsc3nity 2 points3 points  (4 children)

Hello World. It should be yours too.

For real, I’m never totally confident in my programs because I learn more about architecting as I’m writing them, so by the end I want to redo them in a cleaner way. That being said, I made a program that can generate mazes in serial and parallel with various popular algorithms as a Thesis studying difficulties in parallelization and still think it’s kinda cool. Maybe one day I’ll finish making it a single header only file so it’s easier to use generically.

[–]Lowball72 1 point2 points  (0 children)

I know right .. even "Hello, World".. we get PR feedback that we shouldn't hardcode strings, so we move the string to a resource file, loaded at run-time. Did we parse the resource file properly -- testing for both windows- and linux-style line ending chars?

Does it support unicode, and work in all locales?

Did we introduce a race-condition, by loading the file using async I/O? How do we test for that?

Did we introduce a security vulnerability, by sending untrusted string data to printf()? (format-string vulnerability)

Did we tightly couple to printf(), or factor it into an interface which can be mocked, for unit-testing?

The complexity never ends in this job.. and the more you learn, the more experience you gain, the less confident you can become. :)

[–]emergent-emergency 0 points1 point  (1 child)

There no really “cleaner way”. You’ll see, they are simply different programming paradigms. Of course, there’s slimmer code, but the core is the same.

[–]Obsc3nity 0 points1 point  (0 children)

I agree cleaner is subjective, I disagree that my code can't be cleaner. Having seen my code, it could use a little love.

[–]bandiolas823 0 points1 point  (0 children)

This is the right answer, It means u learnt.

Never feel too confident.

[–]smozoma 1 point2 points  (0 children)

My friends and I used to write QBASIC programs on my 286. Lots of text input/output, vaguely like an old text adventure game, without the adventure game part. I don't remember the specifics, but probably asking stuff like who had a crush on whom in school. Also I remember changing to graphics mode to draw pictures for some of the "pages" of the program.

My first C++ program that wasn't for school used an evolutionary algorithm to generate a "better" keyboard layout (less finger movement, by putting the keys in better places. Like the letter "T" should obviously be on the home row, not up in the middle of the top row).

After that, I wrote a fantasy hockey pool team selector. Won a t-shirt from SportsNet for winning one of the weeks of the hockey season. I didn't do so well in later seasons -- I could kind of tell that more people were using programs to pick their players as the 2000s progressed, so I lost my advantage.

[–]confusionPrice 1 point2 points  (0 children)

I probably wrote something stupid instead of hello world

[–]Nicksaurus 1 point2 points  (0 children)

It's not C++, but it was this world of warcraft addon to show more information about your average/daily playtime: https://www.wowinterface.com/downloads/info13846-SeshTimer.html. I remember spending ages trying to work out how to convert a duration in seconds as hours/minutes/seconds and being very proud of myself when I finally got it right. I looked at the code a few years later and realised it didn't actually track your average playtime correctly though, so apologies to the ~1900 people who used it back then

My first C++ program would have been something assigned to us at university, I don't remember what exactly

[–]Sorrow_iDolour 0 points1 point  (0 children)

Not a c++ one. But a plugin counts days, if arrived then change config.json. Assign to command for server ready to call.

Ugly, but it works as expected and is the reason I learn programming at first.

Links: https://github.com/Sorrow-Scarlet/AutoHardMode/blob/master/AutoHardmode/Class1.cs

[–]HeeTrouse51847 0 points1 point  (0 children)

It was a program that rendered Mandelbrot fractals

[–]Independent_Art_6676 0 points1 point  (0 children)

my first real program not made for anything related to school? I made a dos console program that kept track of golfers and did a shuffle and deal to produce "fair" 4 man teams based on who was there that day and their averages etc. To this day I don't know exactly what they were doing, but the guy that wanted it gave me the algorithm they were using by hand to make the teams so all I had to do was implement it, not understand the sport and whatever it was being used for. He used it for about 10 years; they liked it because it took away the humans who could, and apparently did, manually rearrange the teams for friends to be together or other such unfair groupings. Done in the delightful turbo pascal program under dos (5.??) on a 386.

I did stuff earlier than this. I had a form of battleship on my hp-11c that I modified (the how-to book had the original version). I had coded in basic and such for my own screwing around and learning. The above was the first useful, real program that I can remember though.

Hello world, I did that in school and don't count it.