General question for programmers

General technological topics without their own forum go here

Re: General question for programmers

Post by centip3de on Mon Jan 28, 2013 12:33 am
([msg=72752]see Re: General question for programmers[/msg])

KthProg wrote:In order to get really good at programming you have to code realistic useful programs on a regular basis and challenge yourself by learning new concepts.
For instance, I'm still not very good at image manipulation, so im going to make a "paint" program to learn the namespaces.


A paint program is not image manipulation... It's just a canvas that you draw on, and then save your changes in the proper format. Also, what do you mean by, "learn the namespaces"? Like, namespaces in C++?

This post confuses me.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rick Cook
User avatar
centip3de
Moderator
Moderator
 
Posts: 1412
Joined: Fri Aug 20, 2010 5:46 pm
Blog: View Blog (0)


Re: General question for programmers

Post by KthProg on Mon Jan 28, 2013 7:32 pm
([msg=72814]see Re: General question for programmers[/msg])

A namespace is a portion of a library (or framework) intended for a specific purpose...?
I mean it differs between languages but the basic idea is usually the same.
I dont see whats so confusing.

the system.drawing namespace is for (nearly) all things graphics related in .NET.

paint programs are known as 'image manipulation programs'.
I obviously dont have the time to make something like GIMP but GIMP is just an extension of the basic architectures used in a simple program like paint except that GIMP also uses different linear transformations on the pixels to produce effects.
Now maybe you could be confused but a namespace is a pretty standard thing in programming I dont know what it means in C++.

-- Mon Jan 28, 2013 7:34 pm --

also: creating a program with a canvas that allows drawing of different shapes and saving in different file formats is image manipulation. It might not directly be used to edit anything except a blank canvas, but you would learn the methods and classes involved in image editing by creating this tyep of program
User avatar
KthProg
Poster
Poster
 
Posts: 219
Joined: Wed Jan 23, 2013 7:06 pm
Blog: View Blog (0)


Re: General question for programmers

Post by -Ninjex- on Mon Jan 28, 2013 7:43 pm
([msg=72820]see Re: General question for programmers[/msg])

KthProg wrote:I dont know what it means in C++


In C++ namespaces allows you to group things such as classes, objects and functions under a name. This makes the global scope divisible into "sub-scopes", allowing them to have their own name.
If you're not willing to learn, no one can help you. If you're determined to learn, no one can stop you.⠠⠵
The absence of evidence is not evidence of absence.
I can explain it for you, but I can't understand it for you.
User avatar
-Ninjex-
Addict
Addict
 
Posts: 1204
Joined: Sun Sep 02, 2012 8:02 pm
Blog: View Blog (0)


Re: General question for programmers

Post by KthProg on Mon Jan 28, 2013 8:00 pm
([msg=72829]see Re: General question for programmers[/msg])

lol haha ok well it's the same thing in VB but I think it's very rare for someone to create their own namespace and they are preset.

Generally objects are considered the highest on the hierarchy in VB and C#. This is probably because they are higher level programming languages i.e. less customization, less ability to communicate with hardware but more suited for applications.

I can see how that would be confusing.
User avatar
KthProg
Poster
Poster
 
Posts: 219
Joined: Wed Jan 23, 2013 7:06 pm
Blog: View Blog (0)


Re: General question for programmers

Post by fashizzlepop on Mon Jan 28, 2013 8:01 pm
([msg=72831]see Re: General question for programmers[/msg])

KthProg wrote:Generally objects are considered the highest on the hierarchy in VB and C#.

Absolutely false. Namespaces are HUGE in C#.

By huge I don't mean all encompassing, I mean they are very important and critical.
The glass is neither half-full nor half-empty; it's merely twice as big as it needs to be.
User avatar
fashizzlepop
Developer
Developer
 
Posts: 2303
Joined: Sat May 24, 2008 1:20 pm
Blog: View Blog (0)


Re: General question for programmers

Post by KthProg on Mon Jan 28, 2013 8:06 pm
([msg=72832]see Re: General question for programmers[/msg])

it could just be the way i program ( i might as well be using Visual FORTRAN) lol
but ive never seen someone create their own namespace and I've honestly rarely needed to create a new class even, and this is while developing an email application.

Of course my applications are awfully messy (to other people not me lol) so maybe I ought to get more educated on OOP
User avatar
KthProg
Poster
Poster
 
Posts: 219
Joined: Wed Jan 23, 2013 7:06 pm
Blog: View Blog (0)


Re: General question for programmers

Post by fashizzlepop on Mon Jan 28, 2013 8:10 pm
([msg=72833]see Re: General question for programmers[/msg])

You aren't programming in OOP if you aren't creating your own classes.
The glass is neither half-full nor half-empty; it's merely twice as big as it needs to be.
User avatar
fashizzlepop
Developer
Developer
 
Posts: 2303
Joined: Sat May 24, 2008 1:20 pm
Blog: View Blog (0)


Re: General question for programmers

Post by KthProg on Mon Jan 28, 2013 8:16 pm
([msg=72834]see Re: General question for programmers[/msg])

Well i think unneccesary classes and functions tend to make things jump from place to place as well as be much much larger,not doing this is probably part of the reason why my program opens in under a second. I do think my programs run faster because of the way I program, but i also do think that it makes it very difficult when you get to the final steps in developing an application and REALLY difficult when you need to debug or edit code.

I think it's more the fact that I'm never sure where to use them. I started out programming in VBA which doesnt really have full support for OOP so even though I have a really strong grasp of the concepts I'm just never sure where its appropriate to make a Class or namespace, though I do use functions and subs pretty heavily and I label things and use multiple handlers so I can use one piece of code for each simple event.

If you have advice im open to it lol.
User avatar
KthProg
Poster
Poster
 
Posts: 219
Joined: Wed Jan 23, 2013 7:06 pm
Blog: View Blog (0)


Re: General question for programmers

Post by -Ninjex- on Mon Jan 28, 2013 8:20 pm
([msg=72835]see Re: General question for programmers[/msg])

A example of this in C++ would be

Code: Select all
namespace number {
int num;
}


Within the block, identifiers can be used exactly as they are declared. However, outside of the block, the namespace specifier has to become prefixed. i.e. outside of the number block, num must be written as number::num to be accessed. However, in C++ adding the construct
Code: Select all
using namespace number;
makes it less verbose, and easier to read. It becomes helpful...

[Edit] Also it is helpful to avoid naming collisions

car::type, the identifier toyota refers to car::type::toyota. If car::type::toyota doesn't exist, it then refers to car::toyota. If neither car::type::toyota nor car::toyota exist, toyota refers to ::toyota, an identifier in the global namespace.
Last edited by -Ninjex- on Mon Jan 28, 2013 8:25 pm, edited 1 time in total.
If you're not willing to learn, no one can help you. If you're determined to learn, no one can stop you.⠠⠵
The absence of evidence is not evidence of absence.
I can explain it for you, but I can't understand it for you.
User avatar
-Ninjex-
Addict
Addict
 
Posts: 1204
Joined: Sun Sep 02, 2012 8:02 pm
Blog: View Blog (0)


Re: General question for programmers

Post by KthProg on Mon Jan 28, 2013 8:22 pm
([msg=72836]see Re: General question for programmers[/msg])

ah yeah! like an
Code: Select all
import
statement in VBDotNet
lol i see the connection
User avatar
KthProg
Poster
Poster
 
Posts: 219
Joined: Wed Jan 23, 2013 7:06 pm
Blog: View Blog (0)


PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 0 guests