|
-
Apr 18th, 2000, 09:38 AM
#1
Thread Starter
Lively Member
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!"
-
Apr 18th, 2000, 10:16 AM
#2
Hyperactive Member
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
-
Apr 18th, 2000, 10:23 AM
#3
-
Apr 19th, 2000, 12:17 AM
#4
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.
-
Apr 19th, 2000, 02:03 AM
#5
Fanatic Member
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.
-
Apr 19th, 2000, 04:28 AM
#6
-
Apr 19th, 2000, 05:10 AM
#7
Frenzied Member
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.
-
Apr 19th, 2000, 08:15 AM
#8
Frenzied Member
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."
-
Apr 19th, 2000, 09:09 AM
#9
Conquistador
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...
-
Apr 19th, 2000, 06:27 PM
#10
transcendental analytic
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.
-
Apr 20th, 2000, 03:31 AM
#11
Fanatic Member
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,
-
Apr 20th, 2000, 04:10 AM
#12
Fanatic Member
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
-
Apr 20th, 2000, 07:35 AM
#13
Frenzied Member
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.
-
Apr 20th, 2000, 02:39 PM
#14
transcendental analytic
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.
-
Apr 20th, 2000, 11:18 PM
#15
Hyperactive Member
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.
-
Jul 23rd, 2000, 10:04 PM
#16
Member
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.
-
Jul 24th, 2000, 12:49 AM
#17
Lively Member
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.
-
Jul 24th, 2000, 04:09 AM
#18
Addicted Member
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.
-
Aug 19th, 2000, 08:42 PM
#19
Junior Member
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.
-
Aug 19th, 2000, 10:40 PM
#20
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)
-
Aug 19th, 2000, 10:50 PM
#21
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...
-
Aug 20th, 2000, 02:43 AM
#22
So Unbanned
Wouldn't you rather know how to write the code rather than just playgerize someone elses?
-
Aug 20th, 2000, 03:22 AM
#23
Fanatic Member
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.
-
Aug 20th, 2000, 11:45 AM
#24
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.
-
Aug 20th, 2000, 12:06 PM
#25
Fanatic Member
-
Aug 20th, 2000, 12:41 PM
#26
oh my God!!!!!
we will become French!!!!!!!
NOOOOOOOOOOOOOOOOO
-
Aug 20th, 2000, 10:00 PM
#27
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.
-
Aug 20th, 2000, 10:45 PM
#28
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.....
-
Aug 21st, 2000, 01:58 AM
#29
Member
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
-
Aug 21st, 2000, 02:00 AM
#30
Member
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!!!!!!!
-
Aug 21st, 2000, 02:05 AM
#31
transcendental analytic
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.
-
Aug 21st, 2000, 02:16 AM
#32
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 
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...
-
Aug 21st, 2000, 02:22 AM
#33
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|