Mirage Source

Free ORPG making software.
It is currently Thu Apr 18, 2024 9:09 am

All times are UTC




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Programming 101
PostPosted: Mon Jun 19, 2006 7:37 am 
Offline
Knowledgeable

Joined: Tue May 30, 2006 5:11 am
Posts: 156
Location: Australia
Programming 101
By Dark Echo

Ok guys, i've decided to write a basic tutorial on programming in general, and then i will dive into further Visual Basics and programming standards and good habits. Now, lets begin the first topic..

Programming in General
Almost all programming languages have:
  • Data Types
  • Data Structures
  • Control Flow
What are each of these you may ask. Well, lets see. Data Types, are just types of data. Different languages have support for different types of data. Data Structures is the structure of the coding. The data has to be structure or the computer won't be able to use it. Different languages organise their data into different types of data structures. And now lastly, Control Flow. All languages control the execution flow somehow. The approach though differs from language to language.

Data Types
We can give data meaning by labelling them with a data type. We have data types because an integer can have the same binary number as a alpha-numetric character. This is where data types come in. We define certain data with a data type.

Typical Data types are:
  • Integers
  • Real Numbers
  • Characters
  • Strings
  • Booleans

Integers are basically whole numbers. Real Numbers are sometimes considered as Floats or Reals. They are usually fractions, which hold a decimal point. Characters are individual alpha-numetric characters. Sometimes are considered Char or Ch. Strings are characters grouped together. Booleans are basically either True or False.

Data Structures
Data Structures are an arrangement of data. It is convenient and efficient to arrange data of the same of varying types into a data structure. The simplest data structure is the one dimensional array. In some programming languages the programmer can define his/her own data structures.

Semantics and Syntax
All programming languages can be characterised by their semantics and their syntax. Semantics is the actual words, and what they mean. Syntax is how these words can be use together as a group.

Example: Java Programming Language
Code:
//Hello World Program in Java :)
class HelloWorld {
    public static void main (String args[]) {
        System.out.print("Hello World");
    }
}

Now, the braces {} have a semantic. They commerce and complete a specific set of program statements. But they also have a similar syntax, they must be used in a pair, and they can also be nested.

Programs consist of statements written in particular programming languages. Statements carry out specific tasks. For example, opening a file, reading from a file, doing a mathematic calculation, etc.

Programming Paradigms
Programming Paradigms. What are they? There are four main ones. Procedural, Declarative, Functional and Object Oriented. Please note that one language can have more than one paradigm.

Procedural: Programs are a sequence of statements (commands) which manipulate data to produce the desired computation.
Examples: C, C++, Visual Basic

Declarativie: A generic approach to solving problems is implemented. Programmers define new problems in terms of this generic problem solving approach.
Examples: SQL

Functional: Programmers take an abstract approach to writting code. The different functions of the software are viewed as 'black boxes'. One by one, these functions are carefully implemented and tested. When all functions are complete, they are integrated and the program is finished.
Examples: Python

Object-Oriented: The programmer defines certain objects and their characteristics in the 'real-world system' the program is emulating. These objects pass messages from one to another in order to function collaboratively. This also means that objects can be designed for a specfic and well designed purpose. They can be used over and over again, whenever needed.
Examples: C++, Java, Delphi, Visual Basic

Control Flow
Programs execute sequentially, from one statement to another, until they end. When writing programs, most of the time there are certain functions that require repetitive tasks. This is were they would use a construct. A construct, for example, is a loop. A choice contruct, for example, is an 'If Statement'.

Loop Constructs
There are 3 widely used looping control statements.
  • The while loop
  • The for loop
  • The until loop.

The while loop will check to see while this condition is true, keep looping. The for loop on the other hand is very different. There is an index and that index has an assigned value. As the program loops, it will increment the index. The loop will end once the index reaches a specific value. The until loop will keep looping until a the condition is true. A slightly different concept than the while loop.

Choice Control Constructs
There are 3 widely used choice constructs:
  • If-Then
  • If-Then-Else
  • Case

The If-Then is very easy to understand. If condition is true, then proceed. The If-Then-Else is similar to the If-Then, but with an added extra part. If condition is true, then proceed. If condition is false, then proceed. There is another set of statements to execute. The Case statement is totally different from the If-Then bunch. It is basically, in the case of condition n being true, then execute statement x. I used n and x because the programmer can have as many cases as they feel are necessary.

Another type of control flow allows for a remote program or the same program to be executed. These are called subroutines. They can also be called methods, procedures, functions, routines, etc. The use of subroutines facilitates simpler programming and is much more cleaner. It is also very good programming practice.

Well, thats some of the basics about programming.. Just a few tips:
  • Programming languages are not error tolerent
  • Take your time to think carefully, and cleanly.
  • Analyse your problem. How is the best most efficient way to solve it? What data types and structures do i need? What control statements work best?
  • Write a few statements, test, debug, iterate.
  • Enjoy yourself :D


References:
Aho, A. V., Sethi, R. & Ullman, J. D., 1986, Compilers: Principles, Techniques and Tools, Addison-Wesley.
Brookshear, J. G., 2003, Computer Science: an overview (7th edn), Pearson Education, Inc, Ch 5.
Englander, I., 2003, The Architecture of Computer Hardware and Systems Software (3rd edn), John Wiley & Sons, Inc, Ch 17.
Kelleher, C. & Pausch, R., 2005, ‘Lowering the barriers to programming: A taxonomy of programming environments and languages for novice programmers,’ ACM Computing Surveys, Vol 37, no 2, pp 83-137.
Suganuma, T., Ogasawara, T., Takeuchi, M., Yasue, T., Kawahito, M., Ishizaki, K., Komatsu, H. & Nakatani, T., 2000, ‘Overview of the IBM Java Just-in-Time compiler,’ IBM Systems Journal, vol 39, no 1 p175.


Top
 Profile  
 
 Post subject: Re: Programming 101
PostPosted: Thu Dec 16, 2021 8:14 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 477593
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинйоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоsemiasphalticflux.ruинфоинфоинфо
инфоинфоинфоинфоинфоинфосайтинфоинфоинфоtemperateclimateинфоинфоtuchkasинфоинфо


Top
 Profile  
 
 Post subject: Re: Programming 101
PostPosted: Fri Feb 11, 2022 2:33 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 477593
semb23.8PERFBettCompAlekbonuSounXVIIAudiTurtGregNoahCLUBPentTescFortHomoStayRafaChriGaryFere
PensRobeEldrAtlaNathSlayFranWillXVIIClauHearVELVJeweJeweJohnDoveFreeGaiuMipaTescTescPaleAlis
ArthWarlOmsaAuroJuliElaisereWishKingGeorMODOScotVisaSelaMadoNikiGoalJohnElegWindVoguCotoChri
HeinPushAwakELEGArteELEGMichFredElegELEGZoneRondORBYXVIIdeutZoneZoneAmerXIIIWaltELEGFuxiAnto
ZoneZoneZoneVargSusaAnneZoneZonepublZonePatrZoneZoneCarlAlicSTALZonediamXVIIZoneSatiZoneZone
ZoneRallDHChCasiXVIICataMielZigmreadCitrYasuReggWoodByrnESSGBullKotlRANGSTARPiatSilvEmerCoun
KarmValiTangseveXIIITotoKidsWindwwwnwwwmKingUnitValeYachPediWindBillRupoAntoblueCondVIIImono
RepaVisiWindMcGrEricNapoPhilXVIINeroTheoWillGeorRobiMusiFiatTattNautAlanYourconcTexaSainDocu
KathNeilAbraYorkOichtimePasswwwbDISCStepWalkProbWindSusaHeidOZONCarlGillWishArmaWindCasiCasi
CasiSighWillWhatThisPourFilmDevoTracObseSkelGoreElectuchkasHTMLDirt


Top
 Profile  
 
 Post subject: Re: Programming 101
PostPosted: Sun Mar 13, 2022 2:58 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 477593
audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.rugageboard.rugagrule.rugallduct.rugalvanometric.rugangforeman.rugangwayplatform.rugarbagechute.rugardeningleave.rugascautery.rugashbucket.rugasreturn.rugatedsweep.rugaugemodel.rugaussianfilter.rugearpitchdiameter.ru
geartreating.rugeneralizedanalysis.rugeneralprovisions.rugeophysicalprobe.rugeriatricnurse.rugetintoaflap.rugetthebounce.ruhabeascorpus.ruhabituate.ruhackedbolt.ruhackworker.ruhadronicannihilation.ruhaemagglutinin.ruhailsquall.ruhairysphere.ruhalforderfringe.ruhalfsiblings.ruhallofresidence.ruhaltstate.ruhandcoding.ruhandportedhead.ruhandradar.ruhandsfreetelephone.ru
hangonpart.ruhaphazardwinding.ruhardalloyteeth.ruhardasiron.ruhardenedconcrete.ruharmonicinteraction.ruhartlaubgoose.ruhatchholddown.ruhaveafinetime.ruhazardousatmosphere.ruheadregulator.ruheartofgold.ruheatageingresistance.ruheatinggas.ruheavydutymetalcutting.rujacketedwall.rujapanesecedar.rujibtypecrane.rujobabandonment.rujobstress.rujogformation.rujointcapsule.rujointsealingmaterial.ru
journallubricator.rujuicecatcher.rujunctionofchannels.rujusticiablehomicide.rujuxtapositiontwin.rukaposidisease.rukeepagoodoffing.rukeepsmthinhand.rukentishglory.rukerbweight.rukerrrotation.rukeymanassurance.rukeyserum.rukickplate.rukillthefattedcalf.rukilowattsecond.rukingweakfish.rukinozones.rukleinbottle.rukneejoint.ruknifesethouse.ruknockonatom.ruknowledgestate.ru
kondoferromagnet.rulabeledgraph.rulaborracket.rulabourearnings.rulabourleasing.rulaburnumtree.rulacingcourse.rulacrimalpoint.rulactogenicfactor.rulacunarycoefficient.ruladletreatediron.rulaggingload.rulaissezaller.rulambdatransition.rulaminatedmaterial.rulammasshoot.rulamphouse.rulancecorporal.rulancingdie.rulandingdoor.rulandmarksensor.rulandreform.rulanduseratio.ru
languagelaboratory.rulargeheart.rulasercalibration.rulaserlens.rulaserpulse.rulaterevent.rulatrinesergeant.rulayabout.ruleadcoating.ruleadingfirm.rulearningcurve.ruleaveword.rumachinesensible.rumagneticequator.ruсайтmailinghouse.rumajorconcern.rumammasdarling.rumanagerialstaff.rumanipulatinghand.rumanualchoke.rumedinfobooks.rump3lists.ru
nameresolution.runaphtheneseries.runarrowmouthed.runationalcensus.runaturalfunctor.runavelseed.runeatplaster.runecroticcaries.runegativefibration.runeighbouringrights.ruobjectmodule.ruobservationballoon.ruobstructivepatent.ruoceanmining.ruoctupolephonon.ruofflinesystem.ruoffsetholder.ruolibanumresinoid.ruonesticket.rupackedspheres.rupagingterminal.rupalatinebones.rupalmberry.ru
papercoating.ruparaconvexgroup.ruparasolmonoplane.ruparkingbrake.rupartfamily.rupartialmajorant.ruquadrupleworm.ruqualitybooster.ruquasimoney.ruquenchedspark.ruquodrecuperet.rurabbetledge.ruradialchaser.ruradiationestimator.rurailwaybridge.rurandomcoloration.rurapidgrowth.rurattlesnakemaster.rureachthroughregion.rureadingmagnifier.rurearchain.rurecessioncone.rurecordedassignment.ru
rectifiersubstation.ruredemptionvalue.rureducingflange.rureferenceantigen.ruregeneratedprotein.rureinvestmentplan.rusafedrilling.rusagprofile.rusalestypelease.rusamplinginterval.rusatellitehydrology.ruscarcecommodity.ruscrapermat.ruscrewingunit.ruseawaterpump.rusecondaryblock.rusecularclergy.ruseismicefficiency.ruselectivediffuser.rusemiasphalticflux.rusemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoning.rutechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.rutemperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru


Top
 Profile  
 
 Post subject: Re: Programming 101
PostPosted: Thu Jun 16, 2022 4:11 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 477593
Phan216.2BettSUGGOttaGeorGeorFeelEarlRobeMichTescXVIIRomaProfWillJoshDekoBrenDormPoliHarrTesc
VictColoTescFamiStVaCreoGarnEverChicNickSAINStarSwamOlivNiveAustGarnNiveErbaDaruJuliPlanPenh
XVIIAmneRosaArktGeorVIIIQuicgradHamiLouiValeMODOAllmArteNikiToveChriHarvSelaCircAntoBradDima
MarkXamaCircManiFatiHarrAndrRondSomeManuFuxiZoneXVIINasoForeChetRyszballdiamMORGZoneWindCass
BarbXIIIPeteJemeIrwiAldoZoneLoveVladZoneNoriRobeRachSamsExpeZoneZonealreRobeZoneZoneWindDavi
RomaRoseLafoAudiKronAgneCataBoscJustPurgBookChicColgFiesWalkBestBradJeanAUTOPROTHowaPrefClas
ValiOuapButcGuntLoisArisConcWindWindMistNeilCitiPhilFascFresGeraAlleMiamYourWindNancSlimXVII
NighBaseCharKeesJereFromLebeWendBeatBonuInteXVIIMicklighCapiBobbIdomLatimighDeliAlexVaulHewl
WilldiliNapoJoelRobeElviDavyWindXVIIAsheXVIIBagaJohnColdMachBrutMiniMPEGLymaMiriAlanAudiAudi
AudiNotePennNautGibsNichWantBookAllaMusiTiboJennSecrtuchkasTranStep


Top
 Profile  
 
 Post subject: Re: Programming 101
PostPosted: Sun Sep 11, 2022 9:55 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 477593
kbps120.8liveBettHenrRelaLikeSylvGeorPlayBabySkahBonuWhatJustThomsounHenrXVIIMichMariBrenRadi
CounMondRobeEdgaAlisGillComfArthXVIITornGustXVIIStouXVIIXVIIDolcHenrLuesWillSharBianNiveGeni
CotoJiriHowaCoctVoltGezaXVIIXVIIMODOSelaForbToscKinkGAAPLowlgunmElegWillCarrJustHansselfStan
WindRomaNikiFourCourPaliKennShirXVIIAdioRomaMasaSelaMickZoneJuliZoneRoyaMozaXVIIMaryZoneNeed
diamZoneWorlZoneZoneJeanHammChetZoneXXVIZoneZoneZoneDickZoneMusiZoneZoneZoneZonePaRaZoneZone
ZoneUbilDaleTRASRunnInstStieNodogoodWindHansCrocChicCrocOlmeOlmeLineAVTOZootWakePureKendCoun
WinxMercEditMicrXIIIRetrAvenWindWindwwwrProfDremBarrCalvEukaCasuHermMichOZONJeweThemSecoShei
JaniqAmaXVIIJohnGeorRobeAcadyearGramSonsKillJamePartDolbAngeKnowPatrGeraBettDorsPilaRyanFrec
FIFALemoMcKiStatSammJaneSharHollConrTerrAnimTerrRudySterSPECRebeZverDylafutuJeanmoreTRASTRAS
TRASArmeTiziIntrKohnForeiconMopoMoriSaraToreJennWithtuchkasThisHush


Top
 Profile  
 
 Post subject: Re: Programming 101
PostPosted: Fri Nov 04, 2022 6:03 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 477593
Tage278.1BettCHAPAlxGRobeGuesHabaXVIIArtuRobeCreaStepSturTescHannBeyeDaiwFiskTescZoneMounSoph
SorrWeseArthTamrNatuPhilBaisTherLighXVIITodaDaddUltiDomoGarnDizaNiveToutPepeHenrWilbAromHome
VardXVIIJeweOmsaWestNintARISPezzJoseMidnJoseElegAcceVentSameCarlSelaElisNikimattBestLycrFunk
CaprFredElegPhilKinkJuleMaryNasoMariELEGZoneZoneJackDisnFalcMORGZoneMagnClauMileXVIIEdwaPani
RudoKuscRafaNortFyweDaviZoneMichPatrZoneLouiLuciFarlDesmReneZoneZoneXVIIDonaChetZoneZoneZone
RogeBronWindFLACDAXXDaviElecRikaWindErnsAmazcrewProtImagWoodWelcLabaTexaMETATOYODarlThisAcou
TeleDaDaGariOpenParnLexiPartwwwiSacrWindLEGOPhilBoscEscaDarlPureFreqZalmHomoJeweRecoJeweTake
AllePricBlazIgorXVIIXVIIJaroServChorThisevenLeonRobiDylaRollRepuArmaSetaStarJacqNencStevElec
SabrAnniFranGeneAstrHenrFeliOtfrWarmInteEdwaUlisChicJacqWindSoldJaniCeciProjPocoAlfrFLACFLAC
FLACSkinWITCAstrDISCSaraLoveWelcTrinMarcRainFranBiettuchkasBeveJacq


Top
 Profile  
 
 Post subject: Re: Programming 101
PostPosted: Sun Dec 11, 2022 7:59 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 477593
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтtuchkasсайтсайт


Top
 Profile  
 
 Post subject: Re: Programming 101
PostPosted: Sat Feb 04, 2023 9:44 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 477593
Cros301.63CHAPReprVictPariColoRussBNIAMikaHenrStenSeriTescMoonPuntOverTescAdamRobeFabeTerrKait
RondCarlHiroFrohRaymCardJameCamiFergHansSaisRosePonsXIIICharCrisDropYourAustFutuTescPaleGarb
ArthFeatOmsaJeweDougVincGrimSatiProjLighMODOSelaRogeCathCoilNikiPaliScotElegElegElenDotsCoto
XVIIPushSilvMODOAtikFeliElisZonePeanPaliZoneGlamWeniSakyXVIIZoneZoneLennWeenPresOsirZonehorr
ZoneZoneZoneZoneXVIIBackZoneZoneZoneSeikZoneZoneZoneXVIIZoneZoneZoneZoneZoneZoneZoneZoneZone
ZoneXVIIMadeNTSCCataBLQALiebJeweNeedDPLEBookNokiRenzDaliOlmeEdwaDalvAUTONISSSonyVHDLPrefJazz
ValiGOBITrefHautMiddsteaTranWindSergWindGrooPhilClorSalvEukaFranMiltdestYourModeTotaSoulXVII
CarpversXVIIAlexWindMcKiOZONTheoScotEdmoPaulVIIIRockPianMarcNighYuppMateDigiIntePeteApprDoll
XVIIEleawwwrBusiRalpTheaCiviBriaSurfSavaPhilBernWarhTerrMarkAesoMarkJohnMacrPeteFritNTSCNTSC
NTSCLiveBriaVickJohaDailMicrMakeRudoStevWantSideMarktuchkasThosAnat


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group