November 27, 2020, 08:17:37 AM

Author Topic: death to case sensitivity !  (Read 7113 times)

Offline Xaron

  • Sr. Member
  • ****
  • Posts: 311
Re: death to case sensitivity !
« Reply #30 on: March 02, 2018, 02:10:33 PM »
Use this code for an example.

...

Now this example is just a scaled down, bare minimum example of the problem.  In reality, this would probably be a much larger project.   The global Wheel might be tucked deep inside a sub-header of another header inside a physics library that you imported.

And here's the problem. Using globals in larger projects is just a big NO NO. So when you rely on globals in larger projects you have clearly some design issues.

In C++ you have tools for static code analysis (like lint) which would prevent you from doing that anyway.

Offline col

  • Sr. Member
  • ****
  • Posts: 465
Re: death to case sensitivity !
« Reply #31 on: March 02, 2018, 02:10:55 PM »
In C# you can have the same variable name as a type name, which I think is rather stupid but still... we are talking about MS  :P

Code: [Select]
    public class MyClass
    {
        private int variable = 10;
        MyClass()
        {
            // maybe do something
        }

        void Pointless()
        {
            MyClass MyClass = new MyClass();
            MyClass.variable = 20;
        }
    }
To be is to be perceived.

https://github.com/davecamp

Offline meems

  • Sr. Member
  • ****
  • Posts: 310
Re: death to case sensitivity !
« Reply #32 on: March 02, 2018, 02:46:58 PM »
>In C# you can have the same variable name as a type name
that plays to my suspicion that at least half of all work in the programming industry is faux, just chopping sand with a breadknife for lack of decent work to get paid for. A dreadful language design to tie programmers in their own knots, and get paid for untying themselves.

Offline col

  • Sr. Member
  • ****
  • Posts: 465
Re: death to case sensitivity !
« Reply #33 on: March 02, 2018, 03:07:10 PM »
Quote
that plays to my suspicion that at least half of all work in the programming industry is faux
You can say the same of that with all industries - most use fancy ideas, practices and vocabulary that isn't used by regular public in order to keep those 'untrained' out.

For a good example just look at the legal systems that are in place with its fancy methods of working and fancy words that only lawyers understand, most of which could just as easily be expressed using regular language that EVERYONE can understand. It's all about keeping those who know 'in' and those that don't 'out' - justifying your position and all that crap. The more you learn about this kind of stuff then the more you may be disappointed - personally I find it all rather fascinating and predictable but meh that's just me.
To be is to be perceived.

https://github.com/davecamp

Offline Derron

  • Hero Member
  • *****
  • Posts: 3262
Re: death to case sensitivity !
« Reply #34 on: March 02, 2018, 03:09:16 PM »
People enjoying case sensitivity surely also enjoy writing without brackets ;-)

Code: BlitzMax
  1. Superstrict
  2. Import Brl.StandardIO
  3.  
  4. Type TAddList
  5.         Method AddList:TAddList(addlist:TAddList)
  6.                 return addlist
  7.         End Method
  8. End Type
  9.  
  10. local addList:TAddList = new TAddList
  11.  
  12. if addList addList.AddList addlist
  13.  
  14. if addList addList.AddList(addlist).AddList Addlist else new TAddList.AddList new TAddList
  15.  


bye
Ron

Offline col

  • Sr. Member
  • ****
  • Posts: 465
Re: death to case sensitivity !
« Reply #35 on: March 02, 2018, 03:20:06 PM »
Brackets serve a purpose. They are not there for nothing ;)
Semi-colon at the end of every single statement I find a waste of time.

Case-Sensitivity I'm not so bothered about. I use Visual Studio Pro 2017 at work and it has quite possibly the best editor I've used so case-sensitivity isn't really an issue for me personally. VS also has, arguably, the best debugger too.
To be is to be perceived.

https://github.com/davecamp

Offline Derron

  • Hero Member
  • *****
  • Posts: 3262
Re: death to case sensitivity !
« Reply #36 on: March 02, 2018, 03:42:44 PM »
When doing work in the laboratory the computers there are xeons (8core) and with its remote drives and some other limitations start up times for VS Studio (or Atmel Studio - based on VS) is crying: go out, make a break, come back in 2 minutes).
also IntelliJ is taking some seconds more than needed.
So if you want to test a small thing you might need to wait longer for the start up finishing than for the actual coding.

But hell yes, these IDEs are real beasts. Think most of us wont use all the stuff they provide. With BlitzMax or Monkey you most often would only need the debugger (breakpoints and stack analysis). Some simple refactoring (variable renaming and so on) and some kind of intellisense (autocomplete-list + inline function definition tooltip). Such a cut down version would have way shorter start up times...


I almost everytime use the brackets in function calls ... list.AddLast(obj) etc.
Only exceptions are
SetColor 255,255,255
SetAlpha 1.0
print ""

Somehow I am so used to these that I skip the brackets there... Maybe this is also because you do not "chain" or evaluate them (if print("bla") then...).


@ code guidelines
Maybe just use UpperCamelCase for functions, prepend "T" to types, prepend _underscore to private variables (if "private" is not supported by the language), UPPERCASE_UNDERSCORE_CONST for constants and lowerCamelCase for variables.
You will embrace the C-coders, people are able to read it properly and you avoid hungarian notation (Saw it very often in micro-C code) means prepending the variable type in front of the variable.

Fixing variations of this could be done by the IDEs code-beautifier / formatter.


bye
Ron

Offline meems

  • Sr. Member
  • ****
  • Posts: 310
Re: death to case sensitivity !
« Reply #37 on: March 02, 2018, 06:09:52 PM »
@col
yes i agree.  I'm a geology hobbyist and they might as well have their own dictionary. A few jargons are necessary but once u understand the lingo u realise a lot of its there just to sound clever.

Offline degac

  • Full Member
  • ***
  • Posts: 159
    • graphio.net
Re: death to case sensitivity !
« Reply #38 on: March 03, 2018, 08:56:59 AM »
Case Sensitive=time consuming

You need to check everytime what you are writing, it's a waste of energy

If there's a problem, there's at least one solution.
www.blitzmax.org

Offline Xaron

  • Sr. Member
  • ****
  • Posts: 311
Re: death to case sensitivity !
« Reply #39 on: June 04, 2018, 02:44:37 PM »

Offline Derron

  • Hero Member
  • *****
  • Posts: 3262
Re: death to case sensitivity !
« Reply #40 on: June 04, 2018, 03:54:16 PM »
yeah... $fileName versus $filename. I tend to use $filename though I try to use lowerCamelCase for most variable names and UpperCamelCase for functions/class names.


bye
Ron

Offline col

  • Sr. Member
  • ****
  • Posts: 465
Re: death to case sensitivity !
« Reply #41 on: June 04, 2018, 04:53:36 PM »
Quote
yeah... $fileName versus $filename. I tend to use $filename though I try to use lowerCamelCase for most variable names and UpperCamelCase for functions/class names.

In VStudio, a C# project will highlight that a method name starting with a lower-case is, and I quote...

'Naming rule violation: These words must begin with upper case characters: '

and places the 'offending' method name on the end.
*sigh* and there was me thinking that it was me that's supposed to tell the computer what to do, not the other way around :D
To be is to be perceived.

https://github.com/davecamp

Offline Derron

  • Hero Member
  • *****
  • Posts: 3262
Re: death to case sensitivity !
« Reply #42 on: June 04, 2018, 05:35:45 PM »
> *sigh* and there was me thinking that it was me that's supposed to tell the computer what to do, not the other way around

Hah, this changed in the 80s of the last century. "In computers we trust" is what could get printed on modern Dollar notes.


bye
Ron

Offline Matty

  • Hero Member
  • *****
  • Posts: 1253
    • MattiesGames
Re: death to case sensitivity !
« Reply #43 on: June 04, 2018, 06:59:07 PM »
A brief scan of the ideas in this thread shows me that zome of the thoughts expressed never make it to industry or the real world.

Eg.

At work-
The language we use treats database field names as globals throughout every program and core and custom programs use global vvariabls absolutely everywhere ( we prefix them with ws- 'working storage')

Case sensitivity is a beautiful thing to me.

The ide we use at work is terminal based unix 'vi' - no colour, no mouse driven features, full of arcane hot keys even exiting is mysterious (press escape then colon plus 'q!' to exit - cant exit with standard windows methods)

Offline Derron

  • Hero Member
  • *****
  • Posts: 3262
Re: death to case sensitivity !
« Reply #44 on: June 04, 2018, 07:35:33 PM »
you really ":q!" ? Never lost unsaved changes?

Without case-sensitivity you cannot prepend "ws-" to your globals? What do "[...] treats database field names as globals [...] " have to do with case-sensitivity?
Only possible answer is: your database is case-sensitive already, enforcing you then to take care of this case-sensitive field names ...


bye
Ron

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal