Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: For a newbie, C++ or Java or what?  (Read 13066 times)

0 Members and 2 Guests are viewing this topic.

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: For a newbie, C++ or Java or what?
« Reply #30 on: March 02, 2009, 09:10:26 AM »
meh. I'm in no position to judge it anymore; heck I discarded my first project. My second project, I still have. a Spaceship game called "blackspace"... except it's mostly programmed in VB2 and a few things won't load properly... I seem to get a "Statement too complex" error when trying to load almost all of my old projects. (64 projects in my VBPROJ directory- and 165 within a "OLDSTUFF" folder beneath that. my "gravgame", a few projects I made for printing passwords on labels for the start of a school year... which fell through because the goofs higher up in the school district didn't send the excel spreadsheet on time.

Anyway, good memories mostly... although when I look at the code I almost barf, it makes me realize how much farther I can still go- I thought I was pretty good when I wrote, for example, a "Schedule" app for booking the non-dedicated computer labs at my old school, but I could practically rewrite the whole thing in a day now, and still it would be better.


I was trying to dereference Null Pointers before it was cool.

Geek-9pm

    Topic Starter

    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: For a newbie, C++ or Java or what?
« Reply #31 on: March 02, 2009, 09:33:50 AM »
This is all very interesting.  And it could illustrate why a Microsoft language is not a good place for a newbie to start out.
At first, the Microsoft Basic implementations were quite attractive.  But then as the operating system changed, Microsoft decided to make even more changes to Visual Basic.  More than perhaps needed to be a Basic language..
A student language has a strong structure and can do what it needs to do without the need to implement something different or deviant from the original design of that language.
Besides, there is usually some type of trapdoor available in most implementations to break out from the structure and do something in another language.  In the older versions of BASIC you could peek and poke and then call machine code and outperform some oddball thing.
Thank you all for your input.   :D

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: For a newbie, C++ or Java or what?
« Reply #32 on: March 02, 2009, 09:47:12 AM »
This is all very interesting.  And it could illustrate why a Microsoft language is not a good place for a newbie to start out.
At first, the Microsoft Basic implementations were quite attractive.  But then as the operating system changed, Microsoft decided to make even more changes to Visual Basic.  More than perhaps needed to be a Basic language..
A student language has a strong structure and can do what it needs to do without the need to implement something different or deviant from the original design of that language.
Besides, there is usually some type of trapdoor available in most implementations to break out from the structure and do something in another language.  In the older versions of BASIC you could peek and poke and then call machine code and outperform some oddball thing.
Thank you all for your input.   :D

you can still use ASM with VB6-

in fact I use it to subclass windows without crashing.

The trick is in the API call- you are "supposed" to pass in a pointer to a procedure that windows will call- but if you instead point it to a string variable with assembled ASM then it will actually execute the machine code that is present in the string variable.

But why the slimy hack? VB has an "AddressOf" operator, after all. The idea is to make it possible for class instances to subclass window messages, rather then require a Module to contain the WindowProc() and route the message to the proper Class instance based on the hwnd or something. Additionally it prevents the VB6 IDE from crashing during testing, since the ASM code remains in memory and is thus a valid JMP location throughout; before this "hack" the addressOf method was unstable during debugging, since pushing the stop button would mean that the  module containing the windowproc is unloaded- but windows still calls it for messages on the window, such as the WM_CLOSE message; it calls nonexistent code and crashes. HARD...


As far as "outperforming" the standard routines- this is generally quite easy via API routines. For example, instead of using DIR$, one can use the FindFirstFile(),FindNextFile() and FindClose() functions. This has the benefit of allowing recursive calls which aren't directly possible with DIR$() without cacheing folder names and recursing on them at the end of the procedure.

After dabbling with ASM for the subclassing code... well I think any future ASM work will avoid the windows platform...
I was trying to dereference Null Pointers before it was cool.

macdad-



    Expert

    Thanked: 40
    Re: For a newbie, C++ or Java or what?
    « Reply #33 on: March 02, 2009, 07:15:51 PM »
    Visual basic just seems to have added alot more that it's ancestor and smaller dialects of it.
    If you dont know DOS, you dont know Windows...

    Thats why Bill Gates created the Windows NT Family.