Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,629 members, 7,955,307 topics. Date: Saturday, 21 September 2024 at 10:04 PM |
Nairaland Forum / Science/Technology / Programming / Are Programmers Born Or Made? (15401 Views)
Are Programmers(coderz) The Smartest Type Of People On The Planet? (2) (3) (4)
(1) (2) (3) (4) (5) (6) (7) (8) (Reply) (Go Down)
Re: Are Programmers Born Or Made? by dtito(m): 9:02am On Aug 20, 2014 |
asalimpo:Lol. |
Re: Are Programmers Born Or Made? by dtito(m): 9:25am On Aug 20, 2014 |
MizMyColi: Okay, I'll send them @ work, I'll PM you first for your email addy. I live in Lagos, Nigeria.How r ya dear...just dey remind ya....hope u gud? |
Re: Are Programmers Born Or Made? by BabaGnoni: 12:20pm On Aug 21, 2014 |
@Ymodulus - Thanks! |
Re: Are Programmers Born Or Made? by Ymodulus: 2:20pm On Aug 21, 2014 |
BabaGnoni: @Ymodulus your phone no please. or can you check my profile and get mine?? |
Re: Are Programmers Born Or Made? by BabaGnoni: 2:44pm On Aug 21, 2014 |
Ymodulus:Please check your gmail addy Ymodulus. Thanks! |
Re: Are Programmers Born Or Made? by Ymodulus: 4:32pm On Aug 21, 2014 |
BabaGnoni: REPLIED YOU I Have corrected it and made the code smaller however i didnt test run it. but i believe this should work now <?php Class Ymodulus { public $newComers; public function welcomes(string $newComer) { return (in_array($newComers, $this->newComer) ? true : false; } } //Usage $ymodulus = new Ymodulus(); $ymodulus->newComers = ['MizMyColi', 'other New Bie']; $result = Ymodulus->welcomes('MizMyColi'); echo ($result === true ) ? 'MizMyColi Ymodulus welcomes you too the world of php': 'sorry not yet welcomed by ymodulus'; 1 Like |
Re: Are Programmers Born Or Made? by BabaGnoni: 5:22pm On Aug 21, 2014 |
Ymodulus: Ymodulus, thanks but the edit is still failing as seen above and the following below (i.e. FATAL ERROR syntax error, unexpected '[' on line number 7 ) The original one (i.e. the first one done) was failing with a different error (i.e. FATAL ERROR syntax error, unexpected ';' on line number 9) Maybe after going over it again, it'll be great, if you can comment what you're doing, as it seems you've used a class, public static function, maybe a constant, also seems an array etc and what the expected output should be PS: The corrected last one too (i.e. the below one) fails with: FATAL ERROR syntax error, unexpected ';' on line number 9 <?php Class Ymodulus { public $newComers; public function welcomes(string $newComer) { return (in_array($newComers, $this->newComer) ? true : false; } } //Usage $ymodulus = new Ymodulus(); $ymodulus->newComers = ['MizMyColi', 'other New Bie']; $result = Ymodulus->welcomes('MizMyColi'); echo ($result === true ) ? 'MizMyColi Ymodulus welcomes you too the world of php': 'sorry not yet welcomed by ymodulus'; ?> |
Re: Are Programmers Born Or Made? by BabaGnoni: 6:34pm On Aug 21, 2014 |
@Ymodulus, I give up, this is how I edited it: <?php // one of my edited earlier versions class Wannabephp { /*** define public properties ***/ /*** the newcomer of Wannabephp ***/ public $newcomer; /*** define public methods ***/ /*** method to find if newcomer to Wannabephp is welcomed or not ***/ public function find_newcomer($who_newcomer) { $this->newcomer = $who_newcomer; $check_newcomer = array('MizMyColi','other New Bie'); return (in_array( $who_newcomer,$check_newcomer)) ? true : false; } } //usage $wannabephp = new Wannabephp (); $wannabephp-> newcomer = 'MizMyColi'; $wannabephp-> check_newcomer = array('MizMyColi', 'other New Bie'); $result = $wannabephp->find_newcomer('MizMyColi'); if($result === true ){ echo 'MizMyColi, Ymodulus welcomes you too the world of php'; }else{ echo ' sorry not yet welcomed by ymodulus'; } ?> and here's a second or another another edited version which outputs as above (i.e. MizMyColi, Ymodulus welcomes you too the world of php ) but with the below tagging along: NOTICE Undefined variable: other_newcomer on line number 13 <?php /*** define class ***/ class Wannabephp { /*** define public properties ***/ /*** the newcomer to Wannabephp ***/ public $newcomer; /*** define public methods ***/ /*** method to find if newcomer to Wannabephp is welcomed or not ***/ public function find_newcomer($who_newcomer){ //$this->newcomer = $who_newcomer; $check_newcomer = array($who_newcomer, $other_newcomer); return (in_array( $who_newcomer,$check_newcomer)) ? true : false; /*** not sure above line's needed, as in this line $this->newcomer = $who_newcomer; Works though, still stored in memory Works though when not commented, as will be stored in memory Sorry it's a bit messy LOL**/ } } //usage $wannabephp = new Wannabephp(); // $wannabephp-> newcomer = 'MizMyColi'; //$wannabephp-> check_newcomer = array('MizMyColi', 'other newbie'); $result = $wannabephp->find_newcomer('MizMyColi'); if($result === true ){ echo 'MizMyColi, Ymodulus welcomes you too the world of php'; }else{ echo ' Sorry not yet welcomed by Ymodulus'; } ?> Comment(s) and/or correction(s) welcome |
Re: Are Programmers Born Or Made? by Ymodulus: 12:45pm On Aug 22, 2014 |
Its correct. I can see you are using php5.3 tester. Prior to php5.3 arrays are in this format. $newComers =array ('MizMyColi', 'etc'); From Php 5.4 above we had $newComers = ['MizMyColi', 'etc']; Its called short array syntax. Php were trying to copy Python way of dictionaries. http://php.net/manual/en/migration54.new-features.php You understand now?? <?php Class Ymodulus { /** * This properties is meant to hold a list of new comers */ public $newComers; /** * This method is meant to determine if a student is in the list of newcomers *@Param string $newComer | i casted the variable to always return a string. *@return boolean. true|false. true if name is in list of newComers and false if its not. */ public function welcomes(string $newComer) { # here i am checking for the user inputed name in the array. Note am using the short form of if / else statement. return (in_array($newComers, $this->newComer)) ? true : false; } } //Usage $ymodulus = new Ymodulus(); $ymodulus->newComers =['MizMyColi', 'other New Bie']; $result = Ymodulus->welcomes('MizMyColi'); echo ($result === true ) ? 'MizMyColi Ymodulus welcomes you too the world of php': 'sorry not yet welcomed by ymodulus'; |
Re: Are Programmers Born Or Made? by dasanchez1(m): 5:46pm On Aug 22, 2014 |
Ymodulus: Its correct.this is my first time on this section. Ymodulus{ great oga boss},u gat knowledge for advance import biz and programming; this one is strong. wicked combination i swear. your tips has really made me what i am 2day. so happy to learn from your words of advice.[ i keep on saying this everywhere i go ]. i will pay you back one day by the grace of God. THANK YOU . |
Re: Are Programmers Born Or Made? by BabaGnoni: 5:59pm On Aug 22, 2014 |
Ymodulus: Its correct. Ymodulus thanks again but still no joy yet... Yep, I did notice the short form if/else conditional statement however as seen from the above screenshot capture, whether it's PHP 5.4 or 5.5, it is still failing with the above error message - when 5.4 is used, a different error message to when 5.5 is displayed |
Re: Are Programmers Born Or Made? by Ymodulus: 5:18am On Aug 23, 2014 |
BabaGnoni: ok. i had to fire up my server, text editor and browser and i had to test the code this time. see ---------------------------------------------------------------------------------------------------------------- <?php Class Ymodulus { /** * This properties is meant to hold a list of new comers */ public $newComers; /** * This method is meant to determine if a student is in the list of newcomers *@Param string $newComer | i casted the variable to always return a string. *@return boolean. true|false. true if name is in list of newComers and false if its not. */ public function welcomes( $newComer) { # here i am checking for the user inputed name in the array. Note am using the short form of if / else statement. return (in_array($newComer, $this->newComers)) ? true : false; } } //Usage $ymodulus = new Ymodulus(); $ymodulus->newComers =['MizMyColi', 'other New Bie']; $result = $ymodulus->welcomes('MizMyColi'); echo ($result === true ) ? 'MizMyColi Ymodulus welcomes you too the world of php': 'sorry not yet welcomed by ymodulus'; [size=14pt]# Now this is bug free and it works. i tested it myself[/size] |
Re: Are Programmers Born Or Made? by Ymodulus: 5:31am On Aug 23, 2014 |
dasanchez1: this is my first time on this section. Ymodulus{ great oga boss},u gat knowledge for advance import biz and programming; this one is strong. wicked combination i swear. your tips has really made me what i am 2day. so happy to learn from your words of advice.[ i keep on saying this everywhere i go ]. i will pay you back one day by the grace of God. THANK YOU . thanks |
Re: Are Programmers Born Or Made? by Ymodulus: 6:33am On Aug 23, 2014 |
Re: Are Programmers Born Or Made? by dasanchez1(m): 6:52am On Aug 23, 2014 |
Ymodulus:indeed |
Re: Are Programmers Born Or Made? by BabaGnoni: 7:31am On Aug 23, 2014 |
Ymodulus: Sweet success! Yep it is now. Ran it myself and as seen above, it worked like a charm (i.e. the $ymodulus handle on line 30 did it) Thanks Ymodulus. You the man! Cheers |
Re: Are Programmers Born Or Made? by Ymodulus: 8:26am On Aug 23, 2014 |
BabaGnoni: Thanks you welcome. if i might ask why were you so interedted in the codes? |
Re: Are Programmers Born Or Made? by BabaGnoni: 6:29pm On Aug 23, 2014 |
Ymodulus: The OOP syntax used in it. |
Re: Are Programmers Born Or Made? by Ymodulus: 7:25pm On Aug 23, 2014 |
BabaGnoni:ok. you just learning oop? |
Re: Are Programmers Born Or Made? by kaboninc(m): 8:04am On Aug 25, 2014 |
Biko everybody let's get back to the topic. 1 Like |
Re: Are Programmers Born Or Made? by elvis10ten(m): 8:55pm On Aug 25, 2014 |
read this at op. 1 Like
|
Re: Are Programmers Born Or Made? by MizMyColi(f): 11:26am On Aug 26, 2014 |
Thank You. elvis10ten: read this at op. |
Re: Are Programmers Born Or Made? by elvis10ten(m): 4:37pm On Aug 26, 2014 |
MizMyColi:ur welcome 1 Like |
Re: Are Programmers Born Or Made? by dtito(m): 4:36pm On Sep 02, 2014 |
MizMyColi:hello miz...stilll waiting for d e-books....tanx |
Re: Are Programmers Born Or Made? by MizMyColi(f): 4:45pm On Sep 02, 2014 |
Oh my! So sorryy Please indicate which and your email addy. I to'ally forgot, again! . dtito: hello miz...stilll waiting for d e-books....tanx |
Re: Are Programmers Born Or Made? by dtito(m): 6:20pm On Sep 02, 2014 |
[quote author=MizMyColi] Oh my! So sorryy Please indicate which and your email addy. I to'ally forgot, again! .[/quote OReilly.Head.First.iPhone.Development.pdf OReilly.Head.First.HTMLwithCSSXHTML.pdf OReilly.Head.First.A.Learner's.Guide.to.Programming.Using.the.Python.Language.pdf OReilly,.Head.First.Software.Development.(2007).[0596527357].pdf OReilly.Head.First.Networking.pdf Dunagha@gmail.com |
Re: Are Programmers Born Or Made? by Nobody: 12:29pm On Sep 03, 2014 |
Good question bro and kudos to the dope guys with nice comments. To me I believe programmers are d people that that understand why " 2 + 2 = 4 " , The truth behind programming is mathematics (application of mathematical theory to solve a problem) simple! I started web technology at the age of 19 before I gain admission to study computer science am saying this so that you can pick somethings ok, if you don't love the game don't waste your time playing it. Am not saying that you must study computer science for you to become a programmer but if you want to become a successful one you must study something related to computer science and or mathematics. And if u are not that good in mathematics like me (*smile*) dnt let it put you down all need to do is to create for love for it. Am a singer but I also develop myself as a programmer and at 22 I publish my first window app "Atoxx" a web browser in which we use in my department laboratory to surf d internet and also a multimedia player. So bro don't give up and never stop learning. By time I wil be 25 hmmmm let me keep that to myself...na naija we dey. I was not born as a programmer but I was made one. " There are so many to ways to get " 4"as answer in mathematics " - fred eto |
Re: Are Programmers Born Or Made? by asalimpo(m): 1:01pm On Sep 03, 2014 |
fredeto: Good question bro and kudos to the dope guys with nice comments.kudos. Your web browser. Y does'nt ur dept use available ones: opera,firefox,ie etc ? By the time ur 25 we'll b here to celebrate with you. Keep truckg. |
Re: Are Programmers Born Or Made? by LordRahl001: 9:05am On Sep 06, 2014 |
I think the more u give sm1 freedom, the harder it is to comply or understand!! What am saying is in programming, there is freedom of expression, it doesn't matter how u solve d question, as long as u arrive @ d correct answer and it gets d job done, then its fine at first!! The human mind is so adapted to following defined rules which is what makes programmers different!! So if u can get out of d barrier of basic thinking, norms, as usual and reason in a whole new direction, new ways to solve a problem, and u could involve urself in creative thinking then u r gud!! Its not learning d language that's d ish, its actually abt solving a real-life problem wit it that matters!! Cheers |
Re: Are Programmers Born Or Made? by dtito(m): 4:36pm On Sep 07, 2014 |
MizMyColi: i wanna remind you to send me does eboks as u promised....i know u busy..tanks |
Re: Are Programmers Born Or Made? by dtito(m): 11:21am On Sep 09, 2014 |
pls anybody should help me with pdf on web develpment, software develpment etc.. i really need it.....the OP dey too busy to remember ma request to her.....anyon pls.....dunagha@gmail.com |
Re: Are Programmers Born Or Made? by dtito(m): 1:52pm On Sep 09, 2014 |
MizMyColi: OReilly.Head.First.iPhone.Development.pdf OReilly.Head.First.HTMLwithCSSXHTML.pdf OReilly.Head.First.A.Learner's.Guide.to.Programming.Using.the.Python.Language.pdf OReilly,.Head.First.Software.Development.(2007).[0596527357].pdf OReilly.Head.First.Networking.pdf Dunagha@gmail.com Tanx sweet |
(1) (2) (3) (4) (5) (6) (7) (8) (Reply)
Coders, How Long Do Your Laptop Batteries Last? / Creating An Open-source Java Web Service / [Tutorial Post] How To Integrate Paystack Payment System With PHP
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 87 |