Results 1 to 33 of 33

Thread: Has anyone ever noticed something about programming?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 1999
    Posts
    65
    That the only two hard parts about programming are learning the commands and code formats, and the theory behind the programs. I mean, actually coding your programs isn't that difficult, and is actually kind of fun. I just thought I'd mention this random brain fart, everyone have a nice day.

    End.
    "I'm carrying a Geometry book, but I'm not in Geometry...it's crazy...crazy man!"

  2. #2
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    Wouldn't it be even easier if people put together a code library on a huge sight where every component had to use the same variable naming conventions using understandable names so whenever you wanted to do anything you could grab a component and stick it in your project without any modification and refer to it with a goto statement? ...
    I'm just randomly brain farting along with you if that's O.K.
    Joey O

  3. #3
    Guest

    Angry Coding easy???????

    Try having to make major modifications to some one elses code, who don't recognise naming conventions in vb, and clearly has never heard of code re-use.

    Have a shambles to decipher back at our office, which should produce an integrated word document with excel tables etc. The mess doesn't work, has incredible long procedures, (many of which actually do the same thing), and has little to no documentation.

    Sure writing your own stuff is easy, (which l will probably do to the app mentioned above), but maintaining other peoples code is a real bummer

  4. #4
    Guest
    No, sorry your all wrong, THE hardest thing that a programmer has got to overcome is this:

    Thinking of a project to do in the first place!!!

    I expect most amateur programmers (like me) rack their brains as I do for ages before making a start.

  5. #5
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516

    Smile Wossname is right

    I'm an amateur programmer (ie I do it for fun). And the
    hardest thing is to find a project which meets the following
    requirements:

    a) fun to program
    b) not too hard
    c) you'll learn something

    I'm into graphics right now (I'm doing a 2D plane game
    which bombs buildings and has to bomb them right down to
    the ground so that it can land (it's an old Amstrad game)
    and every level the buildings get higher)

    I've found it fun, not too hard, and I've learned a lot
    about BitBlt, using modules properly, and I'm particularly
    pround of the High Scores Table (which in my view is better than John Percival's class-module based one, no offence)

    One of the strange thing about programming is all the fuss
    people make about Class Modules, could someone explain
    their point, since I've seen, and read a bit about them and
    they seem about as useful as a condom in the Vatican. Why
    use Property Let when you can just use a variable and then
    verify its value when a value has been entered and not
    bother about all the ByVal newValue stuff?

    It means a lot of extra coding which is about as good as my
    form-based code.
    Courgettes.

  6. #6
    Guest

    Cool

    Gee this is generating a lot of mail

    Ok Classes. I use them to define individual tables in a database, one class per table. This then allows me to insert the class where needed, in the same project, in different projects without having to re-invent the wheel. Kind of the ultimate reusable code. The same applies for dll's consisting of standard functionality that l will use in just about any project.

    What you end up with is a kind of code library, similar to the includes our C colleges spend years developing.

    As for my hellish app, only some one with very little vb knowledge would have produced that piece of garbage. Talked to the client's about it last night, and they have agreed to finance a complete rewrite...yahoo. So spent four hours over night in design, and will present to clients today And that is when coding gets eaasier, design specs before cutting forms and modules


  7. #7
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Class modules are great, You can put all your code in class modules, compile it and just use it again when you want it. Plus you can have your data and your code in the same place which makes things easier.

  8. #8
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Hey V(ery), I remember a game like that called Plebs. Is that what you're making? I must have playes that... dozens of times Hehe
    Harry.

    "From one thing, know ten thousand things."

  9. #9
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    when i was alot younger, i tinkered around with microsoft excel in vba...
    then we bought visual basic. the first project i did in it was some cheap hello world. i then moved on, creating some harder programs but i have no use for them, programming is more of a leisure activity...

    oh well bye...

  10. #10
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Thumbs up

    I love classmodules, they have made my life much easier. It's like Userdefined types, with code!
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  11. #11
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516

    Post You've got a point

    I still don't like (actually I still hate) class modules. I made a program just now that uses one, just to prove I could write one.

    Just to show off, here's the code in the Class Module.
    Yeah, yeah. There probably IS a better way to do it

    Code:
    Private m_FirstName As String
    Private m_LastName As String
    Private m_MiddleNames As String
    Private m_Sex As SexConsts
    Private m_Marital As MaritalConsts
    Private m_Title As Titles
    
    Public Enum SexConsts
        Male
        Female
        Child
    End Enum
    
    Public Enum MaritalConsts
        Unmarried
        Married
        NotGiven
    End Enum
    
    Public Enum Titles
        Mr
        Mrs
        Ms
        Miss
        Mstr
    End Enum
    
    
    Property Let FirstName(ByVal newValue As String)
    If Len(newValue) <> 0 Then
        m_FirstName = newValue
    Else: MsgBox ("Invalid Name"), , "Error"
    End If
    End Property
    
    Property Get FirstName() As String
    FirstName = m_FirstName
    End Property
    
    Property Let LastName(ByVal newValue As String)
    If Len(newValue) <> 0 Then
        m_LastName = newValue
    Else: MsgBox ("Invalid Name"), , "Error"
    End If
    End Property
    
    Property Get LastName() As String
    LastName = m_LastName
    End Property
    
    Property Let MiddleNames(ByVal newValue As String)
    If Len(newValue) <> 0 Then
        m_MiddleNames = newValue
    Else: MsgBox ("Invalid Name"), , "Error"
    End If
    End Property
    
    Property Get MiddleNames() As String
    MiddleNames = m_MiddleNames
    End Property
    
    Function ShortMiddle() As String
    If Not (Len(m_MiddleNames) = 0) Then
        Dim i As Integer, MidNames() As String
        MidNames() = Split(m_MiddleNames, " ")
        For i = 0 To UBound(MidNames)
        ShortMiddle = ShortMiddle & Chr(Asc(MidNames(i)))
        Next:
    End If
    End Function
    
    Property Get NearFullName() As String
    If Not (Len(m_FirstName) = 0 Or (Len(m_MiddleNames) = 0) Or (Len(m_LastName) = 0)) Then
        NearFullName = m_FirstName & Space$(1) & m_LastName
    End If
    End Property
    
    Property Get FullName() As String
    If Not (Len(m_FirstName) = 0 Or (Len(m_MiddleNames) = 0) Or (Len(m_LastName) = 0)) Then
        FullName = m_FirstName & Space$(1) & m_MiddleNames & Space$(1) & m_LastName
    End If
    End Property
    
    Property Get ReverseName() As String
    If Not (Len(m_FirstName) = 0 Or (Len(m_LastName) = 0)) Then
        ReverseName = m_LastName & ", " & m_FirstName & Space$(1) & ShortMiddle
    End If
    End Property
    
    Property Get ForwardsName() As String
    If Not (Len(m_FirstName) = 0 Or (Len(m_LastName) = 0)) Then
        ForwardsName = m_FirstName & Space$(1) & ShortMiddle & Space$(1) & m_LastName
    End If
    End Property
    
    Property Let Sex(ByVal newValue As SexConsts)
    m_Sex = newValue
    End Property
    
    Property Get Sex() As SexConsts
    Sex = m_Sex
    End Property
    
    Property Let Marital(newValue As MaritalConsts)
    m_Marital = newValue
    End Property
    
    Property Get Marital() As MaritalConsts
    Marital = m_Marital
    End Property
    
    Property Get Title() As Titles
    If m_Sex = Male Then
        Title = Mr
    ElseIf m_Sex = Female Then
        If Marital = Married Then
            Title = Mrs
        ElseIf Marital = Unmarried Then
            Title = Miss
        ElseIf Marital = NotGiven Then
            Title = Ms
        Else: Err.Raise 1001, , "No Marital"
        End If
    ElseIf m_Sex = Child Then
        Title = Mstr
    Else: Err.Raise 1001, , "No Sex"
    End If
    End Property
    
    Property Get ProperTitle() As String
    Select Case Title
        Case Mr
            ProperTitle = "Mr"
        Case Ms
            ProperTitle = "Ms"
        Case Miss
            ProperTitle = "Miss"
        Case Mrs
            ProperTitle = "Mrs"
        Case Mstr
            ProperTitle = "Mstr"
    End Select
    End Property
    
    Property Get ProperSex() As String
    Select Case Sex
        Case Male
            ProperSex = "Male"
        Case Female
            ProperSex = "Female"
        Case Child
            ProperSex = "Child"
    End Select
    End Property
    
    Property Get ProperMarital() As String
    Select Case Marital
        Case Married
            ProperMarital = "Married"
        Case Unmarried
            ProperMarital = "Unmarried"
        Case NotGiven
            ProperMarital = "Not disclosed"
    End Select
    End Property
    
    Function AddTitle(ToWhat As String) As String
    Dim Tempr As String
    Tempr = StrReverse(ToWhat) & Space$(1) & StrReverse(ProperTitle)
    AddTitle = StrReverse(Tempr)
    End Function
    (Obviously there's some on the form module, too)
    (And I haven't made it 'Real-World', either)

    The point is, surely writing all those Property Let and
    Property Get procedures gets on your nerves after a while
    (because they sure get on mine )

    Probably I hate cls modules so much because I've only read
    like 10 pages about them.

    Does anybody know where I can find documantation and all that?

    Thanks,

    Code:
    Unload Me
    Courgettes.

  12. #12
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Hey Kedaman!

    I want to ask you for some tips. Most of the time I use class module is for adding on additional properties, method or events to an existing control (such as textbox). Other time, I would use it for making invisible controls.

    What other use are there with class module?
    What do you use it for most of the time that makes you think it is a life saver.

    Just like Very Basic, I can write class modules too but want to know if there is anyother use for it beside templating.
    Chemically Formulated As:
    Dr. Nitro

  13. #13
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Class Modules can Save you a lot of work if you reuse them
    V(ery) Basic's class module is probably pretty useless on it's jack but With some other classes it could be quite usefull when processing a Database with people in it and you want to print a load of standardised letters or something. class modules are creat if you can get around the Idea of keeping your code in the same place as your data, Which isn't a hard concept while we're using command buttons etc all the time.

    Ass well as being able to compile and reuse class modules there are lot's of other tricks you can do with them, It's quite hard to give you a complete list, it's like trying to explain the advantages of subclassing, you just learn as you go, Some good things to do are...


    "Plug In Classes" That's a name I've just made up, The Idea is you can add a class module to your project, and base your code around it then You can make huge changes in your project just by changing the class module for a different one with the same Interface. I can't think of any great examples at the moment, erm hows about this, your making a game of some sort make a class module that does all the graphics etc this class know's the size of the screen etc and the calling program doesn't tell the class where anything is on the screen or anything, the class handles all of that. Then you can Just make a new class and completely change the look of the game.


    "Recursive programming" is quite hard to explain, It's the idea that you can have an instance of a class inside itself and you can use this to sort of extend the class like a telescope and do a lot of work in very little code.

    I'm crap at explaining things but if you start using them you'll use them in wierd and wonderfull ways to use them as situations come up.




  14. #14
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Talking

    Ok I wrote this yesterday, but forgot to post it, was too tired for staying awake. I scanned trough my VB directory and found out that I've used class modules mostly for gamedeveloping, about 50. But there are also some cls's handling API with hwnd, piecharts, Cad, files, coordinate based graphics, compressed properties, and bunch of other small categories.

    IE, I tried to make a adventure game when I first discovered cls's. I was making about 4000 lines of code and getting really tired about the unorgnaized code. I had 18 modules 6 forms and tons of methods to remeber. The more code, i wrote, the harder was it to understand it. But the bugs was the worst.

    After the discovery of cls, I had 1500 lines, 5 modules, 6 forms and 8 classmodules. And there was never a doubt of how to use these classes, no more data storage horrors, no more problems finding the methods. No more unclear heaps of code.

    V(ery) Basic: Well, I never got into that phase "I hate cls" because I jumped from one mountain to another, knowing the second is much lower. Property Get/Let/Set are not getting on my nerves, they are useful too. In your example, your problem is that you overuse property get/let instead of using public vars. Obviously your problems occured from not wanting to make that cls at all.

    Class modules applies best to applications with complex system of storing data.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  15. #15
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    Thought I'd join in with my 2 cents. I like the idea of classes for data and stuff (although I don't often use them). But I don't use them where I need them most. I created a bunch of shapes that were drawn based on the mouse position for a game. Written to the form they can be drawn and used as "brushes" without a flicker.I thought it would be great to name them, give them properties and methods, and always have them to reuse. -WRONG! All the getting and letting left me watching and waiting for my drawings to happen. I know there are methods to accelerate my drawings but the learning curve is long and most of what I've seen in graphic books advocates writting to the form for speed.I do like writting subs in .bas modules though so I can name them and keep them around without all the letting and getting, but I sacrifice a lot of encapcelation this way.

  16. #16
    Member
    Join Date
    Jul 2000
    Location
    Ontario, Canada
    Posts
    61

    Talking

    I love coding it is my life what I will soon get paid for I do C++, vb, ASP, vbscript, java, and SQL, and it is just the rush of someone buying your program I love it and thats why I keep Doing it
    ---~^ Absalom ^~---

    There is nobody in the world who knows everything there is no one his/her workforce who knows everything what really makes the person smart is that he/she is not affraid to ask for help.

  17. #17
    Lively Member
    Join Date
    Jul 2000
    Location
    Vaxjo, Sweden
    Posts
    85
    My greatest fear is that the general public finds out how easy my job really is. Then I might get a huge pay cut.

    //Anders
    Reality is what you make up when you can't handle your fantasies.

  18. #18
    Addicted Member
    Join Date
    Jul 2000
    Location
    Scotland
    Posts
    184

    Smile

    Just wait for VB7 Then it all becomes clear. This is (allegedly) a true Object Oriented language and Classes become the main stay of the whole thing. Proper Inheritance (someone below called it Recursive Programming), encapsulation, overloading, polymorphism etc etc.

    Understand classes now - it'll make life easier when using VB7.


  19. #19
    Junior Member
    Join Date
    Jul 2000
    Posts
    18

    Re: Coding easy???????

    Originally posted by Jethro
    Try having to make major modifications to some one elses code, who don't recognise naming conventions in vb, and clearly has never heard of code re-use.

    Have a shambles to decipher back at our office, which should produce an integrated word document with excel tables etc. The mess doesn't work, has incredible long procedures, (many of which actually do the same thing), and has little to no documentation.

    Sure writing your own stuff is easy, (which l will probably do to the app mentioned above), but maintaining other peoples code is a real bummer
    I understand that big time. try working with a program with no documentation thats writtin in some made up programming language hibread. its like some kind of java C monster. every line starts with If.

  20. #20
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Talking about RAD tools. I heard that VB 9.5 will have speech recognition all you have to do is to say:
    Write Code
    Debug
    Compile
    and your all done.... really.... (NOT)

  21. #21
    Guest
    that made me think of something,

    I dont know how,
    but why doesnt MS make a standard DLL with lots of regularly used functions, like AlwaysOnTop, Drag a form(without title bar)

    some subclass routines, and stuff like that....

    I know any person could do that, make an activex dll, or one in C++, but it woulnt be standard, MS would have to do it...

  22. #22
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Wouldn't you rather know how to write the code rather than just playgerize someone elses?

  23. #23
    Fanatic Member
    Join Date
    Jun 1999
    Location
    California, USA
    Posts
    662
    I use activex dlls to make true plugins for my programs. The plugin installer adds a line to the program's plugins.ini file (i prefer ini files) and my program loads it at runtime (via createobject). If I assume the the dll has a standardized interface, I can create it as a iPlugin object (or something similar...) and can use the ShowInteface method to load the plugin's form. So far, it works pretty well.

  24. #24
    Guest
    digital error:

    I do know how to write that kind of code, but if MS added some of the "standard" code to DLL's and allowed people to access them via the API method it would be a lot less code for programmers, I know things like always on top and stuff like that is really small, but there is some code that is really long.

  25. #25
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516
    Originally posted by Joacim Andersson
    Talking about RAD tools. I heard that VB 9.5 will have speech recognition all you have to do is to say:
    Write Code
    Debug
    Compile
    and your all done.... really.... (NOT)
    VB 9.5?

    At Microsoft-rate that'll be in a couple of years, by which time aliens will have overrun the Earth and we will all become (and I'm sorry to have to tell you this )... French. Also, all the major cities will be destroyed by the Phwarghys and a small group of people will have escaped through the StarGate to a planet whose reference number is P-571. And, there I'm afraid, ther'll only be Java (it doesn't need Microsoft ).

    I'm really a lost case.
    Courgettes.

  26. #26
    Guest
    oh my God!!!!!
    we will become French!!!!!!!
    NOOOOOOOOOOOOOOOOO

  27. #27
    Guest

    Angry I hate those dll things

    Caren't MS get some technology in place to can the use of dlls. I mean the things suck, you get naming problems, registration problems, and version problems. Big Bill should push the so called developers at MS to overcome this area of ineptitude then we could hava a greate development environment.

    Dennis

    I thought the US of A was a part of France....hehehehe....just read an email with answers to a US high school geography exam, and had to get my own back. Some idiot thought Australia was the third major Island of Papua New Guinea. Actually looking further down the answer list some mentally challenged individual decided New Zealand was a canton of Germany just next to Holland.

  28. #28
    Guest
    hehe, thats funny,
    once in geography class, we were having a "test" to see if we new where everyplace was(in the whole world)

    one kid completely forgot about australia, he got a C- hehehehee........
    not bad for only 6 continents.....

  29. #29
    Member
    Join Date
    Jul 2000
    Location
    Australia
    Posts
    37

    Re: I hate those dll things

    Originally posted by Jethro
    Caren't MS get some technology in place to can the use of dlls. I mean the things suck, you get naming problems, registration problems, and version problems. Big Bill should push the so called developers at MS to overcome this area of ineptitude then we could hava a greate development environment.

    Dennis

    I thought the US of A was a part of France....hehehehe....just read an email with answers to a US high school geography exam, and had to get my own back. Some idiot thought Australia was the third major Island of Papua New Guinea. Actually looking further down the answer list some mentally challenged individual decided New Zealand was a canton of Germany just next to Holland.
    I didn't know Australia was part of Papua New Guinea wait until I tell our wonderful Prime Minister over here, he'll be so happy more people to tax

  30. #30
    Member
    Join Date
    Jul 2000
    Location
    Australia
    Posts
    37
    Originally posted by denniswrenn
    hehe, thats funny,
    once in geography class, we were having a "test" to see if we new where everyplace was(in the whole world)

    one kid completely forgot about australia, he got a C- hehehehee........
    not bad for only 6 continents.....
    What's so strange about forgetting Australia???? Over here in the land down under we reguarly forget Tasmania off of our maps!!!!!!!

  31. #31
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    what's Australia?


    `hehe
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  32. #32
    Guest
    What's so strange about forgetting Australia???? Over here in the land down under we reguarly forget Tasmania off of our maps!!!!!!!
    yeah, but tasmania isnt a Continent


    `hehe
    you should really get that checked out


    OH NO!
    I am starting to acquire V(ery)'s sense of humor!!!!! this cant be!!!!
    NOOOOOO Before you know it i am gonna turn french...

  33. #33
    Member
    Join Date
    Jul 2000
    Location
    Australia
    Posts
    37

    Talking

    What's the Olympic Games?????

    He he

    PS - Has anyone ever heard of a torch relay around an island taking over 100 days???

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width