₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,327,277 members, 8,430,150 topics. Date: Friday, 19 June 2026 at 11:33 PM

Toggle theme

Seun's Posts

Nairaland ForumSeun's ProfileSeun's Posts

1 2 3 4 5 6 7 8 ... 546 547 548 549 550 551 552 553 554 (of 1138 pages)

WebmastersRe: CSS Layout Debate by Seun(mod): 2:21pm On Dec 09, 2008
List elements can be used with great success in certain unconventional places: site menus, for example.
But for basic layout, I'll have to recommend that the DIV element, because that's precisely what it's for.
ProgrammingRe: New To Programming by Seun(mod): 1:42pm On Dec 09, 2008
I see your point, but I learnt BASIC very early and that didn't stop me from learning C and C++ later.

If you start with Python and you need something Python doesn't offer, you can just get Visual Studio (C#).
ProgrammingRe: New To Programming by Seun(mod): 12:28pm On Dec 09, 2008
Python is definitely the easiest programming language that's popular.
Foreign AffairsRe: Ghana As An African Model by Seun(mod): 10:12pm On Dec 08, 2008
What do you call the killings in Jos Kano and in the Niger Delta on a regular basis?
What we're experiencing today is nothing compared to a war.  They are incomparable.
ProgrammingRe: JavaFX Goes Live by Seun(mod): 7:39pm On Dec 08, 2008
Yet another language? No thanks. I've not got around to learning Javascript and Actionscript yet.
ProgrammingRe: Criticism Of Object Oriented Programming by Seun(mod): 4:06pm On Dec 08, 2008
Python is a dynamic language and it offers features that are common to most dynamic languages.

There is no point comparing its features with a static typed lang like Java because they are built for solving two different types of problems.
You make a good point.  The flexibility of Python is probably one of the reasons I am hardly tempted to create classes and such.  I can create ad-hoc tuples, lists and dictionaries to hold my data instead of defining classes.  I can return multiple values from a function instead of having to create a new class to contain them.  But this is still in line with my first comment on this topic:  "I recommend procedural programming and python". 

But:
OOP is all about defining classes , inheriting behaviour from other classes etc. If you have a lang that provides you a "Psuedo" way to acheiving this, then thats fine but to practice true OOP these concepts have to be strictly followed in some sense.
This is what I'm unhappy about.  Why do we assume OOP must be "strictly followed"?  Is it a religion?  If OOP isn't boosting your productivity in a particular project, why should it not be swept aside?

Another typical advantage of object Oriented Programming is CODE REUSE ABILITY.
When u write a class that performs a major task, you don't need to re-write it (Re-Invent The Wheel).
Code reusability is good, but it predates OOP.  Even a prehistoric language like C supports code reuse - hello, standard libraries!  In Python you can organize procedural code into modules, and import them elsewhere.

I can't remember re-writing the code that will login a user whenever i am writing a system that requires authentication in any project.
Because i av written a class that takes user name and password, encrypt the password and authenticates the user against any table specified in my project.

what i simply do is to reference the class library shikena in the new project.
Really? Even if the database schema changes completely? Even if columns are renamed and added? Nah.

All I'm saying is that classes and objects are just another programming construct.  Like variables.  And operators.  You don't see anyone talking about operator oriented programming do you?   And classes are not needed in every situation:

- A maths library doesn't have to contain a "sine" object, a "cosine" object, or even a "MathsWizard" object with a sin method.  It can just contain the mathematical functions you need.

- A user authentication library doesn't have to contain a User object.  All it needs are three functions: "register", "login", and "verifycookie".  OOP doesn't really fit database programming, because it's redundant (and wrong) to define the same business entities in two different places.

- A program to print the numbers one to ten does not need a "NumberPrinter" class.  Thanks.
Foreign AffairsRe: Ghana As An African Model by Seun(mod): 12:54pm On Dec 08, 2008
All these small African countries.   One day they are models, the next day they are fighting civil wars.
PhonesRe: iPhone Killer Apps Section!! by Seun(mod): 12:21pm On Dec 08, 2008
Use http://wap2.nairaland.com/ if you really want to enjoy nairaland on your iphone.
Christianity EtcRe: The Truth About Christ Embassy Healing School by Seun(mod): 12:18pm On Dec 08, 2008
Yes, it's odd. Smart person. wink
PoliticsRe: S. Korea Invests Krw350 Billion (us$235.9 Million) In Game Industry. by Seun(mod): 5:42am On Dec 08, 2008
Is that the government's job? Investing in video games?
PoliticsRe: Huge Capital Flight Hits Nigerian Economy by Seun(mod): 4:48am On Dec 08, 2008
Well. . . . .hard luck

Except you want to denominate ur assets in kaduna cowries, you will have
to put your money somewhere.
My point is, if both the naira and the dollar are going down, then there's no point converting one to the other. Hence no capital flight. Unless US-based investors are selling off their investments and going back home.
PoliticsRe: Huge Capital Flight Hits Nigerian Economy by Seun(mod): 2:46am On Dec 08, 2008
Do you think it's wiser to trust in the Naira than the dollar?
If the US economy is on the verge of collapsing, then I would trust neither since the naira depends on our petrodollars. I would definitely not convert my naira into dollars.
PoliticsRe: Huge Capital Flight Hits Nigerian Economy by Seun(mod): 1:52am On Dec 08, 2008
Because the crisis has gone global, many people in a global crisis rush to the developed markets, of which the US is the most prominent. Witness the strenghtening of the dollar.
But that is very stupid of them. I don't think people with access to lots of capital can be that stupid.

My guess is that governors have started looting again, and converting the looted billions into dollars.
PoliticsRe: Huge Capital Flight Hits Nigerian Economy by Seun(mod): 1:18am On Dec 08, 2008
How can the US financial crisis lead to an increase in demand for the dollar?  I am confused.
RomanceRe: If Your Boyfriend Steals To Satisfy You: by Seun(mod): 10:38pm On Dec 07, 2008
Nigerian girls for you. They want to risk the benefits of crime without facing any risks.
RomanceRe: If Your Boyfriend Steals To Satisfy You: by Seun(mod): 10:30pm On Dec 07, 2008
Missy B:
If I find out a guy steals just to make me happy . . . . .
As much as I try to make him realise I don't buy the idea with all firmity
and ensure he promises not to do it again . . . . Damn!!! Immediately I'll begin to have a soft spot
for him. He forthwith climbs to the top of ma respect and love chart.
Nufffin makes one as happy as knowing someone went outtta his/her way
to please you(sacrifice).
Look, let's face it, nobody steals to please another person.  When a thief is caught, he begins to look for excuses.  "I did it for you" is one of the more retarded excuses. Stealing is not a form of "sacrifice". It's just stealing.
ProgrammingRe: Python Programming by Seun(mod): 10:15pm On Dec 07, 2008
I was just trying to help you man.
ProgrammingRe: Python Programming by Seun(mod): 7:30pm On Dec 07, 2008
Java is wordy.  Perl is difficult to understand. Python is expressive and straightforward.
TV/MoviesRe: Project Fame West Africa: Iyanya Wins by Seun(mod): 6:53pm On Dec 07, 2008
I think Anette was definitely the best singer.
Nairaland GeneralRe: Spam On Webmaster Section Vs Spam On Programming Section by Seun(mod): 5:14pm On Dec 07, 2008
@niyyie: Relax, the problem is under control.   The moderator is dong his job.
Nairaland GeneralRe: Open Letter To Seun by Seun(mod): 4:39pm On Dec 07, 2008
Thanks a million for your suggestion. I appreciate it very much.
Nairaland GeneralRe: Spam On Webmaster Section Vs Spam On Programming Section by Seun(mod): 3:06pm On Dec 07, 2008
Currently, the Programmer section has more spam than the Webmaster section. How about that? wink
ProgrammingRe: Python Programming by Seun(mod): 11:51pm On Dec 06, 2008
Ok, I'll try it as soon as I can.
ProgrammingRe: Python Programming by Seun(mod): 11:13pm On Dec 06, 2008
You wrote:
      averagelength=round(float(sum([len(word) for word in sentence.split()]))/ len(words))

That's not Python.  That's Perl in Python.  Real Python is both clear and concise. wink

PS: I don't think it works.
ProgrammingRe: Criticism Of Object Oriented Programming by Seun(mod): 11:32pm On Dec 05, 2008
Python is object oriented
No. There's a difference between using objects and being object oriented. Python uses objects.

My problem is with a style of programming that languages like Java encourage. Where you cannot write a basic program without defining a class and inheriting something. I hate libraries that require inheritance. I believe in code modularity, but I only define new classes when I absolutely have to. In languages like Python, you tend to use lists, dictionaries, tuples, and modules where you would have had to define new classes in languages like Java.

So, yes, I use classes. I use objects. Inheritance. But only when the problem actually requires them.

When you develop large applications and the likes that businesses today demand,
maybe you'd appreciate these things more.
You don't need OOP for complex business applications. You need a well designed database. wink
ProgrammingRe: Python Programming by Seun(mod): 10:57pm On Dec 05, 2008
I'm pretty sure the word count example can be simplified in the same way. Python is not Java. wink
ProgrammingRe: Python Programming by Seun(mod): 10:24pm On Dec 05, 2008
You wrote:

def AverageWord (sentence):
    words=sentence.split()
    len_words=len(words)
    if len_words==1:print 'You Just Entered a Word'
    else:
        total=0
        for i in range(0,len_words):
            total +=len(words[i])
        print total
        average=total/float(len_words)
        print 'The Averge Word length in The Sentence is',average

That is Java Programming in Python.  This is Python:

def AverageWord (sentence):
    words = sentence.split()
    wordlengths = [len(word) for word in words]
    averagelength = sum(wordlengths) / len(words)
    print "Average Length:", averagelength
GamingRe: Will You Support A Nigerian-developed Game? by Seun(mod): 10:16pm On Dec 05, 2008
It will be difficult for a Nigerian game to surpass the foreign games that Nigerians are pirating everyday, unless the Nigerian game includes elements that are distinctly Nigerian and gives people a stronger incentive to pay for it.
PoliticsRe: This Picture Shows Why North Rules Nigeria: Give Your Comments! by Seun(mod): 9:32pm On Dec 05, 2008
Look, all politicians are the same. The game is not a clean game, because we (the followers) are so gullible.
CultureRe: ??? by Seun(mod): 4:58pm On Dec 04, 2008
It's a lovely court case. I hope she wins.
PoliticsRe: Police Science Should Be Introduced In Our Universities by Seun(mod): 12:41pm On Dec 04, 2008
Why not just introduce this courses in the Police academy? Universities have nothing to do with police training.
ProgrammingRe: Python Programming by Seun(mod): 12:13pm On Dec 04, 2008
I think what we need to do is separate this thread into two sections:
    Python Programming and Python Language Tutorial

func = lambda n:n*func(n-1) if n else 1
Can anyone interpret the above function?

Another Tutorial: http://personalpages.tds.net/~kent37/stories/00020.html#e20can-be-learned-in-a-few-days

1 2 3 4 5 6 7 8 ... 546 547 548 549 550 551 552 553 554 (of 1138 pages)