News: 11 March 2016 - Forum Rules

Author Topic: May take a programming course - deciding which one to pick  (Read 21963 times)

furrykef

  • Full Member
  • ***
  • Posts: 132
    • View Profile
Re: May take a programming course - deciding which one to pick
« Reply #40 on: December 03, 2012, 11:37:09 am »
Well, the more you write in a higher level language, the more this is true. But if you write something in assembly, it's hard to write "self-documenting" code as soon as you have something complex enough so that you don't have enough register to do everything at a single time. Which in the case of the 6502 or 65816 is very soon as they have only 3 registers.
Sure. My remarks there weren't targeted at assembly programmers. I probably should have made that clearer since we'd been talking about assembly programming...

I comment my ASM code like crazy (though still never anything that simply repeats the line in English). Better to err on the side of assuming the reader (including my future self) isn't too bright than to risk making it difficult for him to understand.

Quote
You should also remember that your code is always much clearer to you than it is for everyone else. I know it sound incredible but I always have a very hard time understanding other people's code, when I can always clearly see what happens in mine, even when I dig back something old I didn't touch for years.
I find other people's code hard to read too. But I don't think throwing more comments at it fixes it -- especially not comments that exist just to explain what bitwise operations are...

STARWIN

  • Sr. Member
  • ****
  • Posts: 455
    • View Profile
Re: May take a programming course - deciding which one to pick
« Reply #41 on: December 03, 2012, 11:52:39 am »
Ideally you don't want to read the code, you only want to read what it does. So if a routine does something, I can comment that at the beginning. If it has many stages, I can comment each. If I want to check if the code is right, comments are not very helpful. Then it's up to the emulator in my head.

Garoth Moulinoski

  • Hero Member
  • *****
  • Posts: 6290
  • Disliking that smoke.
    • View Profile
    • My Stuff including Super Smash Karts.
Re: May take a programming course - deciding which one to pick
« Reply #42 on: December 03, 2012, 12:26:11 pm »
If I want to check if the code is right, comments are not very helpful.

I find this sentence strange. Not because I believe comments do help you check if code is right (that's not what it's for, you use it for improved legibility). If you're trying use comments to... help you check your code... you're doing it wrong...

But everything else you said, I can get behind.
Who will quote me next?
Disclaimer: If it sounds wrong, I may have been posting while asleep.

RedComet

  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Twilight Translations
Re: May take a programming course - deciding which one to pick
« Reply #43 on: December 04, 2012, 01:01:29 am »
Incidentally, I got in minor trouble for not using such inane comments in the "real world" when I worked on a commercial DS game. One of the programmers was complaining to me that he couldn't understand my code because I didn't use enough comments. (I do try to write self-documenting code in favor of using comments, as I view comments as an admission of failure at making the code self-documenting. That said, I do comment much more than some people.) I said, OK, maybe my code isn't as clear as I thought. Show me an example of code you don't understand. So he showed me a line. I asked what the problem with the line was. He said he didn't even know what it means. It was a bitwise operation or something elementary like that -- I was setting or clearing bits. It was something that would have been instantly obvious to anybody with real experience with C or C++. Why I was manipulating those bits was obvious too; it wasn't something like "foo |= 0x12" with no explanation. So adding a comment there would have added nothing of value -- to somebody who already knows basic C++. But apparently expecting a programmer to know basic C++ is too much to ask for.

I've seen a lot of stuff like this too even in my short time thus far in the world of professional programming. It's like all of those morons who half assed assignments in school got jobs making more than me for being incompetent and incapable of learning. It really disappoints me that people care so little about their craft. :(
Twilight Translations - More than just Dragonball Z. :P

FAST6191

  • Hero Member
  • *****
  • Posts: 3529
    • View Profile
Re: May take a programming course - deciding which one to pick
« Reply #44 on: December 04, 2012, 05:33:37 am »
I've seen a lot of stuff like this too even in my short time thus far in the world of professional programming. It's like all of those morons who half assed assignments in school got jobs making more than me for being incompetent and incapable of learning. It really disappoints me that people care so little about their craft. :(

I have been there too but be thankful we are no longer three years on from all the various newspapers and recruitment types saying everybody with a computer training course under their belt earns telephone numbers (around here that dubious honour falls to plumbing courses these days).

Of course such things are why I am still lumped with supporting ancient versions of java (I had a good run of not having to but it caught up with me the other week) and figuring out how to have IE6 and/or random flavours of XP on various computers and also keep networks secure.

Garoth Moulinoski

  • Hero Member
  • *****
  • Posts: 6290
  • Disliking that smoke.
    • View Profile
    • My Stuff including Super Smash Karts.
Re: May take a programming course - deciding which one to pick
« Reply #45 on: December 04, 2012, 08:54:35 am »
It was a bitwise operation or something elementary like that -- I was setting or clearing bits. It was something that would have been instantly obvious to anybody with real experience with C or C++. Why I was manipulating those bits was obvious too; it wasn't something like "foo |= 0x12" with no explanation. So adding a comment there would have added nothing of value -- to somebody who already knows basic C++. But apparently expecting a programmer to know basic C++ is too much to ask for.

So they didn't even bother to Google the operator in question? :/ Sheesh.

Quote
I am still lumped with supporting ancient versions of java

I have to make do with PHP 5.2 even thought PHP 5.3 is the one that's recommended people use and PHP 5.4 is already available as well. I mean, it's not quite as bad as your situation (as you seem to make it out to be), but it is annoying to have to redo some of my work sometimes because I can't use a method that would have solved my problem much easier (and in less lines)

Part of the problem is that the people who ask you to support old versions of these languages is that they're afraid that people, say with Java, have an old version of Java. Or in my case, the administrator doesn't want to go through a bunch of projects just to make sure that nothing on the server is blowing up to kingdom come (which is legit concern, but still... maintenance? It's part of software engineering, no matter how much we dislike it)
Who will quote me next?
Disclaimer: If it sounds wrong, I may have been posting while asleep.

FAST6191

  • Hero Member
  • *****
  • Posts: 3529
    • View Profile
Re: May take a programming course - deciding which one to pick
« Reply #46 on: December 04, 2012, 10:54:17 am »
I am not even going to pretend my java woes (not to mention I was not coding anything in this case and ran screaming from the room when I passed a debugger over the code for the sake of curiosity) are close to some of the horror stories I have heard from those I know in real life and have read on the internet; I just resent when a client pays a sizeable chunk of change to get some official professional grade software* (on top of an equally large chunk of change to get the hardware widgets to go with it) supposedly written/updated for this year that requires a very particular version of Java 1.4 to do nothing but basic binary data manipulation (and then have to mess around getting the program to recognise that version)- if it was because of bugs and such with various implementations of active directory support or something I could handle that but this just seemed pointless.

*for the terminally curious it was for the manufacturer specific Volkswagen auto group car errors/ODBII reader software. Of course car electronics and programming is about ten years behind the rest of the world and I knew this from past experience so hey, it was not like it was the worst annoyance of that job either (they do all cars in the garage, I got called in and presented with a stack of CDs all using installers that would make windows 3.11 laugh at for most makes of to update all the software and all mostly completely unable to get along with each other- of course the laptops then need actual serial ports which more or less discounts having virtual machines on modern laptops).

Garoth Moulinoski

  • Hero Member
  • *****
  • Posts: 6290
  • Disliking that smoke.
    • View Profile
    • My Stuff including Super Smash Karts.
Re: May take a programming course - deciding which one to pick
« Reply #47 on: December 04, 2012, 12:05:40 pm »
My employer had been using a crazy expensive service (NetBiscuits) to render their sites. Would be alright if all they wanted was to make a bunch of little static pages, but they wanted more ambitious things, so they're paying a whole bunch of money for something that isn't ideal for them. It runs in two modes: standard "drag and drop" and a "custom" version where you point the "application" to a PHP "backend". It practically does nothing that HTML couldn't do better.

Fortunately, I finally won the battle and am converting the sites to HTML (and they'll be saving a ton load of money). And I'll be able to use a database! Whoever was here before me was using a bunch of spreadsheets in place of a database. Heck, my former boss was allergic to databases. Now that he's gone, I'm finally free to get stuff done right. (The problem is that I have to do all these changes to a bunch of sites). I'm also going to try putting all the code that gets reused in all the sites in one place so I don't need to go around fixing the same things doing "copy/paste".

I've annoyed DarknessSavior with all of my rants throughout this year because of how bad everything was here. It used to be that you couldn't understand a lick of code here unless you debugged through all of it and saw what every last variable actually was storing.

Not saying I've made them perfect. I keep adding and changing stuff to them. I just wish I could have done things right from the beginning. I literally have been forced to copy and paste code because my former boss didn't want to have common code separate from specific code.
Who will quote me next?
Disclaimer: If it sounds wrong, I may have been posting while asleep.

furrykef

  • Full Member
  • ***
  • Posts: 132
    • View Profile
Re: May take a programming course - deciding which one to pick
« Reply #48 on: December 04, 2012, 06:34:31 pm »
Ideally you don't want to read the code, you only want to read what it does. So if a routine does something, I can comment that at the beginning.
Then your comments and code get out of sync and then you're fucked. :P

Garoth Moulinoski

  • Hero Member
  • *****
  • Posts: 6290
  • Disliking that smoke.
    • View Profile
    • My Stuff including Super Smash Karts.
Re: May take a programming course - deciding which one to pick
« Reply #49 on: December 04, 2012, 10:16:41 pm »
Then your comments and code get out of sync and then you're fucked. :P

Well, if that happens, you're probably doing something horribly wrong in the first place. I mean- Yes, you should comment as much as you can so the code is self documented, but it's slightly overkill to comment every last line. I usually keep certain "blocks of a task" together, separated by a carriage return and an explanation comment before the code. But I usually keep my methods short ("A method should only perform one task"), so the comments can go on top.

I did comment every last line in this one block of code that was O{n^4) (or n^3, I forgot) because not only was it horribly slow, but I felt it was wrong. I just didn't know what how to do it better. My coworkers let it slide because I was aware of its cost, the data set was small (the max amount of elements ever would be 31), and they could follow every step of the code by reading the comments. Actually, they liked reading the comments. *shrug* Unfortunately, I not only don't have access to that code anymore (I've since left that job) but even if I did, I wouldn't be able to show it to anyone (even though the whole thing was open source, they don't want anyone to know that). I technically don't own that code anymore. :'(

So, I think this is a sort of case-by-case sorta thing. You always leave a description of what you method/function does. You always leave a description of what your struct is for. You always leave a description of what a block of code will do if it's not directly obvious. Your comments should be written in plain, standard English (although some people's mind would still die). You should have a description of what your class contains and how to use it.

These are things you would learn in a Software Engineering class, at least. But I guess there's really no such thing as Software Engineering, hur hur hur...
Who will quote me next?
Disclaimer: If it sounds wrong, I may have been posting while asleep.

fellowroot

  • Jr. Member
  • **
  • Posts: 46
    • View Profile
Re: May take a programming course - deciding which one to pick
« Reply #50 on: December 05, 2012, 12:11:25 am »
So after reading everyone's post... I think I'll sign up for C.

Klarth

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
Re: May take a programming course - deciding which one to pick
« Reply #51 on: December 05, 2012, 07:34:04 pm »
So after reading everyone's post... I think I'll sign up for C.
Those aren't ideal options for someone who's more interested in practical use.  It's easy to cross out Pascal and Comp Org/Assembly.  Java...well, I don't know any talented programmers that actually LIKE coding in Java.  It's closer to a language of last resort.  I'd definitely pick C if you pick any of those.  Once you learn the basics (conditionals, loops, i/o, functions, etc), that's enough conceptual knowledge to hop to another language and have a reduced learning curve.

Unfortunately, you have a huge learning curve ahead of you if you're starting from little to none programming/hacking knowledge and want to make level editors, especially for something like the n64 which can have 3d models.  This curve still holds true given your analytical background.  I suggest reducing your scope a bit.

BRPXQZME

  • Hero Member
  • *****
  • Posts: 4572
  • じー
    • View Profile
    • The BRPXQZME Network
Re: May take a programming course - deciding which one to pick
« Reply #52 on: December 06, 2012, 12:01:56 am »
Java is plenty practical if what you want is “software engineer” as a job title. There is a lot of Java to go around in the finance industry.

Not that useful for stuff we like to do on this site, sure.

C isn’t a bad call, since comp org courses sometimes cover a lot and sometimes cover not that much.
we are in a horrible and deadly danger