death to case sensitivity !

Started by meems, February 28, 2018, 20:31:37

Previous topic - Next topic

Xaron

Quote from: TomToad on March 02, 2018, 13:15:03
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.

col

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


    public class MyClass
    {
        private int variable = 10;
        MyClass()
        {
            // maybe do something
        }

        void Pointless()
        {
            MyClass MyClass = new MyClass();
            MyClass.variable = 20;
        }
    }

https://github.com/davecamp

"When you observe the world through social media, you lose your faith in it."

meems

>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.

col

Quotethat 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.
https://github.com/davecamp

"When you observe the world through social media, you lose your faith in it."

Derron

People enjoying case sensitivity surely also enjoy writing without brackets ;-)

Code (BlitzMax) Select

Superstrict
Import Brl.StandardIO

Type TAddList
Method AddList:TAddList(addlist:TAddList)
return addlist
End Method
End Type

local addList:TAddList = new TAddList

if addList addList.AddList addlist

if addList addList.AddList(addlist).AddList Addlist else new TAddList.AddList new TAddList



bye
Ron

col

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.
https://github.com/davecamp

"When you observe the world through social media, you lose your faith in it."

Derron

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

meems

@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.

degac

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


Derron

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

col

Quoteyeah... $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
https://github.com/davecamp

"When you observe the world through social media, you lose your faith in it."

Derron

> *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

Matty

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)

Derron

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